forked from GitHub-Mirror/riotX-android
Fix / fdroid notif was broken due to merge
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
android:exported="false" />
|
||||
|
||||
<service
|
||||
android:name=".fdroid.receiver.service.VectorSyncService"
|
||||
android:name=".fdroid.service.VectorSyncService"
|
||||
android:exported="false" />
|
||||
|
||||
</application>
|
||||
|
@ -44,14 +44,12 @@ class AlarmSyncBroadcastReceiver : BroadcastReceiver() {
|
||||
// This method is called when the BroadcastReceiver is receiving an Intent broadcast.
|
||||
Timber.d("RestartBroadcastReceiver received intent")
|
||||
Intent(context, VectorSyncService::class.java).also {
|
||||
it.action = "SLOW"
|
||||
it.putExtra(SyncService.EXTRA_USER_ID, userId)
|
||||
context.startService(it)
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
ContextCompat.startForegroundService(context, intent)
|
||||
ContextCompat.startForegroundService(context, it)
|
||||
} else {
|
||||
context.startService(intent)
|
||||
context.startService(it)
|
||||
}
|
||||
} catch (ex: Throwable) {
|
||||
//TODO
|
||||
|
@ -27,13 +27,7 @@ import timber.log.Timber
|
||||
|
||||
class VectorSyncService : SyncService() {
|
||||
|
||||
override fun onCreate() {
|
||||
Timber.v("VectorSyncService - onCreate")
|
||||
super.onCreate()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
Timber.v("VectorSyncService - onDestroy")
|
||||
removeForegroundNotif()
|
||||
super.onDestroy()
|
||||
}
|
||||
@ -56,17 +50,4 @@ class VectorSyncService : SyncService() {
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
/**
|
||||
* If the service is bounded and the service was previously started we can remove foreground notification
|
||||
*/
|
||||
override fun onBind(intent: Intent?): IBinder {
|
||||
Timber.v("VectorSyncService - onBind ")
|
||||
stopForeground(true)
|
||||
return super.onBind(intent)
|
||||
}
|
||||
|
||||
override fun onUnbind(intent: Intent?): Boolean {
|
||||
Timber.v("VectorSyncService - onUnbind ")
|
||||
return super.onUnbind(intent)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user