private final void updateDataNetType(int slotId) {
int tempDataNetType;
NetworkType tempDataNetType3G = NetworkType.Type_G;

if (slotId == Phone.GEMINI_SIM_1) {
tempDataNetType = mDataNetType;
} else {
tempDataNetType = mDataNetTypeGemini;
}
Xlog.d(TAG, "updateDataNetType(" + slotId + "), DataNetType=" + tempDataNetType + ".");

int simColorId = SIMHelper.getSIMColorIdBySlot(mContext, slotId);
if (simColorId == -1) {
return;
}
Xlog.d(TAG, "updateDataNetType(" + slotId + "), simColorId=" + simColorId);

boolean tempIsRoaming = false;
if ((isCdma(slotId) && isCdmaEri(slotId))
|| mPhone.isNetworkRoamingGemini(slotId)) {
int tempRoamingId = 0;

if (simColorId > -1 && simColorId < 4) {
tempRoamingId = TelephonyIconsGemini.ROAMING[simColorId];
}
Xlog.d(TAG, "updateDataNetType(" + slotId + ") RoamingresId= " + tempRoamingId + " simColorId = " + simColorId);
if (slotId == Phone.GEMINI_SIM_1) {
mIsRoaming = true;
mIsRoamingId = tempRoamingId;
} else {
mIsRoamingGemini = true;
mIsRoamingGeminiId = tempRoamingId;
}
tempIsRoaming = true;
} else {
if (slotId == Phone.GEMINI_SIM_1) {
mIsRoaming = false;
mIsRoamingId = 0;
} else {
mIsRoamingGemini = false;
mIsRoamingGeminiId = 0;
}
}

DataType tempDateType;

String tempContentDescriptionDataType;
if (mIsWimaxEnabled && mWimaxConnected) {
// wimax is a special 4g network not handled by telephony
tempDateType = DataType.Type_4G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_4g);
} else {
switch (tempDataNetType) {
case TelephonyManager.NETWORK_TYPE_UNKNOWN:
if (!mShowAtLeastThreeGees) {
tempDateType = DataType.Type_G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_gprs);
break;
} else {
// fall through
}
case TelephonyManager.NETWORK_TYPE_EDGE:
if (!mShowAtLeastThreeGees) {
tempDateType = DataType.Type_E;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_edge);
break;
} else {
// fall through
}
case TelephonyManager.NETWORK_TYPE_UMTS:
tempDataNetType3G = NetworkType.Type_3G;
tempDateType = DataType.Type_3G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_3g);
break;
case TelephonyManager.NETWORK_TYPE_HSDPA:
case TelephonyManager.NETWORK_TYPE_HSUPA:
case TelephonyManager.NETWORK_TYPE_HSPA:
case TelephonyManager.NETWORK_TYPE_HSPAP:
tempDataNetType3G = NetworkType.Type_3G;
if (mHspaDataDistinguishable) {
tempDateType = DataType.Type_H;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_3_5g);
} else {
tempDateType = DataType.Type_3G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_3g);
}
break;
case TelephonyManager.NETWORK_TYPE_CDMA:
// display 1xRTT for IS95A/B
tempDataNetType3G = NetworkType.Type_1X;
tempDateType = DataType.Type_1X;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_cdma);
break;
case TelephonyManager.NETWORK_TYPE_1xRTT:
tempDataNetType3G = NetworkType.Type_1X;
tempDateType = DataType.Type_1X;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_cdma);
break;
case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through
case TelephonyManager.NETWORK_TYPE_EVDO_A:
case TelephonyManager.NETWORK_TYPE_EVDO_B:
case TelephonyManager.NETWORK_TYPE_EHRPD:
tempDataNetType3G = NetworkType.Type_1X3G;
tempDateType = DataType.Type_3G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_3g);
break;
case TelephonyManager.NETWORK_TYPE_LTE:
tempDateType = DataType.Type_4G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_4g);
break;
default:
if (!mShowAtLeastThreeGees) {
tempDataNetType3G = NetworkType.Type_G;
tempDateType = DataType.Type_G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_gprs);
} else {
tempDataNetType3G = NetworkType.Type_3G;
tempDateType = DataType.Type_3G;
tempContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_3g);
}
break;
}
}

Android 源码 判断网络数据类型的更多相关文章

  1. Android源码服务专家(申明:来源于网络)

    Android源码服务专家(申明:来源于网络) 地址:http://www.javaapk.com/topics/demo/page/20/

  2. 从Android源码的角度分析Binder机制

    欢迎访问我的个人博客,原文链接:http://wensibo.top/2017/07/03/Binder/ ,未经允许不得转载! 前言 大家好,好久不见,距离上篇文章已经有35天之久了,因为身体不舒服 ...

  3. android源码的目录结构

    android源码的目录结构 [以下网络摘抄] |-- Makefile ! l/ a5 n% S% @- `0 d# z# a$ P4 V3 o7 R|-- bionic              ...

  4. Android源码-学习随笔

    在线代码网站1:http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/ 书籍: ...

  5. android源码编译1

    一.环境说明: 1.liunx系统:Ubuntu12.04 2.jdk:sun-java6-jdk 3.g++4.5 gcc4.5 二.android源码的目录结构 |-- Makefile |-- ...

  6. 2014年最新720多套Android源码2.0GB免费一次性打包下载

    之前发过一个帖子,但是那个帖子有点问题我就重新发一个吧,下面的源码是我从今年3月份开始不断整理源码区和其他网站上的android源码,目前总共有720套左右,根据实现的功能被我分成了100多个类,总共 ...

  7. Android SDK目录具体结构及Android源码的具体结构

    Android SDK目录具体结构 1. add-ons:这里面保存着附加库,比如Google Maps,当然你如果安装了OphoneSDK,这里也会有一些类库在里面. 2. docs:这里面是And ...

  8. MTK Android 源码目录分析

    Android 源码目录分析 Android 4.0 |-- abi (application binary interface:应用二进制接口)|-- art (average retrieval ...

  9. Eclipse与Android源码中ProGuard工具的使用

    由于工作需要,这两天和同事在研究android下面的ProGuard工具的使用,通过查看android官网对该工具的介绍以及网络上其它相关资料,再加上自己的亲手实践,算是有了一个基本了解.下面将自己的 ...

随机推荐

  1. javascript面向对象和原型

    /* //工厂模式 function createObject(name,age){ var obj = new Object();//新建一个对象 obj.name=name;//新建对象的属性 o ...

  2. jquery 简单弹出层

    预定义html代码:没有 所有代码通过js生成和移除. 预定义css .z-popup-overlay{ width:100%; min-height: 100%; height:800px; pos ...

  3. 打造一款属于自己的web服务器——开篇

    JVM总结慢慢来吧,先插播一篇水文,来介绍下最近业余一直在写的一个小项目——easy-httpserver(github).适合新手学习,大神们路过即可^_^. 一.这是个什么玩意? easy-htt ...

  4. shell 编程基础

    1 创建shell脚本文件 要创建一个shell脚本文件,必须在第一行指定要使用的shell,其格式为: #! /bin/bash 接着加上该shell文件的注释,说明该脚本文件用来干什么,有谁创建, ...

  5. Labview实现脉波调制( PDM )

    Labview实现脉波调制( PDM ) 根据定义为脉冲宽度调制 生成一个正弦信号,得到其幅值输入给一个方波信号的占空比 由于方波信号的占空比里面含有正弦信号的信息 因此通过滤出方波信号的占空比信息则 ...

  6. C++设计模式——享元模式

    本文版权归果冻说所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利.如果这篇文章对你有帮助,你可以请我喝杯咖啡. » 本文链接:http:// ...

  7. 小组开发项目针对性的NABC分析

    单独就我们团队开发项目——重力解锁的功能特点而言,我们解决了智能手机屏幕解锁的乏味和繁琐的特点,显得更有趣味性和独特性,更符合现代人追随时尚的潮流:我们根据个人的不同喜好和便利性来设定一些动作,利用重 ...

  8. Careercup - Microsoft面试题 - 5700293077499904

    2014-05-12 00:02 题目链接 原题: For a given map (ie Bing map) given longitude/latitude/ how would you desi ...

  9. 【转】eclipse下使用hibernate tools实现hibernate逆向工程

    一.基本环境 Eclipse 3.6 AppFuse Struts2 2.1.0 JBoss Hibernate Tools 3.4.0 二.JBoss Hibernate Tools 3.4.0安装 ...

  10. 使用 NIO.2 遍历目录下所有的Java文件

    package wellGrounded; import java.io.IOException; import java.nio.file.FileVisitResult; import java. ...