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

Commit e5e6a2d2 authored by JW Wang's avatar JW Wang
Browse files

Protect isInstallerDeviceOwnerOrAffiliatedProfileOwnerLocked (11/n)

Also add annotations to FooLocked methods.

Bug: 159663586
Test: atest StagedInstallTest AtomicInstallTest
Change-Id: If5089b8c688925729e7ea83c8fe17cb72e49689f
parent 2f5eea17
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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)) {