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

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

Protect #handleInstall with mLock (3/n)

Some code inside #handleInstall needs to be locked.

Bug: 159663586
Test: atest StagedInstallTest AtomicInstallTest
Change-Id: I597d46a707cb482f95e8f3d2000820fa6ca5d5c1
parent 9e6b95e5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1687,7 +1687,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
    }

    private void handleInstall() {
        if (isInstallerDeviceOwnerOrAffiliatedProfileOwnerLocked()) {
        final boolean needsLogging;
        synchronized (mLock) {
            needsLogging = isInstallerDeviceOwnerOrAffiliatedProfileOwnerLocked();
        }
        if (needsLogging) {
            DevicePolicyEventLogger
                    .createEvent(DevicePolicyEnums.INSTALL_PACKAGE)
                    .setAdmin(mInstallSource.installerPackageName)