Run abandon() in the system server context

abandon() will call into StagingManager which might
trigger external callbacks. The code should not
run in the context of the calling uid.

Bug: 267383992
Test: CtsStagedInstallHostTestCases
Change-Id: Ib8a1b6bd48388e1dc2362b8f7cbe4c0d41ee3ebc
This commit is contained in:
JW Wang
2023-02-02 19:05:39 +08:00
parent a1ea042d03
commit c9c0026c7b

View File

@@ -3995,7 +3995,14 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
return;
}
}
r.run();
final long token = Binder.clearCallingIdentity();
try {
// This will call into StagingManager which might trigger external callbacks
r.run();
} finally {
Binder.restoreCallingIdentity(token);
}
}
@Override