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

Commit 79392d17 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix formating in AppIdPermissionPolicy" into main

parents 2ca82f42 185f7baf
Loading
Loading
Loading
Loading
+8 −11
Original line number Original line Diff line number Diff line
@@ -63,11 +63,8 @@ class AppIdPermissionPolicy : SchemePolicy() {


    private val privilegedPermissionAllowlistViolations = MutableIndexedSet<String>()
    private val privilegedPermissionAllowlistViolations = MutableIndexedSet<String>()


    /**
    /** Test-only switch to enforce signature permission allowlist even on debuggable builds. */
     * Test-only switch to enforce signature permission allowlist even on debuggable builds.
    @Volatile var isSignaturePermissionAllowlistForceEnforced = false
     */
    @Volatile
    var isSignaturePermissionAllowlistForceEnforced = false


    override val subjectScheme: String
    override val subjectScheme: String
        get() = UidUri.SCHEME
        get() = UidUri.SCHEME
@@ -108,8 +105,8 @@ class AppIdPermissionPolicy : SchemePolicy() {
        val changedPermissionNames = MutableIndexedSet<String>()
        val changedPermissionNames = MutableIndexedSet<String>()
        packageNames.forEachIndexed { _, packageName ->
        packageNames.forEachIndexed { _, packageName ->
            // The package may still be removed even if it was once notified as installed.
            // The package may still be removed even if it was once notified as installed.
            val packageState = newState.externalState.packageStates[packageName]
            val packageState =
                ?: return@forEachIndexed
                newState.externalState.packageStates[packageName] ?: return@forEachIndexed
            adoptPermissions(packageState, changedPermissionNames)
            adoptPermissions(packageState, changedPermissionNames)
            addPermissionGroups(packageState)
            addPermissionGroups(packageState)
            addPermissions(packageState, changedPermissionNames)
            addPermissions(packageState, changedPermissionNames)
@@ -122,14 +119,14 @@ class AppIdPermissionPolicy : SchemePolicy() {
        }
        }


        packageNames.forEachIndexed { _, packageName ->
        packageNames.forEachIndexed { _, packageName ->
            val packageState = newState.externalState.packageStates[packageName]
            val packageState =
                ?: return@forEachIndexed
                newState.externalState.packageStates[packageName] ?: return@forEachIndexed
            val installedPackageState = if (isSystemUpdated) packageState else null
            val installedPackageState = if (isSystemUpdated) packageState else null
            evaluateAllPermissionStatesForPackage(packageState, installedPackageState)
            evaluateAllPermissionStatesForPackage(packageState, installedPackageState)
        }
        }
        packageNames.forEachIndexed { _, packageName ->
        packageNames.forEachIndexed { _, packageName ->
            val packageState = newState.externalState.packageStates[packageName]
            val packageState =
                ?: return@forEachIndexed
                newState.externalState.packageStates[packageName] ?: return@forEachIndexed
            newState.externalState.userIds.forEachIndexed { _, userId ->
            newState.externalState.userIds.forEachIndexed { _, userId ->
                inheritImplicitPermissionStates(packageState.appId, userId)
                inheritImplicitPermissionStates(packageState.appId, userId)
            }
            }