Allow apps to pass in launch bounds when moving/starting a task
Pass in bounds via ActivityOptions for moveTaskToFront and
startActivityFromRecents. Allow bounds to be overriden by rects
in starting intents.
Set bounds to null in RecentsView for full screen layout.
Change-Id: I0ff79fd75068f4ba82d5e2c0a21881fabebdadb8
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index d2a6c02..a2467ef 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -4547,10 +4547,11 @@
boolean toTop) {
TaskRecord task = new TaskRecord(mService, taskId, info, intent, voiceSession,
voiceInteractor);
+ // add the task to stack first, mTaskPositioner might need the stack association
+ addTask(task, toTop, false);
if (mTaskPositioner != null) {
mTaskPositioner.updateDefaultBounds(task, mTaskHistory, info.initialLayout);
}
- addTask(task, toTop, false);
return task;
}
@@ -4587,19 +4588,20 @@
void addConfigOverride(ActivityRecord r, TaskRecord task) {
final Rect bounds = task.getLaunchBounds();
- final Configuration config = task.updateOverrideConfiguration(bounds);
+ task.updateOverrideConfiguration(bounds);
mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken,
r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_FOR_ALL_USERS) != 0, r.userId,
r.info.configChanges, task.voiceSession != null, r.mLaunchTaskBehind,
- bounds, config);
+ bounds, task.mOverrideConfig);
r.taskConfigOverride = task.mOverrideConfig;
}
private void setAppTask(ActivityRecord r, TaskRecord task) {
final Rect bounds = task.getLaunchBounds();
- final Configuration config = task.updateOverrideConfiguration(bounds);
- mWindowManager.setAppTask(r.appToken, task.taskId, task.getLaunchBounds(), config);
+ task.updateOverrideConfiguration(bounds);
+ mWindowManager.setAppTask(
+ r.appToken, task.taskId, task.getLaunchBounds(), task.mOverrideConfig);
r.taskConfigOverride = task.mOverrideConfig;
}