Meet some mandatory requirements for migrating to Android 12

1. Replace foreground services with Workers
2. Support approximate location
3. Fallback to inexact alarms if the SCHEDULE_EXACT_ALARM permission is revoked
4. Specify the mutability of each PendingIntent
5. Explicitly declare the android:exported attribute for app components that use intent filters
This commit is contained in:
azuo
2021-10-03 16:34:56 +08:00
parent 5763a18421
commit 388653f62b
21 changed files with 267 additions and 415 deletions

View File

@ -7,7 +7,7 @@ import android.provider.CalendarContract
import com.tommasoberlose.anotherwidget.services.EventListenerJob
import com.tommasoberlose.anotherwidget.models.Event
import com.tommasoberlose.anotherwidget.global.Preferences
import com.tommasoberlose.anotherwidget.services.UpdateCalendarService
import com.tommasoberlose.anotherwidget.services.UpdateCalendarWorker
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
import me.everything.providers.android.calendar.CalendarProvider
import java.util.*
@ -19,7 +19,7 @@ import kotlin.collections.ArrayList
object CalendarHelper {
fun updateEventList(context: Context) {
UpdateCalendarService.enqueueWork(context)
UpdateCalendarWorker.enqueue(context)
}
fun getCalendarList(context: Context): List<me.everything.providers.android.calendar.Calendar> {