Skip to content

Commit 25bb8ee

Browse files
committed
Turn off deadzone flash, replacing it with logcat.
Change-Id: I30db97e5c3a6ef3a06e6065ccf087a7f6d1f9286
1 parent fef288b commit 25bb8ee

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

packages/SystemUI/res/values/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,7 @@
7676
<!-- decay duration (from size_max -> size), in ms -->
7777
<integer name="navigation_bar_deadzone_hold">333</integer>
7878
<integer name="navigation_bar_deadzone_decay">333</integer>
79+
80+
<bool name="config_dead_zone_flash">false</bool>
7981
</resources>
8082

packages/SystemUI/src/com/android/systemui/statusbar/policy/DeadZone.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class DeadZone extends View {
3535
public static final int HORIZONTAL = 0;
3636
public static final int VERTICAL = 1;
3737

38+
private static final boolean CHATTY = true; // print to logcat when we eat a click
39+
3840
private boolean mShouldFlash;
3941
private float mFlashFrac = 0f;
4042

@@ -76,7 +78,7 @@ public DeadZone(Context context, AttributeSet attrs, int defStyle) {
7678
Slog.v(TAG, this + " size=[" + mSizeMin + "-" + mSizeMax + "] hold=" + mHold
7779
+ (mVertical ? " vertical" : " horizontal"));
7880

79-
setFlashOnTouchCapture(true);
81+
setFlashOnTouchCapture(context.getResources().getBoolean(R.bool.config_dead_zone_flash));
8082
}
8183

8284
static float lerp(float a, float b, float f) {
@@ -100,27 +102,30 @@ public void setFlashOnTouchCapture(boolean dbg) {
100102
postInvalidate();
101103
}
102104

103-
// I made you a touch event
105+
// I made you a touch event...
104106
@Override
105107
public boolean onTouchEvent(MotionEvent event) {
106-
if (DEBUG)
108+
if (DEBUG) {
107109
Slog.v(TAG, this + " onTouch: " + MotionEvent.actionToString(event.getAction()));
110+
}
108111

109112
final int action = event.getAction();
110113
if (action == MotionEvent.ACTION_OUTSIDE) {
111114
poke(event);
112115
} else if (action == MotionEvent.ACTION_DOWN) {
113-
if (DEBUG)
116+
if (DEBUG) {
114117
Slog.v(TAG, this + " ACTION_DOWN: " + event.getX() + "," + event.getY());
118+
}
115119
int size = (int) getSize(event.getEventTime());
116120
if ((mVertical && event.getX() < size) || event.getY() < size) {
117-
if (DEBUG)
118-
Slog.v(TAG, "eating click!");
121+
if (CHATTY) {
122+
Slog.v(TAG, "consuming errant click: (" + event.getX() + "," + event.getY() + ")");
123+
}
119124
if (mShouldFlash) {
120125
post(mDebugFlash);
121126
postInvalidate();
122127
}
123-
return true; // but I eated it
128+
return true; // ...but I eated it
124129
}
125130
}
126131
return false;

0 commit comments

Comments
 (0)