Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3534d6f authored by Anthony Hugh's avatar Anthony Hugh
Browse files

DO NOT MERGE: Don't run auto-revoke on Automotive

Bug: 155214596
Bug: 174873777
Test: See job isn't scheduled on boot via --
      adb shell dumpsys jobscheduler | grep AutoRevokeService

Change-Id: I2340e97b253724faadf75e7f9b64c78443160eb3
parent b66c7d42
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.content.pm.PackageManager.FLAG_PERMISSION_AUTO_REVOKED
import android.content.pm.PackageManager.FLAG_PERMISSION_USER_SET
import android.content.pm.PackageManager.PERMISSION_GRANTED
@@ -190,6 +191,13 @@ suspend fun dumpAutoRevokePermissions(context: Context): AutoRevokePermissionsDu
class AutoRevokeOnBootReceiver : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent?) {

        // Auto-revoke is not enabled on Automotive devices
        if (context.packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
            DumpableLog.i(LOG_TAG, "Auto-revoke not scheduled on Automotive devices")
            return
        }

        // Init firstBootTime
        val firstBootTime = context.firstBootTime