Skip to content

Commit 8f84765

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Fix bug 5386915 - Action mode is intercepting touches it shouldn't be"
2 parents bdb38c1 + e0b6cd1 commit 8f84765

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

core/java/android/widget/PopupWindow.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public class PopupWindow {
9292
private boolean mClipToScreen;
9393
private boolean mAllowScrollingAnchorParent = true;
9494
private boolean mLayoutInsetDecor = false;
95+
private boolean mNotTouchModal;
9596

9697
private OnTouchListener mTouchInterceptor;
9798

@@ -693,6 +694,15 @@ public int getWindowLayoutType() {
693694
return mWindowLayoutType;
694695
}
695696

697+
/**
698+
* Set whether this window is touch modal or if outside touches will be sent to
699+
* other windows behind it.
700+
* @hide
701+
*/
702+
public void setTouchModal(boolean touchModal) {
703+
mNotTouchModal = !touchModal;
704+
}
705+
696706
/**
697707
* <p>Change the width and height measure specs that are given to the
698708
* window manager by the popup. By default these are 0, meaning that
@@ -1048,6 +1058,9 @@ private int computeFlags(int curFlags) {
10481058
if (mLayoutInsetDecor) {
10491059
curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
10501060
}
1061+
if (mNotTouchModal) {
1062+
curFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
1063+
}
10511064
return curFlags;
10521065
}
10531066

policy/src/com/android/internal/policy/impl/PhoneWindow.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,6 +2154,8 @@ public ActionMode startActionMode(ActionMode.Callback callback) {
21542154
mActionModePopup.setLayoutInScreenEnabled(true);
21552155
mActionModePopup.setLayoutInsetDecor(true);
21562156
mActionModePopup.setFocusable(true);
2157+
mActionModePopup.setOutsideTouchable(false);
2158+
mActionModePopup.setTouchModal(false);
21572159
mActionModePopup.setWindowLayoutType(
21582160
WindowManager.LayoutParams.TYPE_APPLICATION);
21592161
mActionModePopup.setContentView(mActionModeView);

0 commit comments

Comments
 (0)