Skip to content
This repository was archived by the owner on Aug 24, 2025. It is now read-only.

Commit d884c7e

Browse files
authored
Add FLAG_IMMUTABLE to prevent Error when Activating Reminder. (#60)
1 parent 7b529f4 commit d884c7e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
2323
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
2424
<uses-permission android:name="android.permission.INTERNET" />
25-
25+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
2626
<application
2727
android:allowBackup="true"
2828
android:icon="@drawable/ic_openworkout"

app/src/main/java/com/health/openworkout/core/alarm/AlarmHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private PendingIntent getPendingAlarmIntent(Context context, int dayOfWeek) {
9090
Intent alarmIntent = new Intent(context, ReminderBootReceiver.class);
9191
alarmIntent.putExtra(INTENT_EXTRA_ALARM, true);
9292

93-
return PendingIntent.getBroadcast(context, dayOfWeek, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
93+
return PendingIntent.getBroadcast(context, dayOfWeek, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
9494
}
9595

9696
public void disableAllAlarms(Context context) {
@@ -110,7 +110,7 @@ public void showAlarmNotification(Context context) {
110110
Intent notifyIntent = new Intent(context, MainActivity.class);
111111

112112
PendingIntent notifyPendingIntent =
113-
PendingIntent.getActivity(context, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
113+
PendingIntent.getActivity(context, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
114114

115115
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, "openWorkout_notify");
116116

0 commit comments

Comments
 (0)