Revert "Refresh legacy state before writing to runtime permission persistence."

This reverts commit fea3a1709f.

Reason for revert: Performance regression
Fixes: 172297495
Test: presubmit

Change-Id: I286015aafedfb0807392f8b31476b083c82bc086
This commit is contained in:
Hai Zhang
2020-11-07 01:07:46 +00:00
parent 794771116c
commit bbecd0e7e6

View File

@@ -19606,7 +19606,7 @@ public class PackageManagerService extends IPackageManager.Stub
ps.setUninstallReason(UNINSTALL_REASON_UNKNOWN, userId);
}
writeRuntimePermissionsForUserLPrTEMP(userId, false);
mSettings.writeRuntimePermissionsForUserLPr(userId, false);
}
// Regardless of writeSettings we need to ensure that this restriction
// state propagation is persisted
@@ -25752,7 +25752,7 @@ public class PackageManagerService extends IPackageManager.Stub
public void writePermissionSettings(int[] userIds, boolean async) {
synchronized (mLock) {
for (int userId : userIds) {
writeRuntimePermissionsForUserLPrTEMP(userId, !async);
mSettings.writeRuntimePermissionsForUserLPr(userId, !async);
}
}
}
@@ -26401,17 +26401,6 @@ 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) {