Loading play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/AdvertiserService.kt +2 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ package org.microg.gms.nearby.exposurenotification import android.annotation.TargetApi import android.app.AlarmManager import android.app.PendingIntent import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_ONE_SHOT import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.bluetooth.BluetoothAdapter.* Loading Loading @@ -196,7 +197,7 @@ class AdvertiserService : LifecycleService() { private fun scheduleRestartAdvertising(nextSend: Long) { val intent = Intent(this, AdvertiserService::class.java).apply { action = ACTION_RESTART_ADVERTISING } val pendingIntent = PendingIntent.getService(this, ACTION_RESTART_ADVERTISING.hashCode(), intent, FLAG_ONE_SHOT and FLAG_UPDATE_CURRENT) val pendingIntent = PendingIntent.getService(this, ACTION_RESTART_ADVERTISING.hashCode(), intent, FLAG_ONE_SHOT or FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE) when { Build.VERSION.SDK_INT >= 23 -> alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + nextSend, pendingIntent) Loading play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/CleanupService.kt +4 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ package org.microg.gms.nearby.exposurenotification import android.app.AlarmManager import android.app.PendingIntent import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_ONE_SHOT import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.content.Context import android.content.Intent import android.util.Log Loading Loading @@ -47,7 +50,7 @@ class CleanupService : LifecycleService() { fun stop() { val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager val pendingIntent = PendingIntent.getService(applicationContext, CleanupService::class.java.name.hashCode(), Intent(applicationContext, CleanupService::class.java), PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_UPDATE_CURRENT) val pendingIntent = PendingIntent.getService(applicationContext, CleanupService::class.java.name.hashCode(), Intent(applicationContext, CleanupService::class.java), FLAG_ONE_SHOT or FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE) alarmManager.set(AlarmManager.RTC, ExposurePreferences(this).lastCleanup + CLEANUP_INTERVAL, pendingIntent) stopSelf() } Loading play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ class ExposureNotificationServiceImpl(private val context: Context, private val Log.w(TAG, e) } Log.d(TAG, "Pending: $intent") val pi = PendingIntent.getActivity(context, permission.hashCode(), intent, PendingIntent.FLAG_ONE_SHOT) val pi = PendingIntent.getActivity(context, permission.hashCode(), intent, PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE) Log.d(TAG, "Pending: $pi") return pi } Loading play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/NotifyService.kt +3 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ package org.microg.gms.nearby.exposurenotification import android.annotation.TargetApi import android.app.* import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.bluetooth.BluetoothAdapter import android.content.BroadcastReceiver import android.content.Context Loading Loading @@ -96,7 +98,7 @@ class NotifyService : LifecycleService() { try { val intent = Intent(Constants.ACTION_EXPOSURE_NOTIFICATION_SETTINGS).apply { `package` = packageName } intent.resolveActivity(packageManager) setContentIntent(PendingIntent.getActivity(this@NotifyService, notificationId, Intent(Constants.ACTION_EXPOSURE_NOTIFICATION_SETTINGS).apply { `package` = packageName }, PendingIntent.FLAG_UPDATE_CURRENT)) setContentIntent(PendingIntent.getActivity(this@NotifyService, notificationId, Intent(Constants.ACTION_EXPOSURE_NOTIFICATION_SETTINGS).apply { `package` = packageName }, FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE)) } catch (e: Exception) { // Ignore } Loading play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ScannerService.kt +4 −1 Original line number Diff line number Diff line Loading @@ -9,6 +9,9 @@ import android.annotation.SuppressLint import android.annotation.TargetApi import android.app.AlarmManager import android.app.PendingIntent import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_ONE_SHOT import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.bluetooth.BluetoothAdapter.* import android.bluetooth.le.* import android.content.BroadcastReceiver Loading Loading @@ -153,7 +156,7 @@ class ScannerService : LifecycleService() { private fun scheduleStartScan(nextScan: Long) { val intent = Intent(this, ScannerService::class.java) val pendingIntent = PendingIntent.getService(this, ScannerService::class.java.hashCode(), intent, PendingIntent.FLAG_ONE_SHOT and PendingIntent.FLAG_UPDATE_CURRENT) val pendingIntent = PendingIntent.getService(this, ScannerService::class.java.hashCode(), intent, FLAG_ONE_SHOT or FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE) if (Build.VERSION.SDK_INT >= 23) { // Note: there is no setWindowAndAllowWhileIdle() alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + nextScan, pendingIntent) Loading Loading
play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/AdvertiserService.kt +2 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ package org.microg.gms.nearby.exposurenotification import android.annotation.TargetApi import android.app.AlarmManager import android.app.PendingIntent import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_ONE_SHOT import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.bluetooth.BluetoothAdapter.* Loading Loading @@ -196,7 +197,7 @@ class AdvertiserService : LifecycleService() { private fun scheduleRestartAdvertising(nextSend: Long) { val intent = Intent(this, AdvertiserService::class.java).apply { action = ACTION_RESTART_ADVERTISING } val pendingIntent = PendingIntent.getService(this, ACTION_RESTART_ADVERTISING.hashCode(), intent, FLAG_ONE_SHOT and FLAG_UPDATE_CURRENT) val pendingIntent = PendingIntent.getService(this, ACTION_RESTART_ADVERTISING.hashCode(), intent, FLAG_ONE_SHOT or FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE) when { Build.VERSION.SDK_INT >= 23 -> alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + nextSend, pendingIntent) Loading
play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/CleanupService.kt +4 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ package org.microg.gms.nearby.exposurenotification import android.app.AlarmManager import android.app.PendingIntent import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_ONE_SHOT import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.content.Context import android.content.Intent import android.util.Log Loading Loading @@ -47,7 +50,7 @@ class CleanupService : LifecycleService() { fun stop() { val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager val pendingIntent = PendingIntent.getService(applicationContext, CleanupService::class.java.name.hashCode(), Intent(applicationContext, CleanupService::class.java), PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_UPDATE_CURRENT) val pendingIntent = PendingIntent.getService(applicationContext, CleanupService::class.java.name.hashCode(), Intent(applicationContext, CleanupService::class.java), FLAG_ONE_SHOT or FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE) alarmManager.set(AlarmManager.RTC, ExposurePreferences(this).lastCleanup + CLEANUP_INTERVAL, pendingIntent) stopSelf() } Loading
play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ class ExposureNotificationServiceImpl(private val context: Context, private val Log.w(TAG, e) } Log.d(TAG, "Pending: $intent") val pi = PendingIntent.getActivity(context, permission.hashCode(), intent, PendingIntent.FLAG_ONE_SHOT) val pi = PendingIntent.getActivity(context, permission.hashCode(), intent, PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE) Log.d(TAG, "Pending: $pi") return pi } Loading
play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/NotifyService.kt +3 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ package org.microg.gms.nearby.exposurenotification import android.annotation.TargetApi import android.app.* import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.bluetooth.BluetoothAdapter import android.content.BroadcastReceiver import android.content.Context Loading Loading @@ -96,7 +98,7 @@ class NotifyService : LifecycleService() { try { val intent = Intent(Constants.ACTION_EXPOSURE_NOTIFICATION_SETTINGS).apply { `package` = packageName } intent.resolveActivity(packageManager) setContentIntent(PendingIntent.getActivity(this@NotifyService, notificationId, Intent(Constants.ACTION_EXPOSURE_NOTIFICATION_SETTINGS).apply { `package` = packageName }, PendingIntent.FLAG_UPDATE_CURRENT)) setContentIntent(PendingIntent.getActivity(this@NotifyService, notificationId, Intent(Constants.ACTION_EXPOSURE_NOTIFICATION_SETTINGS).apply { `package` = packageName }, FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE)) } catch (e: Exception) { // Ignore } Loading
play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ScannerService.kt +4 −1 Original line number Diff line number Diff line Loading @@ -9,6 +9,9 @@ import android.annotation.SuppressLint import android.annotation.TargetApi import android.app.AlarmManager import android.app.PendingIntent import android.app.PendingIntent.FLAG_IMMUTABLE import android.app.PendingIntent.FLAG_ONE_SHOT import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.bluetooth.BluetoothAdapter.* import android.bluetooth.le.* import android.content.BroadcastReceiver Loading Loading @@ -153,7 +156,7 @@ class ScannerService : LifecycleService() { private fun scheduleStartScan(nextScan: Long) { val intent = Intent(this, ScannerService::class.java) val pendingIntent = PendingIntent.getService(this, ScannerService::class.java.hashCode(), intent, PendingIntent.FLAG_ONE_SHOT and PendingIntent.FLAG_UPDATE_CURRENT) val pendingIntent = PendingIntent.getService(this, ScannerService::class.java.hashCode(), intent, FLAG_ONE_SHOT or FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE) if (Build.VERSION.SDK_INT >= 23) { // Note: there is no setWindowAndAllowWhileIdle() alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + nextScan, pendingIntent) Loading