Disable foreground service on API 34+

This commit is contained in:
topjohnwu 2024-02-06 17:29:42 -08:00
parent 472c7878b2
commit 4bf1c74164
4 changed files with 10 additions and 2 deletions

View File

@ -4,13 +4,14 @@
<uses-permission android:name="android.permission.INTERNET" />
<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_DATA_SYNC" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" />
<uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RUN_USER_INITIATED_JOBS" />
<uses-permission
android:name="android.permission.FOREGROUND_SERVICE"
android:maxSdkVersion="33" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />

View File

@ -63,6 +63,7 @@
<service
android:name=".core.Service"
android:exported="false"
android:enabled="@bool/enable_fg_service"
android:foregroundServiceType="dataSync" />
<service

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="enable_fg_service">false</bool>
</resources>

View File

@ -15,4 +15,6 @@
<drawable name="ic_launcher">@drawable/ic_logo</drawable>
<bool name="enable_fg_service">true</bool>
</resources>