Merge "Skip Pip animation to fullscreen if orientation is going to change" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5772ffcb9f
@@ -2278,7 +2278,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
|
||||
}
|
||||
|
||||
/** Returns true if the configuration is compatible with this activity. */
|
||||
private boolean isConfigurationCompatible(Configuration config) {
|
||||
boolean isConfigurationCompatible(Configuration config) {
|
||||
final int orientation = mWindowContainerController != null
|
||||
? mWindowContainerController.getOrientation() : info.screenOrientation;
|
||||
if (isFixedOrientationPortrait(orientation)
|
||||
|
||||
@@ -655,11 +655,11 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
|
||||
}
|
||||
}
|
||||
|
||||
final ActivityRecord topRunningActivityLocked() {
|
||||
ActivityRecord topRunningActivityLocked() {
|
||||
return topRunningActivityLocked(false /* focusableOnly */);
|
||||
}
|
||||
|
||||
final ActivityRecord topRunningActivityLocked(boolean focusableOnly) {
|
||||
private ActivityRecord topRunningActivityLocked(boolean focusableOnly) {
|
||||
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
|
||||
ActivityRecord r = mTaskHistory.get(taskNdx).topRunningActivityLocked();
|
||||
if (r != null && (!focusableOnly || r.isFocusable())) {
|
||||
@@ -669,7 +669,21 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
|
||||
return null;
|
||||
}
|
||||
|
||||
final ActivityRecord topRunningNonDelayedActivityLocked(ActivityRecord notTop) {
|
||||
ActivityRecord topRunningNonOverlayTaskActivity() {
|
||||
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
|
||||
final TaskRecord task = mTaskHistory.get(taskNdx);
|
||||
final ArrayList<ActivityRecord> activities = task.mActivities;
|
||||
for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
|
||||
final ActivityRecord r = activities.get(activityNdx);
|
||||
if (!r.finishing && !r.mTaskOverlay) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
ActivityRecord topRunningNonDelayedActivityLocked(ActivityRecord notTop) {
|
||||
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
|
||||
final TaskRecord task = mTaskHistory.get(taskNdx);
|
||||
final ArrayList<ActivityRecord> activities = task.mActivities;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.server.am;
|
||||
|
||||
import android.app.RemoteAction;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Rect;
|
||||
|
||||
import com.android.server.am.ActivityStackSupervisor.ActivityContainer;
|
||||
@@ -50,8 +51,21 @@ class PinnedActivityStack extends ActivityStack<PinnedStackWindowController>
|
||||
|
||||
void animateResizePinnedStack(Rect sourceHintBounds, Rect toBounds, int animationDuration,
|
||||
boolean schedulePipModeChangedOnAnimationEnd) {
|
||||
getWindowContainerController().animateResizePinnedStack(toBounds, sourceHintBounds,
|
||||
animationDuration, schedulePipModeChangedOnAnimationEnd);
|
||||
if (skipResizeAnimation(toBounds == null /* toFullscreen */)) {
|
||||
mService.moveTasksToFullscreenStack(mStackId, true /* onTop */);
|
||||
} else {
|
||||
getWindowContainerController().animateResizePinnedStack(toBounds, sourceHintBounds,
|
||||
animationDuration, schedulePipModeChangedOnAnimationEnd);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean skipResizeAnimation(boolean toFullscreen) {
|
||||
if (!toFullscreen) {
|
||||
return false;
|
||||
}
|
||||
final Configuration parentConfig = getParent().getConfiguration();
|
||||
final ActivityRecord top = topRunningNonOverlayTaskActivity();
|
||||
return top != null && !top.isConfigurationCompatible(parentConfig);
|
||||
}
|
||||
|
||||
void setPictureInPictureAspectRatio(float aspectRatio) {
|
||||
|
||||
Reference in New Issue
Block a user