diff options
author | Adrian Roos <roosa@google.com> | 2014-09-02 23:34:10 +0200 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-09-02 23:38:59 +0200 |
commit | 9dc3209913cf3bcb6b46b6481321a054667be9a3 (patch) | |
tree | c56da6db470c8252a23412e48d7a7adb185197b3 /packages/SystemUI/src | |
parent | ce5474b837a96d422cda291ed23e5f062d38faa1 (diff) | |
download | frameworks_base-9dc3209913cf3bcb6b46b6481321a054667be9a3.zip frameworks_base-9dc3209913cf3bcb6b46b6481321a054667be9a3.tar.gz frameworks_base-9dc3209913cf3bcb6b46b6481321a054667be9a3.tar.bz2 |
Disable touch dispatch while adjusting brightness
Prevents new pointers from being added while the shade
is transparent so that nothing gets touched by accident.
Bug: 17113634
Change-Id: I4a607d08dbccd467280159060846edd32db9c512
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index e1fd779..1811d8d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -42,6 +42,7 @@ public class StatusBarWindowView extends FrameLayout { private DragDownHelper mDragDownHelper; private NotificationStackScrollLayout mStackScrollLayout; private NotificationPanelView mNotificationPanel; + private View mBrightnessMirror; PhoneStatusBar mService; @@ -72,6 +73,7 @@ public class StatusBarWindowView extends FrameLayout { R.id.notification_stack_scroller); mNotificationPanel = (NotificationPanelView) findViewById(R.id.notification_panel); mDragDownHelper = new DragDownHelper(getContext(), this, mStackScrollLayout, mService); + mBrightnessMirror = findViewById(R.id.brightness_mirror); // We really need to be able to animate while window animations are going on // so that activities may be started asynchronously from panel animations @@ -106,6 +108,19 @@ public class StatusBarWindowView extends FrameLayout { } @Override + public boolean dispatchTouchEvent(MotionEvent ev) { + if (mBrightnessMirror != null && mBrightnessMirror.getVisibility() == VISIBLE) { + // Disallow new pointers while the brightness mirror is visible. This is so that you + // can't touch anything other than the brightness slider while the mirror is showing + // and the rest of the panel is transparent. + if (ev.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) { + return false; + } + } + return super.dispatchTouchEvent(ev); + } + + @Override public boolean onInterceptTouchEvent(MotionEvent ev) { boolean intercept = false; if (mNotificationPanel.isFullyExpanded() |