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

Commit 079eb1bc authored by Hai Zhang's avatar Hai Zhang
Browse files

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

This reverts commit 6a2480d9.

Reason for revert: Surprisingly doing strictly less things resulted in another 1.6s regression.
Fixes: 172495516
Bug: 172297495

Change-Id: Ifa42403342ceecc6d3013b052ad0a345ed0b80ea
parent 6a2480d9
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) {