Skip to content
Commit 82278d78 authored by JW Wang's avatar JW Wang
Browse files

Rewrite some methods (3/n)

1. Now #isInstallerDeviceOwnerOrAffiliatedProfileOwner should be called
   outside the lock because it accesses external entities.
2. Now #needToAskForPermissions should be called outside the lock
   for the same reason above.
3. #sendOnUserActionRequired, #sendOnPackageInstalled and
   #sendPendingStreaming are now called outside the lock.
4. Rewrite #installNonStagedLocked so mPm.installStage() is called
   outside the lock.
5. Split #makeSessionActive into 2 parts so permission checks
   can be done outside the lock.

Note the original code is flawed in that
session.makeSessionActiveLocked() [1] is called without session.mLock
held. This is also fixed by this CL.

[1]
https://source.corp.google.com/android/frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java;rcl=d07f2fc343d37100303696fcfeb603232b5087ce;l=1755

Bug: 161199857
Test: atest StagedInstallTest AtomicInstallTest
Change-Id: I1f4a28259f185d8792bac5a9c8a974df53e7d3fb
parent a39f84ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment