@DSVerified
  @DSBan(DSCat.DROIDSAFE_INTERNAL)
  public static void modelBroadCastReceiver(BroadcastReceiver receiver) {
    if (mApplication != null) {
      receiver.setApplication(mApplication);
      // callback receiver
      if (receiver instanceof android.app.admin.DeviceAdminReceiver) {
        DeviceAdminReceiver ar = (DeviceAdminReceiver) receiver;
        Intent appIntent = mApplication.droidsafeGetIntent();
        ar.onDisableRequested(context, appIntent);
        ar.onDisabled(context, appIntent);
        ar.onEnabled(context, appIntent);
        ar.onPasswordChanged(context, appIntent);
        ar.onPasswordExpiring(context, appIntent);
        ar.onPasswordFailed(context, appIntent);
        ar.onPasswordSucceeded(context, appIntent);
      }

      if (receiver instanceof android.appwidget.AppWidgetProvider) {
        AppWidgetProvider aw = (AppWidgetProvider) receiver;
        Intent appIntent = mApplication.droidsafeGetIntent();
        aw.onReceive(context, appIntent);
        aw.onEnabled(context);
        aw.onDisabled(context);
        int[] appWidgetIds = new int[1];
        appWidgetIds[0] = DSUtils.FAKE_INT;
        aw.onUpdate(context, AppWidgetManager.getInstance(context), appWidgetIds);
        aw.onDeleted(context, appWidgetIds);
      }
    }
  }
  @Override
  public void onPasswordFailed(Context context, Intent intent) {
    super.onPasswordFailed(context, intent);
    Log.i(TAG, "onPasswordFailed");

    SharedPreferences sharedPref = context.getSharedPreferences("state", Context.MODE_PRIVATE);
    int lockNum = sharedPref.getInt("LockNum", 3);
    if (k < lockNum) {
      k++;
      if (k == lockNum) {
        Intent i = new Intent(context, Cam_GPS_Activity.class);
        i.putExtra("function", function);
        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
        context.startActivity(i);
      }
    }
  }
Beispiel #3
0
 @Override
 public void onEnabled(Context context, Intent intent) {
   super.onEnabled(context, intent);
   Log.i(LOG_TAG_ADMIN, "Device admin is now active!");
 }
 @Override
 public void onPasswordSucceeded(Context context, Intent intent) {
   super.onPasswordSucceeded(context, intent);
   Log.i(TAG, "onPasswordSucceeded");
   k = 0;
 }
 @Override
 public void onPasswordChanged(Context context, Intent intent) {
   super.onPasswordChanged(context, intent);
   Log.d(TAG, "onPasswordChanged");
 }
 @Override
 public void onDisabled(Context context, Intent intent) {
   super.onDisabled(context, intent);
   Log.i(TAG, "서비스 종료");
 }
Beispiel #7
0
 @Override
 public void onDisabled(Context context, Intent intent) {
   super.onDisabled(context, intent);
 }