@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);
      }
    }
  }
示例#2
0
 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
   super.onDeleted(context, appWidgetIds);
   for (int appWidgetId : appWidgetIds) {
     PrefUtils.deleteWidget(context, appWidgetId);
   }
 }
  @Override
  public void onDeleted(Context context, int[] appWidgetIds) {
    // TODO Auto-generated method stub
    super.onDeleted(context, appWidgetIds);

    Toast.makeText(context, "Widget Silindi", Toast.LENGTH_SHORT).show();
  }
示例#4
0
 /** Each time an instance is removed, we cancel the associated AlarmManager. */
 @Override
 public void onDeleted(Context context, int[] widgetIds) {
   super.onDeleted(context, widgetIds);
   for (int widgetId : widgetIds) {
     cancelAlarm(context, widgetId);
   }
 }
 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
   super.onDeleted(context, appWidgetIds);
   for (int widgetId : appWidgetIds) {
     deleteWidgetPrefs(context, widgetId);
   }
 }
 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
   // TODO Auto-generated method stub
   for (int i = 0; i < appWidgetIds.length; i++) {
     CalculatorWidgetEntity entity = queryEntityById(appWidgetIds[i]);
     if (entity != null) {
       mEntities.remove(entity);
     }
   }
   super.onDeleted(context, appWidgetIds);
 }
示例#7
0
  @Override
  public final void onDeleted(Context context, int[] appWidgetIds) {
    super.onDeleted(context, appWidgetIds);
    for (int appWidgetId : appWidgetIds) {
      ((AlarmManager) context.getSystemService(Context.ALARM_SERVICE))
          .cancel(
              PendingIntent.getService(
                  context,
                  0,
                  new Intent(context, SonetService.class).setAction(Integer.toString(appWidgetId)),
                  0));
      context
          .getContentResolver()
          .delete(
              Widgets.getContentUri(context),
              Widgets.WIDGET + "=?",
              new String[] {Integer.toString(appWidgetId)});
      context
          .getContentResolver()
          .delete(
              WidgetAccounts.getContentUri(context),
              WidgetAccounts.WIDGET + "=?",
              new String[] {Integer.toString(appWidgetId)});
      Cursor statuses =
          context
              .getContentResolver()
              .query(
                  Statuses.getContentUri(context),
                  new String[] {Statuses._ID},
                  Statuses.WIDGET + "=?",
                  new String[] {Integer.toString(appWidgetId)},
                  null);

      if (statuses.moveToFirst()) {
        while (!statuses.isAfterLast()) {
          context
              .getContentResolver()
              .delete(
                  StatusLinks.getContentUri(context),
                  StatusLinks.STATUS_ID + "=?",
                  new String[] {Long.toString(statuses.getLong(0))});
          statuses.moveToNext();
        }
      }

      statuses.close();
      context
          .getContentResolver()
          .delete(
              Statuses.getContentUri(context),
              Statuses.WIDGET + "=?",
              new String[] {Integer.toString(appWidgetId)});
    }
  }
 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
   Log.d("Deleting Room Widgets: " + Arrays.toString(appWidgetIds));
   for (int appWidgetId : appWidgetIds) {
     try {
       DatabaseHandler.deleteRoomWidget(appWidgetId);
     } catch (Exception e) {
       Log.e(e);
     }
   }
   super.onDeleted(context, appWidgetIds);
 }
示例#9
0
  @Override
  public void onDeleted(Context context, int[] appWidgetIds) {

    super.onDeleted(context, appWidgetIds);
    if (timers != null) {
      for (int i = 0; i < appWidgetIds.length; i++) {
        Timer timer = (Timer) timers.get(appWidgetIds[i]);
        if (timer != null) {
          timer.cancel();
          Toast.makeText(context, "该Widget已被删除.", Toast.LENGTH_SHORT).show();
        }
      }
    }
  }
  @Override
  public void onDeleted(Context context, int[] appWidgetIds) {
    super.onDeleted(context, appWidgetIds);

    for (int i : appWidgetIds) {

      SharedPreferences prefs =
          context.getSharedPreferences(WidgetUtils.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
      prefs
          .edit()
          .remove(WidgetUtils.SHARED_PREFERENCES_NAME + i + WidgetUtils.SHARED_PREFERENCES_ROW)
          .commit();
      prefs
          .edit()
          .remove(WidgetUtils.SHARED_PREFERENCES_NAME + i + WidgetUtils.SHARED_PREFERENCES_COLORFUL)
          .commit();
    }
  }
  @Override
  public void onDeleted(Context context, int[] appWidgetIds) {
    SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(context);
    SharedPreferences.Editor mPrefsEditor = mPrefs.edit();

    for (int appWidgetId : appWidgetIds) {
      mPrefsEditor.remove("widget_" + appWidgetId);

      if (Constants.debugModeWidget) Log.d(TAG, "DELETE WIDGET - WIDGET_ID: " + appWidgetId);
    }

    /*
    //Delete All App Widgets
    for(int appWidgetId = 0; appWidgetId < 1000; appWidgetId++)	{
    	mPrefsEditor.remove("widget_" + appWidgetId);

    	if(Constants.debugModeWidget)
    		Log.d(TAG, "DELETE WIDGET - WIDGET_ID: " + appWidgetId);
    }*/

    mPrefsEditor.commit();

    super.onDeleted(context, appWidgetIds);
  }
 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
   super.onDeleted(context, appWidgetIds);
 }
示例#13
0
 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
   // TODO Auto-generated method stub
   super.onDeleted(context, appWidgetIds);
 }
示例#14
0
 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
   WeatherUpdateService_.intent(context).stop();
   super.onDeleted(context, appWidgetIds);
 }