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

Commit 2ddce8af authored by JW Wang's avatar JW Wang
Browse files

Protect accesses to mStagedSessionXXX (9/n)

Bug: 159663586
Test: atest StagedInstallTest AtomicInstallTest
Change-Id: I6c91d7f5b39ed3aa1627f82ba1d4317a24c2debd
parent 631f6a1b
Loading
Loading
Loading
Loading
+15 −5
Original line number Original line Diff line number Diff line
@@ -3129,28 +3129,38 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {


    /** {@hide} */
    /** {@hide} */
    boolean isStagedSessionReady() {
    boolean isStagedSessionReady() {
        synchronized (mLock) {
            return mStagedSessionReady;
            return mStagedSessionReady;
        }
        }
    }


    /** {@hide} */
    /** {@hide} */
    boolean isStagedSessionApplied() {
    boolean isStagedSessionApplied() {
        synchronized (mLock) {
            return mStagedSessionApplied;
            return mStagedSessionApplied;
        }
        }
    }


    /** {@hide} */
    /** {@hide} */
    boolean isStagedSessionFailed() {
    boolean isStagedSessionFailed() {
        synchronized (mLock) {
            return mStagedSessionFailed;
            return mStagedSessionFailed;
        }
        }
    }


    /** {@hide} */
    /** {@hide} */
    @StagedSessionErrorCode int getStagedSessionErrorCode() {
    @StagedSessionErrorCode int getStagedSessionErrorCode() {
        synchronized (mLock) {
            return mStagedSessionErrorCode;
            return mStagedSessionErrorCode;
        }
        }
    }


    /** {@hide} */
    /** {@hide} */
    String getStagedSessionErrorMessage() {
    String getStagedSessionErrorMessage() {
        synchronized (mLock) {
            return mStagedSessionErrorMessage;
            return mStagedSessionErrorMessage;
        }
        }
    }


    private void destroyInternal() {
    private void destroyInternal() {
        synchronized (mLock) {
        synchronized (mLock) {