Skip to content

Commit

Permalink
[fix] notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderPaddyS committed Jan 9, 2025
1 parent d42a98c commit ceedbad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />


<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:name=".PFCircuitTrainingApplication"
Expand Down Expand Up @@ -129,10 +129,11 @@
android:exported="true" />

<receiver
android:name="org.secuso.privacyfriendlycircuittraining.receivers.OnBootCompletedBroadcastReceiver"
android:name="org.secuso.privacyfriendlycircuittraining.receivers.NotificationEventsReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.app.action.SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED" />
</intent-filter>
</receiver>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.secuso.privacyfriendlycircuittraining.receivers;

import android.app.AlarmManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
Expand All @@ -28,9 +29,12 @@
* @author Alexander Karakuz
* @version 20170812
*/
public class OnBootCompletedBroadcastReceiver extends BroadcastReceiver {
public class NotificationEventsReceiver extends BroadcastReceiver {

private static final String TAG = "NotificationEventsReceiver";
@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) && AlarmManager.ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED.equals(intent.getAction())) return;
if(isMotivationAlertEnabled(context)){
setMotivationAlert(context);
}
Expand Down

0 comments on commit ceedbad

Please sign in to comment.