Clean up parent session when all children complete successfully (1/n)

The parent is finished when all children are finished. This change
gives us a consistent states across parent and children.

Bug: 163744647
Test: N/A, will be added in next CL
Change-Id: Id5a21fc8cf91b9e33f762df7858f4fdde0c91bf7
This commit is contained in:
JW Wang
2020-08-12 17:15:27 +08:00
parent 31bb4ab9e0
commit 63cd0b6097

View File

@@ -1328,12 +1328,9 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
if (PackageInstaller.STATUS_SUCCESS == status) {
mChildSessionsRemaining.removeAt(sessionIndex);
if (mChildSessionsRemaining.size() == 0) {
try {
intent.putExtra(PackageInstaller.EXTRA_SESSION_ID,
PackageInstallerSession.this.sessionId);
mStatusReceiver.sendIntent(mContext, 0, intent, null, null);
} catch (IntentSender.SendIntentException ignore) {
}
destroyInternal();
dispatchSessionFinished(PackageManager.INSTALL_SUCCEEDED,
"Session installed", null);
}
} else if (PackageInstaller.STATUS_PENDING_USER_ACTION == status) {
try {