summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/WindowManager/Shell/res/layout/desktop_mode_focused_window_decor.xml4
-rw-r--r--libs/WindowManager/Shell/res/values/dimen.xml3
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java47
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java5
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java56
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.java31
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java15
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeFocusedWindowDecorationViewHolder.kt15
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt8
-rw-r--r--libs/WindowManager/Shell/tests/flicker/pip/src/com/android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt2
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java6
-rw-r--r--libs/hwui/utils/ForceDark.h6
12 files changed, 100 insertions, 98 deletions
diff --git a/libs/WindowManager/Shell/res/layout/desktop_mode_focused_window_decor.xml b/libs/WindowManager/Shell/res/layout/desktop_mode_focused_window_decor.xml
index cec7ee233236..ef7478c04dda 100644
--- a/libs/WindowManager/Shell/res/layout/desktop_mode_focused_window_decor.xml
+++ b/libs/WindowManager/Shell/res/layout/desktop_mode_focused_window_decor.xml
@@ -18,13 +18,13 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/desktop_mode_caption"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<ImageButton
android:id="@+id/caption_handle"
- android:layout_width="128dp"
+ android:layout_width="@dimen/desktop_mode_fullscreen_decor_caption_width"
android:layout_height="@dimen/desktop_mode_fullscreen_decor_caption_height"
android:paddingVertical="16dp"
android:contentDescription="@string/handle_text"
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index 0a40cea3134d..28e709845e88 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -413,6 +413,9 @@
<!-- Height of desktop mode caption for fullscreen tasks. -->
<dimen name="desktop_mode_fullscreen_decor_caption_height">36dp</dimen>
+ <!-- Width of desktop mode caption for fullscreen tasks. -->
+ <dimen name="desktop_mode_fullscreen_decor_caption_width">128dp</dimen>
+
<!-- Required empty space to be visible for partially offscreen tasks. -->
<dimen name="freeform_required_visible_empty_space_in_header">48dp</dimen>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
index 48a0a46dccc1..3b0e7c139bed 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
@@ -19,6 +19,7 @@ package com.android.wm.shell.pip2.phone;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_PIP;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static com.android.wm.shell.transition.Transitions.TRANSIT_EXIT_PIP;
@@ -54,6 +55,8 @@ public class PipTransition extends PipTransitionController {
@Nullable
private WindowContainerToken mPipTaskToken;
@Nullable
+ private IBinder mEnterTransition;
+ @Nullable
private IBinder mAutoEnterButtonNavTransition;
@Nullable
private IBinder mExitViaExpandTransition;
@@ -98,11 +101,8 @@ public class PipTransition extends PipTransitionController {
@Override
public WindowContainerTransaction handleRequest(@NonNull IBinder transition,
@NonNull TransitionRequestInfo request) {
- if (isAutoEnterInButtonNavigation(request)) {
- mAutoEnterButtonNavTransition = transition;
- return getEnterPipTransaction(transition, request);
- } else if (isLegacyEnter(request)) {
- mLegacyEnterTransition = transition;
+ if (isAutoEnterInButtonNavigation(request) || isEnterPictureInPictureModeRequest(request)) {
+ mEnterTransition = transition;
return getEnterPipTransaction(transition, request);
}
return null;
@@ -111,12 +111,9 @@ public class PipTransition extends PipTransitionController {
@Override
public void augmentRequest(@NonNull IBinder transition, @NonNull TransitionRequestInfo request,
@NonNull WindowContainerTransaction outWct) {
- if (isAutoEnterInButtonNavigation(request)) {
+ if (isAutoEnterInButtonNavigation(request) || isEnterPictureInPictureModeRequest(request)) {
outWct.merge(getEnterPipTransaction(transition, request), true /* transfer */);
- mAutoEnterButtonNavTransition = transition;
- } else if (isLegacyEnter(request)) {
- outWct.merge(getEnterPipTransaction(transition, request), true /* transfer */);
- mLegacyEnterTransition = transition;
+ mEnterTransition = transition;
}
}
@@ -162,7 +159,7 @@ public class PipTransition extends PipTransitionController {
&& pipTask.pictureInPictureParams.isAutoEnterEnabled();
}
- private boolean isLegacyEnter(@NonNull TransitionRequestInfo requestInfo) {
+ private boolean isEnterPictureInPictureModeRequest(@NonNull TransitionRequestInfo requestInfo) {
return requestInfo.getType() == TRANSIT_PIP;
}
@@ -172,13 +169,15 @@ public class PipTransition extends PipTransitionController {
@NonNull SurfaceControl.Transaction startTransaction,
@NonNull SurfaceControl.Transaction finishTransaction,
@NonNull Transitions.TransitionFinishCallback finishCallback) {
- if (transition == mAutoEnterButtonNavTransition) {
- mAutoEnterButtonNavTransition = null;
- return startAutoEnterButtonNavAnimation(info, startTransaction, finishTransaction,
- finishCallback);
- } else if (transition == mLegacyEnterTransition) {
- mLegacyEnterTransition = null;
- return startLegacyEnterAnimation(info, startTransaction, finishTransaction,
+ if (transition == mEnterTransition) {
+ mEnterTransition = null;
+ if (isLegacyEnter(info)) {
+ // If this is a legacy-enter-pip (auto-enter is off and PiP activity went to pause),
+ // then we should run an ALPHA type (cross-fade) animation.
+ return startAlphaTypeEnterAnimation(info, startTransaction, finishTransaction,
+ finishCallback);
+ }
+ return startBoundsTypeEnterAnimation(info, startTransaction, finishTransaction,
finishCallback);
} else if (transition == mExitViaExpandTransition) {
mExitViaExpandTransition = null;
@@ -187,7 +186,15 @@ public class PipTransition extends PipTransitionController {
return false;
}
- private boolean startAutoEnterButtonNavAnimation(@NonNull TransitionInfo info,
+ private boolean isLegacyEnter(@NonNull TransitionInfo info) {
+ TransitionInfo.Change pipChange = getPipChange(info);
+ // If the only change in the changes list is a TO_FRONT mode PiP task,
+ // then this is legacy-enter PiP.
+ return pipChange != null && pipChange.getMode() == TRANSIT_TO_FRONT
+ && info.getChanges().size() == 1;
+ }
+
+ private boolean startBoundsTypeEnterAnimation(@NonNull TransitionInfo info,
@NonNull SurfaceControl.Transaction startTransaction,
@NonNull SurfaceControl.Transaction finishTransaction,
@NonNull Transitions.TransitionFinishCallback finishCallback) {
@@ -205,7 +212,7 @@ public class PipTransition extends PipTransitionController {
return true;
}
- private boolean startLegacyEnterAnimation(@NonNull TransitionInfo info,
+ private boolean startAlphaTypeEnterAnimation(@NonNull TransitionInfo info,
@NonNull SurfaceControl.Transaction startTransaction,
@NonNull SurfaceControl.Transaction finishTransaction,
@NonNull Transitions.TransitionFinishCallback finishCallback) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
index 4fd362591151..61a8e9b5dd59 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
@@ -726,7 +726,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
private void handleEventOutsideFocusedCaption(MotionEvent ev,
DesktopModeWindowDecoration relevantDecor) {
// Returns if event occurs within caption
- if (relevantDecor == null || relevantDecor.checkTouchEventInCaption(ev)) {
+ if (relevantDecor == null || relevantDecor.checkTouchEventInCaptionHandle(ev)) {
return;
}
@@ -761,7 +761,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
|| windowingMode == WINDOWING_MODE_MULTI_WINDOW;
}
- if (dragFromStatusBarAllowed && relevantDecor.checkTouchEventInHandle(ev)) {
+ if (dragFromStatusBarAllowed
+ && relevantDecor.checkTouchEventInCaptionHandle(ev)) {
mTransitionDragActive = true;
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
index 0c8e93b48d02..d08b655e43f8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
@@ -317,6 +317,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
relayoutParams.mLayoutResId =
getDesktopModeWindowDecorLayoutId(taskInfo.getWindowingMode());
relayoutParams.mCaptionHeightId = getCaptionHeightIdStatic(taskInfo.getWindowingMode());
+ relayoutParams.mCaptionWidthId = getCaptionWidthId(relayoutParams.mLayoutResId);
if (DesktopModeStatus.useWindowShadow(/* isFocusedWindow= */ taskInfo.isFocused)) {
relayoutParams.mShadowRadiusId = taskInfo.isFocused
? R.dimen.freeform_decor_shadow_focused_thickness
@@ -345,6 +346,17 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
}
}
+ /**
+ * If task has focused window decor, return the caption id of the fullscreen caption size
+ * resource. Otherwise, return ID_NULL and caption width be set to task width.
+ */
+ private static int getCaptionWidthId(int layoutResId) {
+ if (layoutResId == R.layout.desktop_mode_focused_window_decor) {
+ return R.dimen.desktop_mode_fullscreen_decor_caption_width;
+ }
+ return Resources.ID_NULL;
+ }
+
private PointF calculateMaximizeMenuPosition() {
final PointF position = new PointF();
@@ -558,7 +570,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
.setOnClickListener(mOnCaptionButtonClickListener)
.setOnTouchListener(mOnCaptionTouchListener)
.setLayoutId(mRelayoutParams.mLayoutResId)
- .setCaptionPosition(mRelayoutParams.mCaptionX, mRelayoutParams.mCaptionY)
.setWindowingButtonsVisible(DesktopModeStatus.isEnabled())
.setCaptionHeight(mResult.mCaptionHeight)
.build();
@@ -635,35 +646,25 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
mTaskOrganizer.getRunningTaskInfo(mTaskInfo.taskId);
if (taskInfo == null) return result;
final Point positionInParent = taskInfo.positionInParent;
- result.offset(-mRelayoutParams.mCaptionX, -mRelayoutParams.mCaptionY);
result.offset(-positionInParent.x, -positionInParent.y);
return result;
}
/**
- * Determine if a passed MotionEvent is in a view in caption
+ * Checks if motion event occurs in the caption handle area. This should be used in cases where
+ * onTouchListener will not work (i.e. when caption is in status bar area).
*
* @param ev the {@link MotionEvent} to check
- * @param layoutId the id of the view
* @return {@code true} if event is inside the specified view, {@code false} if not
*/
- private boolean checkEventInCaptionView(MotionEvent ev, int layoutId) {
- if (mResult.mRootView == null) return false;
+ boolean checkTouchEventInCaptionHandle(MotionEvent ev) {
+ if (isHandleMenuActive() || !(mWindowDecorViewHolder
+ instanceof DesktopModeFocusedWindowDecorationViewHolder)) {
+ return false;
+ }
final PointF inputPoint = offsetCaptionLocation(ev);
- final View view = mResult.mRootView.findViewById(layoutId);
- return view != null && pointInView(view, inputPoint.x, inputPoint.y);
- }
-
- boolean checkTouchEventInHandle(MotionEvent ev) {
- if (isHandleMenuActive()) return false;
- return checkEventInCaptionView(ev, R.id.caption_handle);
- }
-
- /**
- * Returns true if motion event is within the caption's root view's bounds.
- */
- boolean checkTouchEventInCaption(MotionEvent ev) {
- return checkEventInCaptionView(ev, getCaptionViewId());
+ return ((DesktopModeFocusedWindowDecorationViewHolder) mWindowDecorViewHolder)
+ .pointInCaption(inputPoint, mResult.mCaptionX);
}
/**
@@ -676,24 +677,19 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
void checkClickEvent(MotionEvent ev) {
if (mResult.mRootView == null) return;
if (!isHandleMenuActive()) {
+ // Click if point in caption handle view
final View caption = mResult.mRootView.findViewById(R.id.desktop_mode_caption);
final View handle = caption.findViewById(R.id.caption_handle);
- clickIfPointInView(new PointF(ev.getX(), ev.getY()), handle);
+ if (checkTouchEventInCaptionHandle(ev)) {
+ mOnCaptionButtonClickListener.onClick(handle);
+ }
} else {
mHandleMenu.checkClickEvent(ev);
closeHandleMenuIfNeeded(ev);
}
}
- private boolean clickIfPointInView(PointF inputPoint, View v) {
- if (pointInView(v, inputPoint.x, inputPoint.y)) {
- mOnCaptionButtonClickListener.onClick(v);
- return true;
- }
- return false;
- }
-
- boolean pointInView(View v, float x, float y) {
+ private boolean pointInView(View v, float x, float y) {
return v != null && v.getLeft() <= x && v.getRight() >= x
&& v.getTop() <= y && v.getBottom() >= y;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.java
index 652a2ed39c67..b37dd0d6fd2d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.java
@@ -64,8 +64,6 @@ class HandleMenu {
private final View.OnTouchListener mOnTouchListener;
private final RunningTaskInfo mTaskInfo;
private final int mLayoutResId;
- private final int mCaptionX;
- private final int mCaptionY;
private int mMarginMenuTop;
private int mMarginMenuStart;
private int mMenuHeight;
@@ -74,16 +72,13 @@ class HandleMenu {
private HandleMenuAnimator mHandleMenuAnimator;
- HandleMenu(WindowDecoration parentDecor, int layoutResId, int captionX, int captionY,
- View.OnClickListener onClickListener, View.OnTouchListener onTouchListener,
- Bitmap appIcon, CharSequence appName, boolean shouldShowWindowingPill,
- int captionHeight) {
+ HandleMenu(WindowDecoration parentDecor, int layoutResId, View.OnClickListener onClickListener,
+ View.OnTouchListener onTouchListener, Bitmap appIcon, CharSequence appName,
+ boolean shouldShowWindowingPill, int captionHeight) {
mParentDecor = parentDecor;
mContext = mParentDecor.mDecorWindowContext;
mTaskInfo = mParentDecor.mTaskInfo;
mLayoutResId = layoutResId;
- mCaptionX = captionX;
- mCaptionY = captionY;
mOnClickListener = onClickListener;
mOnTouchListener = onTouchListener;
mAppIconBitmap = appIcon;
@@ -225,12 +220,12 @@ class HandleMenu {
if (mLayoutResId
== R.layout.desktop_mode_app_controls_window_decor) {
// Align the handle menu to the left of the caption.
- menuX = mCaptionX + mMarginMenuStart;
- menuY = mCaptionY + mMarginMenuTop;
+ menuX = mMarginMenuStart;
+ menuY = mMarginMenuTop;
} else {
// Position the handle menu at the center of the caption.
- menuX = mCaptionX + (captionWidth / 2) - (mMenuWidth / 2);
- menuY = mCaptionY + mMarginMenuStart;
+ menuX = (captionWidth / 2) - (mMenuWidth / 2);
+ menuY = mMarginMenuStart;
}
// Handle Menu position setup.
@@ -346,8 +341,6 @@ class HandleMenu {
private View.OnClickListener mOnClickListener;
private View.OnTouchListener mOnTouchListener;
private int mLayoutId;
- private int mCaptionX;
- private int mCaptionY;
private boolean mShowWindowingPill;
private int mCaptionHeight;
@@ -381,12 +374,6 @@ class HandleMenu {
return this;
}
- Builder setCaptionPosition(int captionX, int captionY) {
- mCaptionX = captionX;
- mCaptionY = captionY;
- return this;
- }
-
Builder setWindowingButtonsVisible(boolean windowingButtonsVisible) {
mShowWindowingPill = windowingButtonsVisible;
return this;
@@ -398,8 +385,8 @@ class HandleMenu {
}
HandleMenu build() {
- return new HandleMenu(mParent, mLayoutId, mCaptionX, mCaptionY, mOnClickListener,
- mOnTouchListener, mAppIcon, mName, mShowWindowingPill, mCaptionHeight);
+ return new HandleMenu(mParent, mLayoutId, mOnClickListener, mOnTouchListener,
+ mAppIcon, mName, mShowWindowingPill, mCaptionHeight);
}
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java
index b5373c67c602..6a9258c68acf 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java
@@ -279,9 +279,12 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
}
outResult.mCaptionHeight = loadDimensionPixelSize(resources, params.mCaptionHeightId);
- final int captionWidth = taskBounds.width();
+ final int captionWidth = params.mCaptionWidthId != Resources.ID_NULL
+ ? loadDimensionPixelSize(resources, params.mCaptionWidthId) : taskBounds.width();
+ outResult.mCaptionX = (outResult.mWidth - captionWidth) / 2;
startT.setWindowCrop(mCaptionContainerSurface, captionWidth, outResult.mCaptionHeight)
+ .setPosition(mCaptionContainerSurface, outResult.mCaptionX, 0 /* y */)
.setLayer(mCaptionContainerSurface, CAPTION_LAYER_Z_ORDER)
.show(mCaptionContainerSurface);
@@ -292,7 +295,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
mCaptionInsetsRect.set(taskBounds);
if (mIsCaptionVisible) {
mCaptionInsetsRect.bottom =
- mCaptionInsetsRect.top + outResult.mCaptionHeight + params.mCaptionY;
+ mCaptionInsetsRect.top + outResult.mCaptionHeight;
wct.addInsetsSource(mTaskInfo.token,
mOwner, 0 /* index */, WindowInsets.Type.captionBar(), mCaptionInsetsRect);
wct.addInsetsSource(mTaskInfo.token,
@@ -554,9 +557,6 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
int mCornerRadius;
- int mCaptionX;
- int mCaptionY;
-
Configuration mWindowDecorConfig;
boolean mApplyStartTransactionOnDraw;
@@ -570,9 +570,6 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
mCornerRadius = 0;
- mCaptionX = 0;
- mCaptionY = 0;
-
mApplyStartTransactionOnDraw = false;
mSetTaskPositionAndCrop = false;
mWindowDecorConfig = null;
@@ -581,6 +578,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
static class RelayoutResult<T extends View & TaskFocusStateConsumer> {
int mCaptionHeight;
+ int mCaptionX;
int mWidth;
int mHeight;
T mRootView;
@@ -589,6 +587,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
mWidth = 0;
mHeight = 0;
mCaptionHeight = 0;
+ mCaptionX = 0;
mRootView = null;
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeFocusedWindowDecorationViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeFocusedWindowDecorationViewHolder.kt
index 4930cb721336..5f77022a577d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeFocusedWindowDecorationViewHolder.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeFocusedWindowDecorationViewHolder.kt
@@ -5,6 +5,7 @@ import android.app.ActivityManager.RunningTaskInfo
import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
import android.content.res.ColorStateList
import android.graphics.Color
+import android.graphics.PointF
import android.view.View
import android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
import android.widget.ImageButton
@@ -35,9 +36,6 @@ internal class DesktopModeFocusedWindowDecorationViewHolder(
}
override fun bindData(taskInfo: RunningTaskInfo) {
- taskInfo.taskDescription?.statusBarColor?.let { captionColor ->
- captionView.setBackgroundColor(captionColor)
- }
captionHandle.imageTintList = ColorStateList.valueOf(getCaptionHandleBarColor(taskInfo))
}
@@ -49,6 +47,17 @@ internal class DesktopModeFocusedWindowDecorationViewHolder(
animateCaptionHandleAlpha(startValue = 0f, endValue = 1f)
}
+ /**
+ * Returns true if input point is in the caption's view.
+ * @param inputPoint the input point relative to the task in full "focus" (i.e. fullscreen).
+ */
+ fun pointInCaption(inputPoint: PointF, captionX: Int): Boolean {
+ return inputPoint.x >= captionX &&
+ inputPoint.x <= captionX + captionView.width &&
+ inputPoint.y >= 0 &&
+ inputPoint.y <= captionView.height
+ }
+
private fun getCaptionHandleBarColor(taskInfo: RunningTaskInfo): Int {
return if (shouldUseLightCaptionColors(taskInfo)) {
context.getColor(R.color.desktop_mode_caption_handle_bar_light)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt
index 690b4e4be122..81bc34c876b6 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt
@@ -17,9 +17,9 @@ internal abstract class DesktopModeWindowDecorationViewHolder(rootView: View) {
*/
abstract fun bindData(taskInfo: RunningTaskInfo)
- /** Callback when the handle menu is opened. */
- abstract fun onHandleMenuOpened()
+ /** Callback when the handle menu is opened. */
+ abstract fun onHandleMenuOpened()
- /** Callback when the handle menu is closed. */
- abstract fun onHandleMenuClosed()
+ /** Callback when the handle menu is closed. */
+ abstract fun onHandleMenuClosed()
}
diff --git a/libs/WindowManager/Shell/tests/flicker/pip/src/com/android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt b/libs/WindowManager/Shell/tests/flicker/pip/src/com/android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt
index 32f12592135d..143f7a726ed3 100644
--- a/libs/WindowManager/Shell/tests/flicker/pip/src/com/android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/pip/src/com/android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt
@@ -69,7 +69,7 @@ open class NetflixEnterPipTest(flicker: LegacyFlickerTest) : AppsEnterPipTransit
setup {
standardAppHelper.launchViaIntent(
wmHelper,
- NetflixAppHelper.getNetflixWatchVideoIntent("70184207"),
+ NetflixAppHelper.getNetflixWatchVideoIntent("81605060"),
ComponentNameMatcher(NetflixAppHelper.PACKAGE_NAME, NetflixAppHelper.WATCH_ACTIVITY)
)
standardAppHelper.waitForVideoPlaying()
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java
index 32a91461e40f..7b53f70a771c 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java
@@ -772,15 +772,13 @@ public class WindowDecorationTests extends ShellTestCase {
private WindowDecoration.AdditionalWindow addTestWindow() {
final Resources resources = mDecorWindowContext.getResources();
- int x = mRelayoutParams.mCaptionX;
- int y = mRelayoutParams.mCaptionY;
int width = loadDimensionPixelSize(resources, mCaptionMenuWidthId);
int height = loadDimensionPixelSize(resources, mRelayoutParams.mCaptionHeightId);
String name = "Test Window";
WindowDecoration.AdditionalWindow additionalWindow =
addWindow(R.layout.desktop_mode_window_decor_handle_menu, name,
- mMockSurfaceControlAddWindowT, mMockSurfaceSyncGroup, x, y,
- width, height);
+ mMockSurfaceControlAddWindowT, mMockSurfaceSyncGroup, 0 /* x */,
+ 0 /* y */, width, height);
return additionalWindow;
}
}
diff --git a/libs/hwui/utils/ForceDark.h b/libs/hwui/utils/ForceDark.h
index 28538c4b7a7b..ecfe41f39ecb 100644
--- a/libs/hwui/utils/ForceDark.h
+++ b/libs/hwui/utils/ForceDark.h
@@ -17,6 +17,8 @@
#ifndef FORCEDARKUTILS_H
#define FORCEDARKUTILS_H
+#include <stdint.h>
+
namespace android {
namespace uirenderer {
@@ -26,9 +28,9 @@ namespace uirenderer {
* This should stay in sync with the java @IntDef in
* frameworks/base/graphics/java/android/graphics/ForceDarkType.java
*/
-enum class ForceDarkType : __uint8_t { NONE = 0, FORCE_DARK = 1, FORCE_INVERT_COLOR_DARK = 2 };
+enum class ForceDarkType : uint8_t { NONE = 0, FORCE_DARK = 1, FORCE_INVERT_COLOR_DARK = 2 };
} /* namespace uirenderer */
} /* namespace android */
-#endif // FORCEDARKUTILS_H \ No newline at end of file
+#endif // FORCEDARKUTILS_H