PhoneNumberUtils.java 文件(frameworks\base\telephony\java\android\telephony)
/** * isEmergencyNumber: checks a given number against the list of * emergency numbers provided by the RIL and SIM card. * * @param number the number to look up. * @return if the number is in the list of emergency numbers * listed in the ril / sim, then return true, otherwise false. */ public static boolean isEmergencyNumber(String number) { // If the number passed in is null, just return false: if (number == null) return false;
// Strip the separators from the number before comparing it // to the list. number = extractNetworkPortionAlt(number);
// retrieve the list of emergency numbers // check read-write ecclist property first String numbers = SystemProperties.get("ril.ecclist"); if (TextUtils.isEmpty(numbers)) { // then read-only ecclist property since old RIL only uses this numbers = SystemProperties.get("ro.ril.ecclist"); }
if (!TextUtils.isEmpty(numbers)) { // searches through the comma-separated list for a match, // return true if one is found. for (String emergencyNum : numbers.split(",")) { if (number.startsWith(emergencyNum)) { return true; } } // no matches found against the list! return false; }
//no ecclist system property, so use our own list. return (number.startsWith("112") || number.startsWith("911")); }

更多相关文章

  1. Android文件拷贝
  2. Android 文件下载工具类
  3. Android Studio学习之对文件的基本了解
  4. android 大文件分割上传(分块上传)
  5. AndroidManifest.xml配置文件详解
  6. Android 解决WebView无法上传文件的问题

随机推荐

  1. Android事件分发机制的探索与发现之ViewG
  2. Spans
  3. 完整的android开发环境搭建和源代码编译
  4. Android(安卓)listview增加条目时自动回
  5. Android利用Get/Post方式异步请求Json数
  6. Android(安卓)实现左右声道播放不同音乐
  7. 面试题及答案
  8. 使用华为手机在Android(安卓)Studio上进
  9. ButterKnife 使用教程
  10. Android(安卓)View框架总结(九)KeyEvent事