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 Diff line number Diff line
@@ -63,11 +63,8 @@ class AppIdPermissionPolicy : SchemePolicy() {

    private val privilegedPermissionAllowlistViolations = MutableIndexedSet<String>()

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

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

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