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

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

Merge "Revert "Fix performance issue from refreshing runtime permission state before write.""

parents 9ad8254a 079eb1bc
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -19605,6 +19605,8 @@ public class PackageManagerService extends IPackageManager.Stub
                    if (installed) {
                        ps.setUninstallReason(UNINSTALL_REASON_UNKNOWN, userId);
                    }
                    writeRuntimePermissionsForUserLPrTEMP(userId, false);
                }
                // Regardless of writeSettings we need to ensure that this restriction
                // state propagation is persisted
@@ -25749,9 +25751,8 @@ public class PackageManagerService extends IPackageManager.Stub
        @Override
        public void writePermissionSettings(int[] userIds, boolean async) {
            synchronized (mLock) {
                mPermissionManager.writeLegacyPermissionStateTEMP();
                for (int userId : userIds) {
                    mSettings.writeRuntimePermissionsForUserLPr(userId, !async);
                    writeRuntimePermissionsForUserLPrTEMP(userId, !async);
                }
            }
        }
@@ -26400,6 +26401,17 @@ public class PackageManagerService extends IPackageManager.Stub
        mSettings.writeLPr();
    }
    /**
     * Temporary method that wraps mSettings.writeRuntimePermissionsForUserLPr() and calls
     * mPermissionManager.writeLegacyPermissionStateTEMP() beforehand.
     *
     * TODO(zhanghai): This should be removed once we finish migration of permission storage.
     */
    private void writeRuntimePermissionsForUserLPrTEMP(@UserIdInt int userId, boolean async) {
        mPermissionManager.writeLegacyPermissionStateTEMP();
        mSettings.writeRuntimePermissionsForUserLPr(userId, async);
    }
    @Override
    public IBinder getHoldLockToken() {
        if (!Build.IS_DEBUGGABLE) {