Merge "Do not dismiss split if stages are not visible due to screen is sleeping" into sc-v2-dev am: c200310e02 am: 467aa9197b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14613435 Change-Id: Ie0bfc001de218d0bcd4a560a8abd30692d19958c
This commit is contained in:
@@ -239,6 +239,12 @@ public class TaskInfo {
|
||||
*/
|
||||
public boolean isVisible;
|
||||
|
||||
/**
|
||||
* Whether this task is sleeping due to sleeping display.
|
||||
* @hide
|
||||
*/
|
||||
public boolean isSleeping;
|
||||
|
||||
TaskInfo() {
|
||||
// Do nothing
|
||||
}
|
||||
@@ -342,7 +348,8 @@ public class TaskInfo {
|
||||
&& getWindowingMode() == that.getWindowingMode()
|
||||
&& Objects.equals(taskDescription, that.taskDescription)
|
||||
&& isFocused == that.isFocused
|
||||
&& isVisible == that.isVisible;
|
||||
&& isVisible == that.isVisible
|
||||
&& isSleeping == that.isSleeping;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -396,6 +403,7 @@ public class TaskInfo {
|
||||
parentTaskId = source.readInt();
|
||||
isFocused = source.readBoolean();
|
||||
isVisible = source.readBoolean();
|
||||
isSleeping = source.readBoolean();
|
||||
topActivityToken = source.readStrongBinder();
|
||||
topActivityInSizeCompat = source.readBoolean();
|
||||
mTopActivityLocusId = source.readTypedObject(LocusId.CREATOR);
|
||||
@@ -434,6 +442,7 @@ public class TaskInfo {
|
||||
dest.writeInt(parentTaskId);
|
||||
dest.writeBoolean(isFocused);
|
||||
dest.writeBoolean(isVisible);
|
||||
dest.writeBoolean(isSleeping);
|
||||
dest.writeStrongBinder(topActivityToken);
|
||||
dest.writeBoolean(topActivityInSizeCompat);
|
||||
dest.writeTypedObject(mTopActivityLocusId, flags);
|
||||
@@ -462,6 +471,7 @@ public class TaskInfo {
|
||||
+ " parentTaskId=" + parentTaskId
|
||||
+ " isFocused=" + isFocused
|
||||
+ " isVisible=" + isVisible
|
||||
+ " isSleeping=" + isSleeping
|
||||
+ " topActivityToken=" + topActivityToken
|
||||
+ " topActivityInSizeCompat=" + topActivityInSizeCompat
|
||||
+ " locusId= " + mTopActivityLocusId
|
||||
|
||||
@@ -116,7 +116,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
private final List<SplitScreen.SplitScreenListener> mListeners = new ArrayList<>();
|
||||
private final DisplayImeController mDisplayImeController;
|
||||
private final SplitScreenTransitions mSplitTransitions;
|
||||
private boolean mExitSplitScreenOnHide = true;
|
||||
private boolean mExitSplitScreenOnHide;
|
||||
private boolean mKeyguardOccluded;
|
||||
|
||||
// TODO(b/187041611): remove this flag after totally deprecated legacy split
|
||||
@@ -415,10 +415,13 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
// Divider is only visible if both the main stage and side stages are visible
|
||||
setDividerVisibility(isSplitScreenVisible());
|
||||
|
||||
if (mExitSplitScreenOnHide && !mainStageVisible && !sideStageVisible) {
|
||||
// Exit split-screen if both stage are not visible.
|
||||
// TODO: This is only a temporary request from UX and is likely to be removed soon...
|
||||
exitSplitScreen();
|
||||
if (!mainStageVisible && !sideStageVisible) {
|
||||
if (mExitSplitScreenOnHide
|
||||
// Don't dismiss staged split when both stages are not visible due to sleeping display,
|
||||
// like the cases keyguard showing or screen off.
|
||||
|| (!mMainStage.mRootTaskInfo.isSleeping && !mSideStage.mRootTaskInfo.isSleeping)) {
|
||||
exitSplitScreen();
|
||||
}
|
||||
} else if (mKeyguardOccluded) {
|
||||
// At least one of the stages is visible while keyguard occluded. Dismiss split because
|
||||
// there's show-when-locked activity showing on top of keyguard. Also make sure the
|
||||
|
||||
@@ -4136,6 +4136,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
: INVALID_TASK_ID;
|
||||
info.isFocused = isFocused();
|
||||
info.isVisible = hasVisibleChildren();
|
||||
info.isSleeping = shouldSleepActivities();
|
||||
ActivityRecord topRecord = getTopNonFinishingActivity();
|
||||
info.mTopActivityLocusId = topRecord != null ? topRecord.getLocusId() : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user