Skip to content

Commit

Permalink
Remove data sync foreground service type
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkourlas committed Jan 27, 2024
1 parent f3a61a5 commit 8d719c9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 29 deletions.
5 changes: 1 addition & 4 deletions voipms-sms/src/main/AndroidManifest.xml
Expand Up @@ -42,9 +42,6 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission
android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"
android:maxSdkVersion="33" />

<!-- Vibration when notification received -->
<uses-permission android:name="android.permission.VIBRATE" />
Expand Down Expand Up @@ -267,7 +264,7 @@

<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="shortService|dataSync"
android:foregroundServiceType="shortService"
tools:ignore="Instantiatable"
tools:node="merge" />
</application>
Expand Down
Expand Up @@ -82,11 +82,7 @@ class RetrieveDidsWorker(context: Context, params: WorkerParameters) :
ForegroundInfo(
Notifications.SYNC_RETRIEVE_DIDS_NOTIFICATION_ID,
notification,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
} else {
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
}
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
)
} else {
ForegroundInfo(
Expand Down
Expand Up @@ -131,11 +131,7 @@ class SendMessageWorker(context: Context, params: WorkerParameters) :
ForegroundInfo(
Notifications.SYNC_SEND_MESSAGE_NOTIFICATION_ID,
notification,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
} else {
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
}
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
)
} else {
ForegroundInfo(
Expand Down
Expand Up @@ -124,11 +124,7 @@ class SyncWorker(context: Context, params: WorkerParameters) :
ForegroundInfo(
Notifications.SYNC_DATABASE_NOTIFICATION_ID,
notification,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
} else {
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
}
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
)
} else {
ForegroundInfo(
Expand Down
Expand Up @@ -84,11 +84,7 @@ class VerifyCredentialsWorker(context: Context, params: WorkerParameters) :
ForegroundInfo(
Notifications.SYNC_VERIFY_CREDENTIALS_NOTIFICATION_ID,
notification,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
} else {
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
}
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
)
} else {
ForegroundInfo(
Expand Down
Expand Up @@ -111,11 +111,7 @@ class NotificationsRegistrationWorker(
ForegroundInfo(
Notifications.SYNC_REGISTER_PUSH_NOTIFICATION_ID,
notification,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
} else {
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
}
ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
)
} else {
ForegroundInfo(
Expand Down

0 comments on commit 8d719c9

Please sign in to comment.