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

Commit cb8031e1 authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Restore correct app State when combing "-D" and "--suspend" flags

Starting an app in debug (-D), suspended (--suspend) mode will
result in the app unable to restore its initial state.

ActivityManagerService.setDebugApp has side effects. It saves a
state that is only restore later during the app booting. Calling
it twice in a row, "double saves" which resulting forgetting the
initial state.

Test: Manual
Bug: 266233210

Change-Id: I7819a3c0f7e46994548c584c4c5d61f6d24faf61
parent 17a7bc4a
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -17842,11 +17842,9 @@ public class ActivityManagerService extends IActivityManager.Stub
                 */
                synchronized (wmLock) {
                    if ((startFlags & ActivityManager.START_FLAG_DEBUG) != 0) {
                        setDebugApp(aInfo.processName, true, false);
                    }
                    if ((startFlags & ActivityManager.START_FLAG_DEBUG_SUSPEND) != 0) {
                        setDebugApp(aInfo.processName, true, false, true);
                        boolean suspend =
                                (startFlags & ActivityManager.START_FLAG_DEBUG_SUSPEND) != 0;
                        setDebugApp(aInfo.processName, true, false, suspend);
                    }
                    if ((startFlags & ActivityManager.START_FLAG_NATIVE_DEBUGGING) != 0) {