当前位置: 首页 > news >正文

洪梅镇仿做网站网站关键字统计

洪梅镇仿做网站,网站关键字统计,公司网站忘了怎么做,免费建域名网站背景 应用内不指定subId获取数据状态可能会错误#xff0c;因为可能拿到voice的能力#xff0c;而非data。 代码逻辑 1、通过TelephonyManager的isDataEnabled()没有指定subId时#xff0c;调用内部方法isDataEnabledForReason#xff0c;传入getId()参数以指定subid因为可能拿到voice的能力而非data。 代码逻辑 1、通过TelephonyManager的isDataEnabled()没有指定subId时调用内部方法isDataEnabledForReason传入getId()参数以指定subid然后会执行到SubscriptionManager的getDefaultDataSubscriptionId()以获取默认值 /*** Returns whether mobile data is enabled or not per user setting. There are other factors* that could disable mobile data, but they are not considered here.** If this object has been created with {link #createForSubscriptionId}, applies to the given* subId. Otherwise, applies to {link SubscriptionManager#getDefaultDataSubscriptionId()}** pRequires one of the following permissions:* {link android.Manifest.permission#ACCESS_NETWORK_STATE},* {link android.Manifest.permission#MODIFY_PHONE_STATE}, or* {link android.Manifest.permission#READ_BASIC_PHONE_STATE* READ_BASIC_PHONE_STATE} or that the calling app has carrier* privileges (see {link #hasCarrierPrivileges}).** pNote that this does not take into account any data restrictions that may be present on the* calling app. Such restrictions may be inspected with* {link ConnectivityManager#getRestrictBackgroundStatus}.** return true if mobile data is enabled.*/ RequiresPermission(anyOf {android.Manifest.permission.ACCESS_NETWORK_STATE,android.Manifest.permission.MODIFY_PHONE_STATE,android.Manifest.permission.READ_PHONE_STATE,android.Manifest.permission.READ_BASIC_PHONE_STATE}) RequiresFeature(PackageManager.FEATURE_TELEPHONY_DATA) public boolean isDataEnabled() {try {return isDataEnabledForReason(DATA_ENABLED_REASON_USER);} catch (IllegalStateException ise) {// TODO(b/176163590): Remove this catch once TelephonyManager is booting safely.Log.e(TAG, Error calling #isDataEnabled, returning default (false)., ise);return false;} }2、根据SubscriptionManager逻辑会查询获取DefaultSubId的值最终用的是SubscriptionController数据 /*** Returns the systems default data subscription id.** On a voice only device or on error, will return INVALID_SUBSCRIPTION_ID.** return the default data subscription Id.*/ public static int getDefaultDataSubscriptionId() {return sDefaultDataSubIdCache.query(null); } 3、SubscriptionController的逻辑未指定subid时拿到的会是voice的 能力 使用方法和说明 在Android中TelephonyManager类的isDataEnabled()方法用于检查移动数据连接是否启用。而subIdSubscription ID是用于标识不同SIM卡的唯一ID。 NoteisDataEnable()可不传入参数即默认的subId使用getDefaultDataSubscriptionId()方法获取也可以指定subId如下代码示例。 在多卡手机中可以通过TelephonyManager的getSubId()方法获取当前活动的SIM卡的SubId然后可使用TelephonyManager.isDataEnabled()方法检查指定的subId对应的SIM卡的移动数据链接是否启用 代码示例   TelephonyManager mTelephonyManager (TelephonyManager) getSystemService(context.TELEPHONY_SERVICE);int subId 1; //要检查的SIM的subIdif(mTelephonyManager.isDataEnabled(subId)) {//移动数据已启用 } else {//移动数据未启用 } 代码链接参考 TelephonyManager.isDataEnable()SubscriptionManager.getDefaultDataSubscriptionId()SubscriptionController.getDefaultSubId()
http://www.pierceye.com/news/584595/

相关文章:

  • 做网站虚拟主机配置汉沽手机网站建设
  • 设计一个网站先做哪些构造姑苏区建设局网站
  • 制造业营销外贸网站建设网站管理的内容包括
  • 看电视剧的免费网站app下载网站等保如何做
  • 如何做网站的营销中山vi设计公司
  • 搜索引擎网站使用的排名规则室内设计联盟网页版
  • php 手机网站开发手机端网站开发框架
  • 苏州电信网站备案浙江搜索引擎优化
  • 黄岛网站建设哪家好市体育局网站 两学一做
  • 上海建设银行网站转账记录吗外国网站做问卷调查挣钱
  • 深圳做购物网站十堰网络销售
  • 郑州企业网站优化多少钱百度竞价排名价格
  • js特效做的好的网站什么专业是做网站
  • 淄川响应式网站建设网站在国内服务器在国外
  • 施工企业市场经营工作思路及措施个人如何优化网站有哪些方法
  • 怎么做一个盈利网站义乌创博网络科技有限公司
  • 学校网站建设代码不重名的建筑公司名字
  • 网站开发模块的需求海外销售平台有哪些
  • 前端和后端的区别工资郑州网站优化怎样做
  • 小程序模板平台有哪些网站优化包括哪些内容
  • 免费建网站的好的移动端网站模板下载
  • 青岛网站优化排名视频源网站怎么做
  • 做网站找我二级学院网站建设方案
  • 知名网站建设公司 北京近期网络营销的热点事件
  • 网站开发产品经理网站例子
  • 动态静态结合网站网站做404是什么意思
  • 注册域名的网站网站建设的具体步骤
  • 行业网站分类自建站排名
  • 网站备案 登陆安徽省住房和城乡建设厅网站领域
  • 做个网站需要多少钱.网站建设合同注意事项