Move the callbacks in app died/crash handling out of WM global lock
These callbacks would require the AM proc lock internally, result in dead lock. Bug: 186067587 Test: adb shell am monitor & crash app manually Test: atest ActivityStarterTests Test: presubmit Change-Id: Ia1b95d7c4fca25cb6f21abf0c295aa51258b1e0c
This commit is contained in:
@@ -5598,10 +5598,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
mTaskSupervisor.endDeferResume();
|
||||
}
|
||||
|
||||
if (wpc.isInstrumenting()) {
|
||||
finishInstrumentationCallback.run();
|
||||
}
|
||||
|
||||
if (!restarting && hasVisibleActivities) {
|
||||
deferWindowLayout();
|
||||
try {
|
||||
@@ -5618,6 +5614,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wpc.isInstrumenting()) {
|
||||
finishInstrumentationCallback.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -6117,6 +6116,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
public boolean handleAppCrashInActivityController(String processName, int pid,
|
||||
String shortMsg, String longMsg, long timeMillis, String stackTrace,
|
||||
Runnable killCrashingAppCallback) {
|
||||
Runnable targetRunnable = null;
|
||||
synchronized (mGlobalLock) {
|
||||
if (mController == null) {
|
||||
return false;
|
||||
@@ -6125,15 +6125,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
try {
|
||||
if (!mController.appCrashed(processName, pid, shortMsg, longMsg, timeMillis,
|
||||
stackTrace)) {
|
||||
killCrashingAppCallback.run();
|
||||
return true;
|
||||
targetRunnable = killCrashingAppCallback;
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
mController = null;
|
||||
Watchdog.getInstance().setActivityController(null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (targetRunnable != null) {
|
||||
targetRunnable.run();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user