拨号盘增加暗码

在Dialer下面有类:

SpecialCharSequenceMgrProxy.java

******************************************

 public static boolean handleChars(Context context, String input,
              EditText textField) {
          if (input.equals(MMI_FACOTRY_MODE)) {
              return enterFactoryMode(context);
          } else if ("*#55555#".equals(input) && isApkExist(context, "com.android.smsregister")) {
              Intent intent = new Intent();
              intent.setClassName("com.android.smsregister", "com.android.smsregister.TestSms");
              context.startActivity(intent);
             return true;
          } else if ("*#4634#".equals(input)) {
              Intent intent = new Intent();
              intent.setClassName("com.android.settings", "com.android.settings.WriteIMEIDialog");
              context.startActivity(intent);
              return true;
          } else if ("*#*#76#*#*".equals(input)) {
              showMotherBoardTestDialog(context);
          } else if (input.equals("*#11#")) {
              return enterAgingTest(context);
          } else if (input.equals("*#16#")) {
              return enterAgingTest(context);
          } else if ("*#999#".equals(input)) {
              Intent intent = new Intent();
             intent.setClassName("com.android.settings", "com.android.settings.ResetFactoryActivity");
             context.startActivity(intent);
             return true;
         } else if (input.equals("*#0000#")) {
             AlertDialog alert = new AlertDialog.Builder(context)
                 .setTitle("Build number")
                 .setMessage(SystemProperties.get("ro.build.display.id"))
                 .setPositiveButton(android.R.string.ok, null)
                 .setCancelable(false)
                 .show();
             return true;
         }


//该方法是进入工厂测试

static boolean enterAgingTest(Context context) {
         Intent i = new Intent(Intent.ACTION_MAIN);
         i.setComponent(new ComponentName("com.mediatek.factorymode",
                     "com.mediatek.factorymode.agingtest.AgingTestBegin"));
         i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         context.startActivity(i);
         return true;
     }


********************************************


如上,设置input等于暗码即可。



本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部