Skip to content

Commit 151f00d

Browse files
committed
Disable statusbar pulldown gesture tracking.
Bug: 7164602 Change-Id: Ie6569a7a8a9f462e844ef3088098c3256653f630
1 parent c2a2816 commit 151f00d

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.view.View;
2525

2626
import com.android.systemui.R;
27+
import com.android.systemui.statusbar.GestureRecorder;
2728

2829
public class NotificationPanelView extends PanelView {
2930

@@ -47,9 +48,12 @@ protected void onFinishInflate() {
4748

4849
@Override
4950
public void fling(float vel, boolean always) {
50-
((PhoneStatusBarView) mBar).mBar.getGestureRecorder().tag(
51-
"fling " + ((vel > 0) ? "open" : "closed"),
52-
"notifications,v=" + vel);
51+
GestureRecorder gr = ((PhoneStatusBarView) mBar).mBar.getGestureRecorder();
52+
if (gr != null) {
53+
gr.tag(
54+
"fling " + ((vel > 0) ? "open" : "closed"),
55+
"notifications,v=" + vel);
56+
}
5357
super.fling(vel, always);
5458
}
5559

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public class PhoneStatusBar extends BaseStatusBar {
9999
public static final boolean DEBUG = BaseStatusBar.DEBUG;
100100
public static final boolean SPEW = DEBUG;
101101
public static final boolean DUMPTRUCK = true; // extra dumpsys info
102+
public static final boolean DEBUG_GESTURES = false;
102103

103104
// additional instrumentation for testing purposes; intended to be left on during development
104105
public static final boolean CHATTY = DEBUG;
@@ -247,7 +248,9 @@ public class PhoneStatusBar extends BaseStatusBar {
247248
DisplayMetrics mDisplayMetrics = new DisplayMetrics();
248249

249250
// XXX: gesture research
250-
private GestureRecorder mGestureRec = new GestureRecorder("/sdcard/statusbar_gestures.dat");
251+
private final GestureRecorder mGestureRec = DEBUG_GESTURES
252+
? new GestureRecorder("/sdcard/statusbar_gestures.dat")
253+
: null;
251254

252255
private int mNavigationIconHints = 0;
253256
private final Animator.AnimatorListener mMakeIconsInvisible = new AnimatorListenerAdapter() {
@@ -1350,7 +1353,9 @@ boolean interceptTouchEvent(MotionEvent event) {
13501353
}
13511354
}
13521355

1353-
mGestureRec.add(event);
1356+
if (DEBUG_GESTURES) {
1357+
mGestureRec.add(event);
1358+
}
13541359

13551360
return false;
13561361
}
@@ -1630,8 +1635,10 @@ public void run() {
16301635
}
16311636
}
16321637

1633-
pw.print(" status bar gestures: ");
1634-
mGestureRec.dump(fd, pw, args);
1638+
if (DEBUG_GESTURES) {
1639+
pw.print(" status bar gestures: ");
1640+
mGestureRec.dump(fd, pw, args);
1641+
}
16351642

16361643
mNetworkController.dump(fd, pw, args);
16371644
}
@@ -1713,8 +1720,10 @@ public void updateExpandedViewPos(int thingy) {
17131720
// called by makeStatusbar and also by PhoneStatusBarView
17141721
void updateDisplaySize() {
17151722
mDisplay.getMetrics(mDisplayMetrics);
1716-
mGestureRec.tag("display",
1717-
String.format("%dx%d", mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels));
1723+
if (DEBUG_GESTURES) {
1724+
mGestureRec.tag("display",
1725+
String.format("%dx%d", mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels));
1726+
}
17181727
}
17191728

17201729
private View.OnClickListener mClearButtonListener = new View.OnClickListener() {

packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
import com.android.systemui.R;
3131
import com.android.systemui.statusbar.BaseStatusBar;
32+
import com.android.systemui.statusbar.GestureRecorder;
3233
import com.android.systemui.statusbar.policy.BatteryController;
3334
import com.android.systemui.statusbar.policy.BluetoothController;
3435
import com.android.systemui.statusbar.policy.LocationController;
@@ -95,9 +96,12 @@ void updateResources() {
9596

9697
@Override
9798
public void fling(float vel, boolean always) {
98-
((PhoneStatusBarView) mBar).mBar.getGestureRecorder().tag(
99-
"fling " + ((vel > 0) ? "open" : "closed"),
100-
"settings,v=" + vel);
99+
GestureRecorder gr = ((PhoneStatusBarView) mBar).mBar.getGestureRecorder();
100+
if (gr != null) {
101+
gr.tag(
102+
"fling " + ((vel > 0) ? "open" : "closed"),
103+
"settings,v=" + vel);
104+
}
101105
super.fling(vel, always);
102106
}
103107

0 commit comments

Comments
 (0)