Skip to content

Commit

Permalink
Merge pull request #23 from chenxiaolong/grapheneos
Browse files Browse the repository at this point in the history
Switch to special use foreground service type
  • Loading branch information
chenxiaolong authored Oct 16, 2023
2 parents 2854c95 + a875dda commit 6fb15a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ This creates a Magisk/KernelSU module that overrides `otacerts.zip`. After flash
* Needed to store temporary OTA files.
* `ACCESS_NETWORK_STATE` (**automatically granted at install time**)
* Needed on Android 14+ for unmetered network background run condition.
* `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_SYSTEM_EXEMPTED` (**automatically granted at install time**)
* `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_SPECIAL_USE` (**automatically granted at install time**)
* Needed to run the OTA update service in the background.
* `INTERNET` (**automatically granted at install time**)
* Needed to communicate with the OTA server. Custota **does not and will never** communicate with any server outside of the configured OTA server. There are no ads, analytics, or any sort of tracking.
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
android:minSdkVersion="34" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED"
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
android:minSdkVersion="34" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE"
Expand Down Expand Up @@ -44,7 +44,7 @@

<service
android:name=".updater.UpdaterService"
android:foregroundServiceType="systemExempted"
android:foregroundServiceType="specialUse"
android:exported="false" />

<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class UpdaterService : Service(), UpdaterThread.UpdaterThreadListener {
)

val type = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
} else {
0
}
Expand Down

0 comments on commit 6fb15a3

Please sign in to comment.