DeskClock: Make clock exempt from foreground service restrictions
* This fixes the app crashing if you're sitting inside of the
notification screen and waiting for the notification to pop
up when the alarm goes off.
Change-Id: I307b10b6de3b63355fb99a95faa1f563398efacb
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 047f1a6..5cebe3e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -30,6 +30,7 @@
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
@@ -190,7 +191,8 @@
<service
android:name=".alarms.AlarmService"
- android:directBootAware="true" />
+ android:directBootAware="true"
+ android:foregroundServiceType="systemExempted" />
<!-- ============================================================== -->
<!-- Timer components. -->
@@ -218,7 +220,8 @@
<service
android:name=".timer.TimerService"
android:description="@string/timer_service_desc"
- android:directBootAware="true" />
+ android:directBootAware="true"
+ android:foregroundServiceType="systemExempted" />
<!-- ============================================================== -->
<!-- Stopwatch components. -->
@@ -227,7 +230,8 @@
<service
android:name=".stopwatch.StopwatchService"
android:description="@string/stopwatch_service_desc"
- android:directBootAware="true" />
+ android:directBootAware="true"
+ android:foregroundServiceType="systemExempted" />
<!-- ============================================================== -->