@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 onDisabled(Context context) { super.onDisabled(context); Log.d("Now Widget", "Widget Provider disabled. Turning off timer"); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); alarmManager.cancel(createClockTickIntent(context)); }
@Override public void onDisabled(Context context) { super.onDisabled(context); Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget disabled"); SharedPreferences preferences = PrefSettings.getSharedPrefs(context); preferences.edit().putBoolean("widgetSmallEnabled", false).commit(); }
@Override public void onDisabled(Context context) { Intent intent = new Intent(context.getApplicationContext(), UpdateWidgetService.class); context.stopService(intent); super.onDisabled(context); }
@Override public void onDisabled(Context context) { super.onDisabled(context); }
@Override public void onDisabled(Context context) { // TODO Auto-generated method stub super.onDisabled(context); }
@Override public void onDisabled(Context context) { // Enter relevant functionality for when the last widget is disabled super.onDisabled(context); Log.d(LOG_TAG, "onDisabled"); }
@Override public void onDisabled(Context context) { Toast.makeText(context, "所有的Widget被删除", Toast.LENGTH_SHORT).show(); super.onDisabled(context); }
@Override public void onDisabled(Context context) { super.onDisabled(context); // 最后一个widget删除时执行 context.stopService(new Intent(context, TimerService.class)); }
@Override public void onDisabled(Context context) { super.onDisabled(context); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); alarmManager.cancel(createClockTickIntent(context)); }
@Override public void onDisabled(Context context) { super.onDisabled(context); context.stopService(new Intent(WeatherConstant.ACTION_START_WEATHER_SERVICE)); }