Loading services/core/java/com/android/server/am/ActivityStack.java +3 −5 Original line number Diff line number Diff line Loading @@ -4753,8 +4753,7 @@ final class ActivityStack { } void addConfigOverride(ActivityRecord r, TaskRecord task) { final Rect bounds = task.getLaunchBounds(); task.updateOverrideConfiguration(bounds); final Rect bounds = task.updateOverrideConfigurationFromLaunchBounds(); mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken, r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen, (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0, r.userId, r.info.configChanges, Loading Loading @@ -4810,10 +4809,9 @@ final class ActivityStack { } private void setAppTask(ActivityRecord r, TaskRecord task) { final Rect bounds = task.getLaunchBounds(); task.updateOverrideConfiguration(bounds); final Rect bounds = task.updateOverrideConfigurationFromLaunchBounds(); mWindowManager.setAppTask( r.appToken, task.taskId, mStackId, task.getLaunchBounds(), task.mOverrideConfig); r.appToken, task.taskId, mStackId, bounds, task.mOverrideConfig); mWindowManager.setTaskResizeable(task.taskId, task.mResizeable); r.taskConfigOverride = task.mOverrideConfig; } Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +5 −3 Original line number Diff line number Diff line Loading @@ -1673,7 +1673,7 @@ public final class ActivityStackSupervisor implements DisplayListener { if (task.mResizeable && options != null) { int stackId = options.getLaunchStackId(); if (canUseActivityOptionsLaunchBounds(options, stackId)) { Rect bounds = options.getLaunchBounds(); final Rect bounds = TaskRecord.validateBounds(options.getLaunchBounds()); task.updateOverrideConfiguration(bounds); if (stackId == INVALID_STACK_ID) { stackId = task.getLaunchStackId(); Loading Loading @@ -1841,6 +1841,7 @@ public final class ActivityStackSupervisor implements DisplayListener { // can have the right fullscreen state. bounds = null; } bounds = TaskRecord.validateBounds(bounds); mTmpBounds.clear(); mTmpConfigs.clear(); Loading @@ -1857,8 +1858,8 @@ public final class ActivityStackSupervisor implements DisplayListener { fitWithinBounds(tempRect2, bounds); task.updateOverrideConfiguration(tempRect2); } else { task.updateOverrideConfiguration(tempTaskBounds != null ? tempTaskBounds : bounds); task.updateOverrideConfiguration( tempTaskBounds != null ? tempTaskBounds : bounds); } } Loading Loading @@ -1973,6 +1974,7 @@ public final class ActivityStackSupervisor implements DisplayListener { // Nothing to do here... return true; } bounds = TaskRecord.validateBounds(bounds); if (!mWindowManager.isValidTaskId(task.taskId)) { // Task doesn't exist in window manager yet (e.g. was restored from recents). Loading services/core/java/com/android/server/am/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -1739,7 +1739,7 @@ class ActivityStarter { if (options != null && (r.isResizeable() || (inTask != null && inTask.mResizeable))) { if (mSupervisor.canUseActivityOptionsLaunchBounds( options, options.getLaunchStackId())) { newBounds = options.getLaunchBounds(); newBounds = TaskRecord.validateBounds(options.getLaunchBounds()); } } return newBounds; Loading services/core/java/com/android/server/am/TaskRecord.java +14 −0 Original line number Diff line number Diff line Loading @@ -1311,6 +1311,20 @@ final class TaskRecord { return !mOverrideConfig.equals(oldConfig) ? mOverrideConfig : null; } Rect updateOverrideConfigurationFromLaunchBounds() { final Rect bounds = validateBounds(getLaunchBounds()); updateOverrideConfiguration(bounds); return bounds; } static Rect validateBounds(Rect bounds) { if (bounds != null && bounds.isEmpty()) { Slog.wtf(TAG, "Received strange task bounds: " + bounds, new Throwable()); return null; } return bounds; } private void reportMultiWindowModeChange() { for (int i = mActivities.size() - 1; i >= 0; i--) { final ActivityRecord r = mActivities.get(i); Loading services/core/java/com/android/server/wm/TaskStack.java +7 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.server.wm; import android.app.ActivityManager.StackId; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.os.Debug; import android.util.EventLog; Loading Loading @@ -89,6 +88,7 @@ public class TaskStack implements DimLayer.DimLayerUser { /** Detach this stack from its display when animation completes. */ boolean mDeferDetach; private boolean mUpdateBoundsAfterRotation = false; TaskStack(WindowManagerService service, int stackId) { mService = service; Loading Loading @@ -239,6 +239,7 @@ public class TaskStack implements DimLayer.DimLayerUser { } void updateDisplayInfo(Rect bounds) { mUpdateBoundsAfterRotation = false; if (mDisplayContent != null) { for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) { mTasks.get(taskNdx).updateDisplayInfo(mDisplayContent); Loading @@ -248,6 +249,7 @@ public class TaskStack implements DimLayer.DimLayerUser { } else if (mFullscreen) { setBounds(null); } else { mUpdateBoundsAfterRotation = true; mTmpRect2.set(mBounds); final int newRotation = mDisplayContent.getDisplayInfo().rotation; if (mRotation == newRotation) { Loading @@ -265,6 +267,10 @@ public class TaskStack implements DimLayer.DimLayerUser { * yet. */ void updateBoundsAfterRotation() { if (!mUpdateBoundsAfterRotation) { return; } mUpdateBoundsAfterRotation = false; final int newRotation = getDisplayInfo().rotation; mDisplayContent.rotateBounds(mRotation, newRotation, mTmpRect2); if (mStackId == DOCKED_STACK_ID) { Loading Loading
services/core/java/com/android/server/am/ActivityStack.java +3 −5 Original line number Diff line number Diff line Loading @@ -4753,8 +4753,7 @@ final class ActivityStack { } void addConfigOverride(ActivityRecord r, TaskRecord task) { final Rect bounds = task.getLaunchBounds(); task.updateOverrideConfiguration(bounds); final Rect bounds = task.updateOverrideConfigurationFromLaunchBounds(); mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken, r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen, (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0, r.userId, r.info.configChanges, Loading Loading @@ -4810,10 +4809,9 @@ final class ActivityStack { } private void setAppTask(ActivityRecord r, TaskRecord task) { final Rect bounds = task.getLaunchBounds(); task.updateOverrideConfiguration(bounds); final Rect bounds = task.updateOverrideConfigurationFromLaunchBounds(); mWindowManager.setAppTask( r.appToken, task.taskId, mStackId, task.getLaunchBounds(), task.mOverrideConfig); r.appToken, task.taskId, mStackId, bounds, task.mOverrideConfig); mWindowManager.setTaskResizeable(task.taskId, task.mResizeable); r.taskConfigOverride = task.mOverrideConfig; } Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +5 −3 Original line number Diff line number Diff line Loading @@ -1673,7 +1673,7 @@ public final class ActivityStackSupervisor implements DisplayListener { if (task.mResizeable && options != null) { int stackId = options.getLaunchStackId(); if (canUseActivityOptionsLaunchBounds(options, stackId)) { Rect bounds = options.getLaunchBounds(); final Rect bounds = TaskRecord.validateBounds(options.getLaunchBounds()); task.updateOverrideConfiguration(bounds); if (stackId == INVALID_STACK_ID) { stackId = task.getLaunchStackId(); Loading Loading @@ -1841,6 +1841,7 @@ public final class ActivityStackSupervisor implements DisplayListener { // can have the right fullscreen state. bounds = null; } bounds = TaskRecord.validateBounds(bounds); mTmpBounds.clear(); mTmpConfigs.clear(); Loading @@ -1857,8 +1858,8 @@ public final class ActivityStackSupervisor implements DisplayListener { fitWithinBounds(tempRect2, bounds); task.updateOverrideConfiguration(tempRect2); } else { task.updateOverrideConfiguration(tempTaskBounds != null ? tempTaskBounds : bounds); task.updateOverrideConfiguration( tempTaskBounds != null ? tempTaskBounds : bounds); } } Loading Loading @@ -1973,6 +1974,7 @@ public final class ActivityStackSupervisor implements DisplayListener { // Nothing to do here... return true; } bounds = TaskRecord.validateBounds(bounds); if (!mWindowManager.isValidTaskId(task.taskId)) { // Task doesn't exist in window manager yet (e.g. was restored from recents). Loading
services/core/java/com/android/server/am/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -1739,7 +1739,7 @@ class ActivityStarter { if (options != null && (r.isResizeable() || (inTask != null && inTask.mResizeable))) { if (mSupervisor.canUseActivityOptionsLaunchBounds( options, options.getLaunchStackId())) { newBounds = options.getLaunchBounds(); newBounds = TaskRecord.validateBounds(options.getLaunchBounds()); } } return newBounds; Loading
services/core/java/com/android/server/am/TaskRecord.java +14 −0 Original line number Diff line number Diff line Loading @@ -1311,6 +1311,20 @@ final class TaskRecord { return !mOverrideConfig.equals(oldConfig) ? mOverrideConfig : null; } Rect updateOverrideConfigurationFromLaunchBounds() { final Rect bounds = validateBounds(getLaunchBounds()); updateOverrideConfiguration(bounds); return bounds; } static Rect validateBounds(Rect bounds) { if (bounds != null && bounds.isEmpty()) { Slog.wtf(TAG, "Received strange task bounds: " + bounds, new Throwable()); return null; } return bounds; } private void reportMultiWindowModeChange() { for (int i = mActivities.size() - 1; i >= 0; i--) { final ActivityRecord r = mActivities.get(i); Loading
services/core/java/com/android/server/wm/TaskStack.java +7 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.server.wm; import android.app.ActivityManager.StackId; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.os.Debug; import android.util.EventLog; Loading Loading @@ -89,6 +88,7 @@ public class TaskStack implements DimLayer.DimLayerUser { /** Detach this stack from its display when animation completes. */ boolean mDeferDetach; private boolean mUpdateBoundsAfterRotation = false; TaskStack(WindowManagerService service, int stackId) { mService = service; Loading Loading @@ -239,6 +239,7 @@ public class TaskStack implements DimLayer.DimLayerUser { } void updateDisplayInfo(Rect bounds) { mUpdateBoundsAfterRotation = false; if (mDisplayContent != null) { for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) { mTasks.get(taskNdx).updateDisplayInfo(mDisplayContent); Loading @@ -248,6 +249,7 @@ public class TaskStack implements DimLayer.DimLayerUser { } else if (mFullscreen) { setBounds(null); } else { mUpdateBoundsAfterRotation = true; mTmpRect2.set(mBounds); final int newRotation = mDisplayContent.getDisplayInfo().rotation; if (mRotation == newRotation) { Loading @@ -265,6 +267,10 @@ public class TaskStack implements DimLayer.DimLayerUser { * yet. */ void updateBoundsAfterRotation() { if (!mUpdateBoundsAfterRotation) { return; } mUpdateBoundsAfterRotation = false; final int newRotation = getDisplayInfo().rotation; mDisplayContent.rotateBounds(mRotation, newRotation, mTmpRect2); if (mStackId == DOCKED_STACK_ID) { Loading