Prevent system server crash while start activity failed.

NPE at PendingActivityLaunch#sendErrorResult, callerApp can be null.

Bug: 135648362
Test: atest ActivityStarterTests
Change-Id: I7949dc1effcc171834f6bc3ff0333f9090b58480
Merged-In: I7949dc1effcc171834f6bc3ff0333f9090b58480
(cherry picked from commit 0c0fb22eab)
This commit is contained in:
wilsonshih
2019-06-21 16:15:08 +08:00
committed by Wei Sheng Shih
parent bce828f157
commit 380626cf54

View File

@@ -415,7 +415,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
void sendErrorResult(String message) {
try {
if (callerApp.hasThread()) {
if (callerApp != null && callerApp.hasThread()) {
callerApp.getThread().scheduleCrash(message);
}
} catch (RemoteException e) {