summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author 张倞诚 <a591951062@gmail.com> 2024-05-11 09:45:59 +0000
committer 张倞诚 <a591951062@gmail.com> 2024-05-16 12:48:18 +0000
commit2f5d3e9f68cb76b68f281683d4074ba51c6b6a85 (patch)
tree67bf3ceee245417fd97fa18508dc3c77e3e4c712
parent9f83523d60a6db42321c7ad17ffafae2d12d3141 (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.java2
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;