Fix / fdroid notif was broken due to merge

This commit is contained in:
Valere
2019-07-01 13:07:52 +02:00
parent 4739aea793
commit b0ad568df0
4 changed files with 8 additions and 96 deletions

View File

@ -21,7 +21,7 @@
android:exported="false" />
<service
android:name=".fdroid.receiver.service.VectorSyncService"
android:name=".fdroid.service.VectorSyncService"
android:exported="false" />
</application>

View File

@ -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

View File

@ -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)
}
}