Loading libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleStackViewTest.kt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -456,5 +456,7 @@ class BubbleStackViewTest { override fun isStackExpanded(): Boolean = false override fun isStackExpanded(): Boolean = false override fun isShowingAsBubbleBar(): Boolean = false override fun isShowingAsBubbleBar(): Boolean = false override fun hideCurrentInputMethod() {} } } } } libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -592,11 +592,12 @@ public class BubbleController implements ConfigurationChangeListener, * Hides the current input method, wherever it may be focused, via InputMethodManagerInternal. * Hides the current input method, wherever it may be focused, via InputMethodManagerInternal. */ */ void hideCurrentInputMethod() { void hideCurrentInputMethod() { mBubblePositioner.setImeVisible(false /* visible */, 0 /* height */); int displayId = mWindowManager.getDefaultDisplay().getDisplayId(); int displayId = mWindowManager.getDefaultDisplay().getDisplayId(); try { try { mBarService.hideCurrentInputMethodForBubbles(displayId); mBarService.hideCurrentInputMethodForBubbles(displayId); } catch (RemoteException e) { } catch (RemoteException e) { e.printStackTrace(); Log.e(TAG, "Failed to hide IME", e); } } } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedViewManager.kt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ interface BubbleExpandedViewManager { fun setAppBubbleTaskId(key: String, taskId: Int) fun setAppBubbleTaskId(key: String, taskId: Int) fun isStackExpanded(): Boolean fun isStackExpanded(): Boolean fun isShowingAsBubbleBar(): Boolean fun isShowingAsBubbleBar(): Boolean fun hideCurrentInputMethod() companion object { companion object { /** /** Loading Loading @@ -73,6 +74,10 @@ interface BubbleExpandedViewManager { override fun isStackExpanded(): Boolean = controller.isStackExpanded override fun isStackExpanded(): Boolean = controller.isStackExpanded override fun isShowingAsBubbleBar(): Boolean = controller.isShowingAsBubbleBar override fun isShowingAsBubbleBar(): Boolean = controller.isShowingAsBubbleBar override fun hideCurrentInputMethod() { controller.hideCurrentInputMethod() } } } } } } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -2324,7 +2324,6 @@ public class BubbleStackView extends FrameLayout * not. * not. */ */ void hideCurrentInputMethod() { void hideCurrentInputMethod() { mPositioner.setImeVisible(false, 0); mManager.hideCurrentInputMethod(); mManager.hideCurrentInputMethod(); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java +20 −6 Original line number Original line Diff line number Diff line Loading @@ -82,6 +82,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView private static final int INVALID_TASK_ID = -1; private static final int INVALID_TASK_ID = -1; private BubbleExpandedViewManager mManager; private BubbleExpandedViewManager mManager; private BubblePositioner mPositioner; private boolean mIsOverflow; private boolean mIsOverflow; private BubbleTaskViewHelper mBubbleTaskViewHelper; private BubbleTaskViewHelper mBubbleTaskViewHelper; private BubbleBarMenuViewController mMenuViewController; private BubbleBarMenuViewController mMenuViewController; Loading Loading @@ -160,6 +161,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView boolean isOverflow, boolean isOverflow, @Nullable BubbleTaskView bubbleTaskView) { @Nullable BubbleTaskView bubbleTaskView) { mManager = expandedViewManager; mManager = expandedViewManager; mPositioner = positioner; mIsOverflow = isOverflow; mIsOverflow = isOverflow; if (mIsOverflow) { if (mIsOverflow) { Loading Loading @@ -290,15 +292,27 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView } } /** /** * Hides the current modal menu view or collapses the bubble stack. * Hides the current modal menu if it is visible * Called from {@link BubbleBarLayerView} * @return {@code true} if menu was visible and is hidden */ */ public void hideMenuOrCollapse() { public boolean hideMenuIfVisible() { if (mMenuViewController.isMenuVisible()) { if (mMenuViewController.isMenuVisible()) { mMenuViewController.hideMenu(/* animated = */ true); mMenuViewController.hideMenu(true /* animated */); } else { return true; mManager.collapseStack(); } return false; } /** * Hides the IME if it is visible * @return {@code true} if IME was visible */ public boolean hideImeIfVisible() { if (mPositioner.isImeVisible()) { mManager.hideCurrentInputMethod(); return true; } } return false; } } /** Updates the bubble shown in the expanded view. */ /** Updates the bubble shown in the expanded view. */ Loading Loading
libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleStackViewTest.kt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -456,5 +456,7 @@ class BubbleStackViewTest { override fun isStackExpanded(): Boolean = false override fun isStackExpanded(): Boolean = false override fun isShowingAsBubbleBar(): Boolean = false override fun isShowingAsBubbleBar(): Boolean = false override fun hideCurrentInputMethod() {} } } } }
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -592,11 +592,12 @@ public class BubbleController implements ConfigurationChangeListener, * Hides the current input method, wherever it may be focused, via InputMethodManagerInternal. * Hides the current input method, wherever it may be focused, via InputMethodManagerInternal. */ */ void hideCurrentInputMethod() { void hideCurrentInputMethod() { mBubblePositioner.setImeVisible(false /* visible */, 0 /* height */); int displayId = mWindowManager.getDefaultDisplay().getDisplayId(); int displayId = mWindowManager.getDefaultDisplay().getDisplayId(); try { try { mBarService.hideCurrentInputMethodForBubbles(displayId); mBarService.hideCurrentInputMethodForBubbles(displayId); } catch (RemoteException e) { } catch (RemoteException e) { e.printStackTrace(); Log.e(TAG, "Failed to hide IME", e); } } } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedViewManager.kt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ interface BubbleExpandedViewManager { fun setAppBubbleTaskId(key: String, taskId: Int) fun setAppBubbleTaskId(key: String, taskId: Int) fun isStackExpanded(): Boolean fun isStackExpanded(): Boolean fun isShowingAsBubbleBar(): Boolean fun isShowingAsBubbleBar(): Boolean fun hideCurrentInputMethod() companion object { companion object { /** /** Loading Loading @@ -73,6 +74,10 @@ interface BubbleExpandedViewManager { override fun isStackExpanded(): Boolean = controller.isStackExpanded override fun isStackExpanded(): Boolean = controller.isStackExpanded override fun isShowingAsBubbleBar(): Boolean = controller.isShowingAsBubbleBar override fun isShowingAsBubbleBar(): Boolean = controller.isShowingAsBubbleBar override fun hideCurrentInputMethod() { controller.hideCurrentInputMethod() } } } } } } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -2324,7 +2324,6 @@ public class BubbleStackView extends FrameLayout * not. * not. */ */ void hideCurrentInputMethod() { void hideCurrentInputMethod() { mPositioner.setImeVisible(false, 0); mManager.hideCurrentInputMethod(); mManager.hideCurrentInputMethod(); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java +20 −6 Original line number Original line Diff line number Diff line Loading @@ -82,6 +82,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView private static final int INVALID_TASK_ID = -1; private static final int INVALID_TASK_ID = -1; private BubbleExpandedViewManager mManager; private BubbleExpandedViewManager mManager; private BubblePositioner mPositioner; private boolean mIsOverflow; private boolean mIsOverflow; private BubbleTaskViewHelper mBubbleTaskViewHelper; private BubbleTaskViewHelper mBubbleTaskViewHelper; private BubbleBarMenuViewController mMenuViewController; private BubbleBarMenuViewController mMenuViewController; Loading Loading @@ -160,6 +161,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView boolean isOverflow, boolean isOverflow, @Nullable BubbleTaskView bubbleTaskView) { @Nullable BubbleTaskView bubbleTaskView) { mManager = expandedViewManager; mManager = expandedViewManager; mPositioner = positioner; mIsOverflow = isOverflow; mIsOverflow = isOverflow; if (mIsOverflow) { if (mIsOverflow) { Loading Loading @@ -290,15 +292,27 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView } } /** /** * Hides the current modal menu view or collapses the bubble stack. * Hides the current modal menu if it is visible * Called from {@link BubbleBarLayerView} * @return {@code true} if menu was visible and is hidden */ */ public void hideMenuOrCollapse() { public boolean hideMenuIfVisible() { if (mMenuViewController.isMenuVisible()) { if (mMenuViewController.isMenuVisible()) { mMenuViewController.hideMenu(/* animated = */ true); mMenuViewController.hideMenu(true /* animated */); } else { return true; mManager.collapseStack(); } return false; } /** * Hides the IME if it is visible * @return {@code true} if IME was visible */ public boolean hideImeIfVisible() { if (mPositioner.isImeVisible()) { mManager.hideCurrentInputMethod(); return true; } } return false; } } /** Updates the bubble shown in the expanded view. */ /** Updates the bubble shown in the expanded view. */ Loading