diff options
Diffstat (limited to 'libs')
6 files changed, 57 insertions, 7 deletions
diff --git a/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml b/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml index 681a52bea2b2..e04ab817215c 100644 --- a/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml @@ -21,4 +21,9 @@ android:orientation="vertical" android:id="@+id/bubble_bar_expanded_view"> + <com.android.wm.shell.bubbles.bar.BubbleBarHandleView + android:id="@+id/bubble_bar_handle_view" + android:layout_height="wrap_content" + android:layout_width="wrap_content" /> + </com.android.wm.shell.bubbles.bar.BubbleBarExpandedView> diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java index d073f1df938a..66c0c9640477 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java @@ -70,7 +70,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView private @Nullable Supplier<Rect> mLayerBoundsSupplier; private @Nullable Listener mListener; - private BubbleBarHandleView mHandleView = new BubbleBarHandleView(getContext()); + private BubbleBarHandleView mHandleView; private @Nullable TaskView mTaskView; private @Nullable BubbleOverflowContainerView mOverflowView; @@ -111,7 +111,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView setElevation(getResources().getDimensionPixelSize(R.dimen.bubble_elevation)); mCaptionHeight = context.getResources().getDimensionPixelSize( R.dimen.bubble_bar_expanded_view_caption_height); - addView(mHandleView); + mHandleView = findViewById(R.id.bubble_bar_handle_view); applyThemeAttrs(); setClipToOutline(true); setOutlineProvider(new ViewOutlineProvider() { diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java index 7dec12aac39b..bc1a57572c63 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java @@ -388,6 +388,7 @@ class SplitScreenTransitions { IBinder startResizeTransition(WindowContainerTransaction wct, Transitions.TransitionHandler handler, + @Nullable TransitionConsumedCallback consumedCallback, @Nullable TransitionFinishedCallback finishCallback) { if (mPendingResize != null) { mPendingResize.cancel(null); @@ -396,13 +397,14 @@ class SplitScreenTransitions { } IBinder transition = mTransitions.startTransition(TRANSIT_CHANGE, wct, handler); - setResizeTransition(transition, finishCallback); + setResizeTransition(transition, consumedCallback, finishCallback); return transition; } void setResizeTransition(@NonNull IBinder transition, + @Nullable TransitionConsumedCallback consumedCallback, @Nullable TransitionFinishedCallback finishCallback) { - mPendingResize = new TransitSession(transition, null /* consumedCb */, finishCallback); + mPendingResize = new TransitSession(transition, consumedCallback, finishCallback); ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " splitTransition " + " deduced Resize split screen"); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index 96e57e71f05c..0781a9e440f3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -2236,8 +2236,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, sendOnBoundsChanged(); if (ENABLE_SHELL_TRANSITIONS) { mSplitLayout.setDividerInteractive(false, false, "onSplitResizeStart"); - mSplitTransitions.startResizeTransition(wct, this, (finishWct, t) -> - mSplitLayout.setDividerInteractive(true, false, "onSplitResizeFinish")); + mSplitTransitions.startResizeTransition(wct, this, (aborted) -> { + mSplitLayout.setDividerInteractive(true, false, "onSplitResizeConsumed"); + }, (finishWct, t) -> { + mSplitLayout.setDividerInteractive(true, false, "onSplitResizeFinish"); + }); } else { // Only need screenshot for legacy case because shell transition should screenshot // itself during transition. diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java index e22bf3de30e4..e9da25813510 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java @@ -64,6 +64,7 @@ import static org.mockito.Mockito.verify; import android.app.ActivityManager.RunningTaskInfo; import android.app.IApplicationThread; import android.app.PendingIntent; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Binder; @@ -420,6 +421,30 @@ public class ShellTransitionTests extends ShellTestCase { } @Test + public void testTransitionFilterActivityComponent() { + TransitionFilter filter = new TransitionFilter(); + ComponentName cmpt = new ComponentName("testpak", "testcls"); + filter.mRequirements = + new TransitionFilter.Requirement[]{new TransitionFilter.Requirement()}; + filter.mRequirements[0].mTopActivity = cmpt; + filter.mRequirements[0].mModes = new int[]{TRANSIT_OPEN, TRANSIT_TO_FRONT}; + + final RunningTaskInfo taskInf = createTaskInfo(1); + final TransitionInfo openTask = new TransitionInfoBuilder(TRANSIT_OPEN) + .addChange(TRANSIT_OPEN, taskInf).build(); + assertFalse(filter.matches(openTask)); + + taskInf.topActivity = cmpt; + final TransitionInfo openTaskCmpt = new TransitionInfoBuilder(TRANSIT_OPEN) + .addChange(TRANSIT_OPEN, taskInf).build(); + assertTrue(filter.matches(openTaskCmpt)); + + final TransitionInfo openAct = new TransitionInfoBuilder(TRANSIT_OPEN) + .addChange(TRANSIT_OPEN, cmpt).build(); + assertTrue(filter.matches(openAct)); + } + + @Test public void testRegisteredRemoteTransition() { Transitions transitions = createTestTransitions(); transitions.replaceDefaultHandlerForTest(mDefaultHandler); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/TransitionInfoBuilder.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/TransitionInfoBuilder.java index 834385832e4a..b8939e6ff623 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/TransitionInfoBuilder.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/TransitionInfoBuilder.java @@ -21,6 +21,7 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn; import static org.mockito.Mockito.mock; import android.app.ActivityManager; +import android.content.ComponentName; import android.view.SurfaceControl; import android.view.WindowManager; import android.window.TransitionInfo; @@ -50,20 +51,34 @@ public class TransitionInfoBuilder { } public TransitionInfoBuilder addChange(@WindowManager.TransitionType int mode, - @TransitionInfo.ChangeFlags int flags, ActivityManager.RunningTaskInfo taskInfo) { + @TransitionInfo.ChangeFlags int flags, ActivityManager.RunningTaskInfo taskInfo, + ComponentName activityComponent) { final TransitionInfo.Change change = new TransitionInfo.Change( taskInfo != null ? taskInfo.token : null, createMockSurface(true /* valid */)); change.setMode(mode); change.setFlags(flags); change.setTaskInfo(taskInfo); + change.setActivityComponent(activityComponent); return addChange(change); } + /** Add a change to the TransitionInfo */ + public TransitionInfoBuilder addChange(@WindowManager.TransitionType int mode, + @TransitionInfo.ChangeFlags int flags, ActivityManager.RunningTaskInfo taskInfo) { + return addChange(mode, flags, taskInfo, null /* activityComponent */); + } + public TransitionInfoBuilder addChange(@WindowManager.TransitionType int mode, ActivityManager.RunningTaskInfo taskInfo) { return addChange(mode, TransitionInfo.FLAG_NONE, taskInfo); } + /** Add a change to the TransitionInfo */ + public TransitionInfoBuilder addChange(@WindowManager.TransitionType int mode, + ComponentName activityComponent) { + return addChange(mode, TransitionInfo.FLAG_NONE, null /* taskinfo */, activityComponent); + } + public TransitionInfoBuilder addChange(@WindowManager.TransitionType int mode) { return addChange(mode, TransitionInfo.FLAG_NONE, null /* taskInfo */); } |