diff options
author | 2025-04-24 03:35:23 +0000 | |
---|---|---|
committer | 2025-09-18 09:01:25 +0200 | |
commit | e630cfeb0e90a128cea6727384a96b960d74ec26 (patch) | |
tree | 6b483274717c20719bee85ea8f78c47fc7c5c222 | |
parent | 0dbca12e772113be98152550ebcd20a3c456f384 (diff) |
[SP 2025-09-01] Fix starting the activity with incorrect pid/uid
Starts the activity in the same thread vs. in the frame callback.
Bug: 406763872
Test: am start-in-vsync
Flag: EXEMPT bugfix
Change-Id: Ida3648fb8a4c7e4801b024622f7e5f1110184a0d
(cherry picked from commit fca9c788b3364017b021544ec9594b43c93c9d29)
Change-Id: Ifb5e130a1e73e076233b6d78e2ab7bc118dce35b
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerShellCommand.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index 5c2bd0a0e90f..5e998bbfc1f5 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -250,21 +250,13 @@ final class ActivityManagerShellCommand extends ShellCommand { return runStartActivity(pw); case "start-in-vsync": final ProgressWaiter waiter = new ProgressWaiter(0); - final int[] startResult = new int[1]; - startResult[0] = -1; mInternal.mUiHandler.runWithScissors( () -> Choreographer.getInstance().postFrameCallback(frameTimeNanos -> { - try { - startResult[0] = runStartActivity(pw); - waiter.onFinished(0, null /* extras */); - } catch (Exception ex) { - getErrPrintWriter().println( - "Error: unable to start activity, " + ex); - } + waiter.onFinished(0, null /* extras */); }), USER_OPERATION_TIMEOUT_MS / 2); waiter.waitForFinish(USER_OPERATION_TIMEOUT_MS); - return startResult[0]; + return runStartActivity(pw); case "startservice": case "start-service": return runStartService(pw, false); |