Пример #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    textResult = (TextView) findViewById(R.id.textResult);
    messageBuilder = new StringBuilder();
    PushReceiver.setHandler(mHandler);
    IntentFilter filter = new IntentFilter();
    filter.addAction(Constant.ACTION_DELETE_PUSH_MSG);
    // filter.addAction(Intent.ACTION_BATTERY_CHANGED);
    filter.addAction(Intent.ACTION_TIME_TICK);
    if (Build.VERSION.SDK_INT > 22) {
      filter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED);
      filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);
    }

    PackageManager pm = this.getPackageManager();
    Logger.mLogLevel = 2;

    ApplicationInfo info = null;
    boolean isDebuggingStatus;
    try {
      info = getPackageManager().getApplicationInfo("com.ktpns.pa", PackageManager.GET_META_DATA);
      isDebuggingStatus = ((info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0);
      appendString("debbuggable : " + isDebuggingStatus);
    } catch (NameNotFoundException e) {
      return;
    }
  }
Пример #2
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   PushReceiver.setHandler(null);
   // Intent result_intent = new Intent();
   // result_intent.setComponent(new ComponentName("com.ktpns.pa",
   // "com.ktpns.lib.receiver.DeviceEventReceiver"));
   // result_intent.setAction("VERIFICATION_MODE_CHANGE");
   // result_intent.putExtra("VERIFICATION_MODE", 0x03);
   // sendBroadcast(result_intent);
 }