Protect isInstallerDeviceOwnerOrAffiliatedProfileOwnerLocked (11/n)

Also add annotations to FooLocked methods.

Bug: 159663586
Test: atest StagedInstallTest AtomicInstallTest
Change-Id: If5089b8c688925729e7ea83c8fe17cb72e49689f
This commit is contained in:
JW Wang
2020-07-07 17:30:13 +08:00
parent 2f5eea17c7
commit e5e6a2d2e6

View File

@@ -459,8 +459,12 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
final int returnCode = args.argi1;
args.recycle();
final boolean showNotification;
synchronized (mLock) {
showNotification = isInstallerDeviceOwnerOrAffiliatedProfileOwnerLocked();
}
sendOnPackageInstalled(mContext, statusReceiver, sessionId,
isInstallerDeviceOwnerOrAffiliatedProfileOwnerLocked(), userId,
showNotification, userId,
packageName, returnCode, message, extras);
break;
@@ -888,6 +892,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
return markerName;
}
@GuardedBy("mLock")
private void createRemoveSplitMarkerLocked(String splitName) throws IOException {
try {
final File target = new File(stageDir, getRemoveMarkerName(splitName));
@@ -1058,6 +1063,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
}
@GuardedBy("mLock")
private ParcelFileDescriptor openReadInternalLocked(String name) throws IOException {
try {
if (!FileUtils.isValidExtFilename(name)) {