Fix #removeChildSessionId (3/n)

Can't remove child from a sealed session.

Bug: 162286562
Test: Will be added in next CLs
Change-Id: I5fe20ede028f0e00e739316dab5c6a24b1546718
This commit is contained in:
JW Wang
2020-07-28 12:50:52 +08:00
parent 35da764125
commit 40fc1cde8e

View File

@@ -3141,6 +3141,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
synchronized (mLock) {
assertCallerIsOwnerOrRootLocked();
assertPreparedAndNotSealedLocked("removeChildSessionId");
final int indexOfSession = mChildSessionIds.indexOfKey(sessionId);
if (session != null) {
session.setParentSessionId(SessionInfo.INVALID_ID);