Update mPermissionUpgradeNeeded in updateRuntimePermissionsFingerprint
PermissionPolicyService. grantOrUpgradeDefaultRuntimePermissionsIfNeeded(userId) method's IfNeeded part was not working and the code inside "if" could not be skipped due to PackageManagerService.isPermissionUpgradeNeeded(userId) returning true even for consecutive calls. The reason for that is Settings.updateRuntimePermissionsFingerprint(userId) method was not updating mPermissionUpgradeNeeded. This was causing consecutive user switches to do an unnecessary ~250ms work. Which should only be done for the first time the user is started. This CL fixed that issue by updating mPermissionUpgradeNeeded in Settings.updateRuntimePermissionsFingerprint(userId) method. Bug: 246988821 Test: Manual performance measurement via Perfetto Change-Id: I2edde089e497d9ffd18b498da88e26b3638ca2ba
This commit is contained in:
@@ -5503,6 +5503,7 @@ public final class Settings implements Watchable, Snappable {
|
||||
+ "set before trying to update the fingerprint.");
|
||||
}
|
||||
mFingerprints.put(userId, mExtendedFingerprint);
|
||||
mPermissionUpgradeNeeded.put(userId, false);
|
||||
writeStateForUserAsync(userId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user