Skip to content

Commit

Permalink
Merge pull request #128 from SecUSo/development
Browse files Browse the repository at this point in the history
[fix] changes foreground service type to special use.
  • Loading branch information
coderPaddyS authored Jan 7, 2025
2 parents 1452d0c + 17b9c2c commit 5a14216
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "org.secuso.privacyfriendlysudoku"
minSdkVersion 17
targetSdkVersion 34
versionCode 15
versionName "3.2"
versionCode 16
versionName "3.2.1"
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
}
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
Expand Down Expand Up @@ -77,8 +78,13 @@
android:name="org.secuso.privacyfriendlysudoku.controller.GeneratorService"
android:enabled="true"
android:permission="android.permission.BIND_JOB_SERVICE"
android:foregroundServiceType="shortService"
android:exported="false" />
android:foregroundServiceType="specialUse"
android:exported="false">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This service generates sudoku levels in the background. The generation is done randomly and may end up taking a long time to generate the wished difficulty."
/>
</service>

<service
android:name="org.secuso.privacyfriendlysudoku.backup.PFABackupService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private void showNotification(GameType gameType, GameDifficulty gameDifficulty)
builder.setWhen(0);
builder.setSmallIcon(R.drawable.splash_icon);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ServiceCompat.startForeground(this, 50, builder.build(), ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE);
ServiceCompat.startForeground(this, 50, builder.build(), ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE);
} else {
startForeground(50, builder.build());
}
Expand Down

0 comments on commit 5a14216

Please sign in to comment.