@@ -108,15 +108,15 @@ public synchronized Notification prepareNotification(NotificationCompat.Builder
108
108
String packageName = context .getPackageName ();
109
109
Intent openApp = context .getPackageManager ().getLaunchIntentForPackage (packageName );
110
110
try {
111
- builder .setContentIntent (PendingIntent .getActivity (context , 0 , openApp , 0 ));
111
+ builder .setContentIntent (PendingIntent .getActivity (context , 0 , openApp , PendingIntent . FLAG_IMMUTABLE ));
112
112
}catch (Exception e ){
113
113
System .out .println (e .getMessage ());
114
114
}
115
115
116
116
// Remove notification
117
117
Intent remove = new Intent (REMOVE_NOTIFICATION );
118
118
remove .putExtra (PACKAGE_NAME , context .getApplicationInfo ().packageName );
119
- builder .setDeleteIntent (PendingIntent .getBroadcast (context , 0 , remove , PendingIntent .FLAG_UPDATE_CURRENT ));
119
+ builder .setDeleteIntent (PendingIntent .getBroadcast (context , 0 , remove , PendingIntent .FLAG_IMMUTABLE | PendingIntent . FLAG_UPDATE_CURRENT ));
120
120
121
121
return builder .build ();
122
122
}
@@ -176,7 +176,7 @@ private NotificationCompat.Action createAction(String iconName, String title, lo
176
176
Intent intent = new Intent (MEDIA_BUTTON );
177
177
intent .putExtra (Intent .EXTRA_KEY_EVENT , new KeyEvent (KeyEvent .ACTION_DOWN , keyCode ));
178
178
intent .putExtra (PACKAGE_NAME , packageName );
179
- PendingIntent i = PendingIntent .getBroadcast (context , keyCode , intent , PendingIntent .FLAG_UPDATE_CURRENT );
179
+ PendingIntent i = PendingIntent .getBroadcast (context , keyCode , intent , PendingIntent .FLAG_IMMUTABLE | PendingIntent . FLAG_UPDATE_CURRENT );
180
180
181
181
return new NotificationCompat .Action (icon , title , i );
182
182
}
0 commit comments