Updater: Define foregroundServiceType

Required since Android 14 [1].

11-16 14:05:45.363 20623 20623 E AndroidRuntime: FATAL EXCEPTION: main
11-16 14:05:45.363 20623 20623 E AndroidRuntime: Process: org.lineageos.updater, PID: 20623
11-16 14:05:45.363 20623 20623 E AndroidRuntime: android.app.MissingForegroundServiceTypeException: Starting FGS without a type  callerApp=ProcessRecord{6d14558 20623:org.lineageos.updater/u0a149} targetSDK=34

[1] https://developer.android.com/about/versions/14/changes/fgs-types-required

Change-Id: Id6217424177b94d37621062fb1a55778f1dabbab
This commit is contained in:
Bartłomiej Rudecki
2023-11-16 11:46:59 +01:00
parent 0b1821c9dc
commit 7d9b6c0c64
3 changed files with 21 additions and 5 deletions
+13 -2
View File
@@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.REBOOT" />
@@ -43,8 +44,18 @@
</intent-filter>
</activity>
<service android:name=".controller.UpdaterService" />
<service android:name=".ExportUpdateService" />
<service
android:name=".controller.UpdaterService"
android:foregroundServiceType="specialUse">
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="updater"/>
</service>
<service
android:name=".ExportUpdateService"
android:foregroundServiceType="specialUse">
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="updater"/>
</service>
<receiver android:name=".UpdaterReceiver" android:exported="false">
<intent-filter>