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

Commit 4b63b1db authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Don't run auto-revoke on Automotive" into rvc-qpr-dev

parents f3ab77d4 b3534d6f
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