diff options
author | 2024-05-11 09:45:59 +0000 | |
---|---|---|
committer | 2024-05-16 12:48:18 +0000 | |
commit | 2f5d3e9f68cb76b68f281683d4074ba51c6b6a85 (patch) | |
tree | 67bf3ceee245417fd97fa18508dc3c77e3e4c712 | |
parent | 9f83523d60a6db42321c7ad17ffafae2d12d3141 (diff) |
Fixed device restart caused by starting Activity under split-screen root task.
The root task used for split screen contains two or more sub-tasks. In this case, the activity should not be allowed to be started under the root task, which will cause a null pointer and cause the device to restart. Therefore, when the activity is started by specifying the taskid, check that the task is leaftask.
Change-Id: I095feb549ce2d3a4e61d999a342f64bea8264288
-rw-r--r-- | services/core/java/com/android/server/wm/ActivityStarter.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index 4b0177a36ebe..f249cb099f67 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -2643,7 +2643,7 @@ class ActivityStarter { // If a target task is specified, try to reuse that one if (mOptions != null && mOptions.getLaunchTaskId() != INVALID_TASK_ID) { Task launchTask = mRootWindowContainer.anyTaskForId(mOptions.getLaunchTaskId()); - if (launchTask != null) { + if (launchTask != null && launchTask.isLeafTask()) { return launchTask; } return null; |