Skip to content

Commit

Permalink
Crash fixes for android 12
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanth committed Jun 22, 2022
1 parent e30e668 commit 6c46bfd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public void onTaskRemoved(Intent rootIntent) {
Log.d(TAG, "Log service removed");

Intent intent = new Intent(getApplicationContext(), LogService.class);
PendingIntent pendingIntent = PendingIntent.getService(this, 1, intent, PendingIntent.FLAG_ONE_SHOT);
PendingIntent pendingIntent = PendingIntent.getService(this, 1, intent, PendingIntent.FLAG_MUTABLE);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, SystemClock.elapsedRealtime() + 000, pendingIntent);
if(executorService != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager,
RemoteViews remoteViews = new RemoteViews(context.getPackageName(),R.layout.toggle_widget_layout);
Intent configIntent = new Intent(context, ToggleWidgetActivity.class);

PendingIntent configPendingIntent = PendingIntent.getActivity(context,0, configIntent, 0);
PendingIntent configPendingIntent = PendingIntent.getActivity(context,0, configIntent, PendingIntent.FLAG_MUTABLE);
remoteViews.setOnClickPendingIntent(R.id.toggle_widget_icon,configPendingIntent);
appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager,

Intent configIntent = new Intent(context, ToggleWidgetOldActivity.class);

PendingIntent configPendingIntent = PendingIntent.getActivity(context, 0, configIntent, 0);
PendingIntent configPendingIntent = PendingIntent.getActivity(context, 0, configIntent, PendingIntent.FLAG_MUTABLE);

remoteViews.setOnClickPendingIntent(R.id.toggle_widget_icon_old, configPendingIntent);
appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);
Expand Down

0 comments on commit 6c46bfd

Please sign in to comment.