Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ package android.app { ctor public ActivityView(android.content.Context, android.util.AttributeSet); ctor public ActivityView(android.content.Context, android.util.AttributeSet, int); ctor public ActivityView(android.content.Context, android.util.AttributeSet, int, boolean); method public int getVirtualDisplayId(); method public void onLayout(boolean, int, int, int, int); method public void onLocationChanged(); method public void performBackPress(); Loading core/java/android/app/ActivityView.java +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC; import static android.view.Display.INVALID_DISPLAY; import android.annotation.NonNull; import android.annotation.TestApi; Loading Loading @@ -376,6 +377,16 @@ public class ActivityView extends ViewGroup { mSurfaceView.setVisibility(visibility); } /** * @return the display id of the virtual display. */ public int getVirtualDisplayId() { if (mVirtualDisplay != null) { return mVirtualDisplay.getDisplay().getDisplayId(); } return INVALID_DISPLAY; } /** * Injects a pair of down/up key events with keycode {@link KeyEvent#KEYCODE_BACK} to the * virtual display. Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.bubbles; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.View.INVISIBLE; import static android.view.View.VISIBLE; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; Loading Loading @@ -535,6 +537,21 @@ public class BubbleController implements ConfigurationController.ConfigurationLi return mTempRect; } /** * The display id of the expanded view, if the stack is expanded and not occluded by the * status bar, otherwise returns {@link Display#INVALID_DISPLAY}. */ public int getExpandedDisplayId(Context context) { boolean defaultDisplay = context.getDisplay() != null && context.getDisplay().getDisplayId() == DEFAULT_DISPLAY; Bubble b = mStackView.getExpandedBubble(); if (defaultDisplay && b != null && isStackExpanded() && !mStatusBarWindowController.getPanelExpanded()) { return b.expandedView.getVirtualDisplayId(); } return INVALID_DISPLAY; } @VisibleForTesting BubbleStackView getStackView() { return mStackView; Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.content.pm.ActivityInfo.DOCUMENT_LAUNCH_ALWAYS; import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_MISSING; import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_NOT_RESIZABLE; import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__DOCUMENT_LAUNCH_NOT_ALWAYS; import static android.view.Display.INVALID_DISPLAY; import android.animation.LayoutTransition; import android.animation.ObjectAnimator; Loading Loading @@ -598,6 +599,16 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList return mBubbleIntent != null && mActivityView != null; } /** * @return the display id of the virtual display. */ public int getVirtualDisplayId() { if (usingActivityView()) { return mActivityView.getVirtualDisplayId(); } return INVALID_DISPLAY; } private void applyRowState(ExpandableNotificationRow view) { view.reset(); view.setHeadsUp(false); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package com.android.systemui.statusbar.phone; import static android.view.Display.INVALID_DISPLAY; import android.content.Context; import android.content.pm.ParceledListSlice; import android.content.res.Resources; Loading Loading @@ -46,7 +48,9 @@ import android.view.ViewConfiguration; import android.view.WindowManager; import android.view.WindowManagerGlobal; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.bubbles.BubbleController; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver; import com.android.systemui.shared.system.QuickStepContract; Loading Loading @@ -363,6 +367,13 @@ public class EdgeBackGestureHandler implements DisplayListener { 0 /* metaState */, KeyCharacterMap.VIRTUAL_KEYBOARD, 0 /* scancode */, KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY, InputDevice.SOURCE_KEYBOARD); // Bubble controller will give us a valid display id if it should get the back event BubbleController bubbleController = Dependency.get(BubbleController.class); int bubbleDisplayId = bubbleController.getExpandedDisplayId(mContext); if (code == KeyEvent.KEYCODE_BACK && bubbleDisplayId != INVALID_DISPLAY) { ev.setDisplayId(bubbleDisplayId); } InputManager.getInstance().injectInputEvent(ev, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC); } } Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ package android.app { ctor public ActivityView(android.content.Context, android.util.AttributeSet); ctor public ActivityView(android.content.Context, android.util.AttributeSet, int); ctor public ActivityView(android.content.Context, android.util.AttributeSet, int, boolean); method public int getVirtualDisplayId(); method public void onLayout(boolean, int, int, int, int); method public void onLocationChanged(); method public void performBackPress(); Loading
core/java/android/app/ActivityView.java +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC; import static android.view.Display.INVALID_DISPLAY; import android.annotation.NonNull; import android.annotation.TestApi; Loading Loading @@ -376,6 +377,16 @@ public class ActivityView extends ViewGroup { mSurfaceView.setVisibility(visibility); } /** * @return the display id of the virtual display. */ public int getVirtualDisplayId() { if (mVirtualDisplay != null) { return mVirtualDisplay.getDisplay().getDisplayId(); } return INVALID_DISPLAY; } /** * Injects a pair of down/up key events with keycode {@link KeyEvent#KEYCODE_BACK} to the * virtual display. Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.bubbles; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.View.INVISIBLE; import static android.view.View.VISIBLE; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; Loading Loading @@ -535,6 +537,21 @@ public class BubbleController implements ConfigurationController.ConfigurationLi return mTempRect; } /** * The display id of the expanded view, if the stack is expanded and not occluded by the * status bar, otherwise returns {@link Display#INVALID_DISPLAY}. */ public int getExpandedDisplayId(Context context) { boolean defaultDisplay = context.getDisplay() != null && context.getDisplay().getDisplayId() == DEFAULT_DISPLAY; Bubble b = mStackView.getExpandedBubble(); if (defaultDisplay && b != null && isStackExpanded() && !mStatusBarWindowController.getPanelExpanded()) { return b.expandedView.getVirtualDisplayId(); } return INVALID_DISPLAY; } @VisibleForTesting BubbleStackView getStackView() { return mStackView; Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.content.pm.ActivityInfo.DOCUMENT_LAUNCH_ALWAYS; import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_MISSING; import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_NOT_RESIZABLE; import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__DOCUMENT_LAUNCH_NOT_ALWAYS; import static android.view.Display.INVALID_DISPLAY; import android.animation.LayoutTransition; import android.animation.ObjectAnimator; Loading Loading @@ -598,6 +599,16 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList return mBubbleIntent != null && mActivityView != null; } /** * @return the display id of the virtual display. */ public int getVirtualDisplayId() { if (usingActivityView()) { return mActivityView.getVirtualDisplayId(); } return INVALID_DISPLAY; } private void applyRowState(ExpandableNotificationRow view) { view.reset(); view.setHeadsUp(false); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package com.android.systemui.statusbar.phone; import static android.view.Display.INVALID_DISPLAY; import android.content.Context; import android.content.pm.ParceledListSlice; import android.content.res.Resources; Loading Loading @@ -46,7 +48,9 @@ import android.view.ViewConfiguration; import android.view.WindowManager; import android.view.WindowManagerGlobal; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.bubbles.BubbleController; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver; import com.android.systemui.shared.system.QuickStepContract; Loading Loading @@ -363,6 +367,13 @@ public class EdgeBackGestureHandler implements DisplayListener { 0 /* metaState */, KeyCharacterMap.VIRTUAL_KEYBOARD, 0 /* scancode */, KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY, InputDevice.SOURCE_KEYBOARD); // Bubble controller will give us a valid display id if it should get the back event BubbleController bubbleController = Dependency.get(BubbleController.class); int bubbleDisplayId = bubbleController.getExpandedDisplayId(mContext); if (code == KeyEvent.KEYCODE_BACK && bubbleDisplayId != INVALID_DISPLAY) { ev.setDisplayId(bubbleDisplayId); } InputManager.getInstance().injectInputEvent(ev, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC); } }