Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 214be42e authored by riddle_hsu's avatar riddle_hsu Committed by Craig Mautner
Browse files

[ActivityManager] Prevent coredump file may not complete for testing.

Cherry-pick from aosp to lmp-dev

Sympton:
During testing, skip kill native crash process manually because it
will continue to die by default.

Root Cause:
Large process may take some time to do coredump.In auto test, crash
process will be killed immediately that results incomplete coredump
file.

Solution:
If the tester (IActivityController) will handle app crash event,
Do not kill native crashed process if the rom is debuggable.

Change-Id: Ia360af147d694125d440e5ba2f958c4759a50494

Conflicts:
	services/java/com/android/server/am/ActivityManagerService.java
parent ebbbb2cf
Loading
Loading
Loading
Loading
+11 −5
Original line number Original line Diff line number Diff line
@@ -10966,12 +10966,18 @@ public final class ActivityManagerService extends ActivityManagerNative
                    int uid = r != null ? r.info.uid : Binder.getCallingUid();
                    int uid = r != null ? r.info.uid : Binder.getCallingUid();
                    if (!mController.appCrashed(name, pid,
                    if (!mController.appCrashed(name, pid,
                            shortMsg, longMsg, timeMillis, crashInfo.stackTrace)) {
                            shortMsg, longMsg, timeMillis, crashInfo.stackTrace)) {
                        if ("1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"))
                                && "Native crash".equals(crashInfo.exceptionClassName)) {
                            Slog.w(TAG, "Skip killing native crashed app " + name
                                    + "(" + pid + ") during testing");
                        } else {
                            Slog.w(TAG, "Force-killing crashed app " + name
                            Slog.w(TAG, "Force-killing crashed app " + name
                                    + " at watcher's request");
                                    + " at watcher's request");
                            Process.killProcess(pid);
                            Process.killProcess(pid);
                            if (r != null) {
                            if (r != null) {
                                Process.killProcessGroup(uid, pid);
                                Process.killProcessGroup(uid, pid);
                            }
                            }
                        }
                        return;
                        return;
                    }
                    }
                } catch (RemoteException e) {
                } catch (RemoteException e) {