Fix #278
This commit is contained in:
parent
6ea40a51fe
commit
cce86a970c
@ -57,8 +57,6 @@ class UpdatesReceiver : BroadcastReceiver() {
|
||||
}
|
||||
|
||||
Actions.ACTION_REFRESH -> {
|
||||
ActiveNotificationsHelper.clearLastNotification(context)
|
||||
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
CalendarHelper.updateEventList(context)
|
||||
MediaPlayerHelper.updatePlayingMediaInfo(context)
|
||||
|
@ -34,6 +34,7 @@ class LocationService : Service() {
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
startForeground(LOCATION_ACCESS_NOTIFICATION_ID, getLocationAccessNotification())
|
||||
job?.cancel()
|
||||
job = GlobalScope.launch(Dispatchers.IO) {
|
||||
if (ActivityCompat.checkSelfPermission(
|
||||
@ -85,11 +86,7 @@ class LocationService : Service() {
|
||||
|
||||
@JvmStatic
|
||||
fun requestNewLocation(context: Context) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
context.startForegroundService(Intent(context, LocationService::class.java))
|
||||
} else {
|
||||
context.startService(Intent(context, LocationService::class.java))
|
||||
}
|
||||
ContextCompat.startForegroundService(context, Intent(context, LocationService::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,11 +35,7 @@ class UpdateCalendarService : Service() {
|
||||
companion object {
|
||||
const val CALENDAR_SYNC_NOTIFICATION_ID = 28468
|
||||
fun enqueueWork(context: Context) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
context.startForegroundService(Intent(context, UpdateCalendarService::class.java))
|
||||
} else {
|
||||
context.startService(Intent(context, UpdateCalendarService::class.java))
|
||||
}
|
||||
ContextCompat.startForegroundService(context, Intent(context, UpdateCalendarService::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +51,7 @@ class UpdateCalendarService : Service() {
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
startForeground(CALENDAR_SYNC_NOTIFICATION_ID, getCalendarSyncNotification())
|
||||
job?.cancel()
|
||||
job = GlobalScope.launch(Dispatchers.IO) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user