Merge "Merge "Dismiss stage split when unlock after folded" into sc-v2-dev am: 3c4e9ed3b8" into sc-v2-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
11d41979e2
@@ -81,6 +81,12 @@ public interface SplitScreen {
|
|||||||
*/
|
*/
|
||||||
void onKeyguardOccludedChanged(boolean occluded);
|
void onKeyguardOccludedChanged(boolean occluded);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the visibility of the keyguard changes.
|
||||||
|
* @param showing Indicates if the keyguard is now visible.
|
||||||
|
*/
|
||||||
|
void onKeyguardVisibilityChanged(boolean showing);
|
||||||
|
|
||||||
/** Get a string representation of a stage type */
|
/** Get a string representation of a stage type */
|
||||||
static String stageTypeToString(@StageType int stage) {
|
static String stageTypeToString(@StageType int stage) {
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
|
|||||||
@@ -172,6 +172,10 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
|
|||||||
mStageCoordinator.onKeyguardOccludedChanged(occluded);
|
mStageCoordinator.onKeyguardOccludedChanged(occluded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onKeyguardVisibilityChanged(boolean showing) {
|
||||||
|
mStageCoordinator.onKeyguardVisibilityChanged(showing);
|
||||||
|
}
|
||||||
|
|
||||||
public void exitSplitScreenOnHide(boolean exitSplitScreenOnHide) {
|
public void exitSplitScreenOnHide(boolean exitSplitScreenOnHide) {
|
||||||
mStageCoordinator.exitSplitScreenOnHide(exitSplitScreenOnHide);
|
mStageCoordinator.exitSplitScreenOnHide(exitSplitScreenOnHide);
|
||||||
}
|
}
|
||||||
@@ -371,6 +375,13 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onKeyguardVisibilityChanged(boolean showing) {
|
||||||
|
mMainExecutor.execute(() -> {
|
||||||
|
SplitScreenController.this.onKeyguardVisibilityChanged(showing);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -136,7 +136,10 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
/** Whether the device is supporting legacy split or not. */
|
/** Whether the device is supporting legacy split or not. */
|
||||||
private boolean mUseLegacySplit;
|
private boolean mUseLegacySplit;
|
||||||
|
|
||||||
@SplitScreen.StageType int mDismissTop = NO_DISMISS;
|
@SplitScreen.StageType private int mDismissTop = NO_DISMISS;
|
||||||
|
|
||||||
|
/** The target stage to dismiss to when unlock after folded. */
|
||||||
|
@SplitScreen.StageType private int mTopStageAfterFoldDismiss = STAGE_TYPE_UNDEFINED;
|
||||||
|
|
||||||
private final Runnable mOnTransitionAnimationComplete = () -> {
|
private final Runnable mOnTransitionAnimationComplete = () -> {
|
||||||
// If still playing, let it finish.
|
// If still playing, let it finish.
|
||||||
@@ -443,6 +446,13 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
mKeyguardOccluded = occluded;
|
mKeyguardOccluded = occluded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onKeyguardVisibilityChanged(boolean showing) {
|
||||||
|
if (!showing && mMainStage.isActive()
|
||||||
|
&& mTopStageAfterFoldDismiss != STAGE_TYPE_UNDEFINED) {
|
||||||
|
exitSplitScreen(mTopStageAfterFoldDismiss == STAGE_TYPE_MAIN ? mMainStage : mSideStage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void exitSplitScreen() {
|
void exitSplitScreen() {
|
||||||
exitSplitScreen(null /* childrenToTop */);
|
exitSplitScreen(null /* childrenToTop */);
|
||||||
}
|
}
|
||||||
@@ -458,6 +468,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
mTaskOrganizer.applyTransaction(wct);
|
mTaskOrganizer.applyTransaction(wct);
|
||||||
// Reset divider position.
|
// Reset divider position.
|
||||||
mSplitLayout.resetDividerPosition();
|
mSplitLayout.resetDividerPosition();
|
||||||
|
mTopStageAfterFoldDismiss = STAGE_TYPE_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -808,8 +819,13 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onFoldedStateChanged(boolean folded) {
|
private void onFoldedStateChanged(boolean folded) {
|
||||||
if (folded && mMainStage.isActive()) {
|
mTopStageAfterFoldDismiss = STAGE_TYPE_UNDEFINED;
|
||||||
exitSplitScreen(mMainStage);
|
if (!folded) return;
|
||||||
|
|
||||||
|
if (mMainStage.isFocused()) {
|
||||||
|
mTopStageAfterFoldDismiss = STAGE_TYPE_MAIN;
|
||||||
|
} else if (mSideStage.isFocused()) {
|
||||||
|
mTopStageAfterFoldDismiss = STAGE_TYPE_SIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,15 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
return mChildrenTaskInfo.contains(taskId);
|
return mChildrenTaskInfo.contains(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {@code true} if this listener contains the currently focused task. */
|
||||||
|
boolean isFocused() {
|
||||||
|
if (mRootTaskInfo.isFocused) return true;
|
||||||
|
for (int i = mChildrenTaskInfo.size() - 1; i >= 0; --i) {
|
||||||
|
if (mChildrenTaskInfo.valueAt(i).isFocused) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@CallSuper
|
@CallSuper
|
||||||
public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
|
public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
|
||||||
|
|||||||
@@ -241,6 +241,11 @@ public final class WMShell extends SystemUI
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void initSplitScreen(SplitScreen splitScreen) {
|
void initSplitScreen(SplitScreen splitScreen) {
|
||||||
mSplitScreenKeyguardCallback = new KeyguardUpdateMonitorCallback() {
|
mSplitScreenKeyguardCallback = new KeyguardUpdateMonitorCallback() {
|
||||||
|
@Override
|
||||||
|
public void onKeyguardVisibilityChanged(boolean showing) {
|
||||||
|
splitScreen.onKeyguardVisibilityChanged(showing);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onKeyguardOccludedChanged(boolean occluded) {
|
public void onKeyguardOccludedChanged(boolean occluded) {
|
||||||
splitScreen.onKeyguardOccludedChanged(occluded);
|
splitScreen.onKeyguardOccludedChanged(occluded);
|
||||||
|
|||||||
Reference in New Issue
Block a user