am f8388885: Merge "Add new logging for system bar window state." into klp-dev
* commit 'f8388885e49a0a0fa71f9a90301bd90a349cb1dd':
Add new logging for system bar window state.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SystemBars.java b/packages/SystemUI/src/com/android/systemui/statusbar/SystemBars.java
index 05282fe..ecf7b35 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SystemBars.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SystemBars.java
@@ -22,6 +22,9 @@
import com.android.systemui.R;
import com.android.systemui.SystemUI;
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+
/**
* Ensure a single status bar service implementation is running at all times.
*
@@ -66,6 +69,13 @@
return 0;
}
+ @Override
+ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ if (mStatusBar != null) {
+ mStatusBar.dump(fd, pw, args);
+ }
+ }
+
private void createStatusBarFromConfig() {
if (DEBUG) Log.d(TAG, "createStatusBarFromConfig");
final String clsName = mContext.getString(R.string.config_statusBarComponent);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index fffb130..d7475f3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.phone;
+import static android.app.StatusBarManager.windowStateToString;
import static com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE;
import static com.android.systemui.statusbar.phone.BarTransitions.MODE_SEMI_TRANSPARENT;
import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSPARENT;
@@ -109,6 +110,7 @@
public static final boolean DEBUG_GESTURES = false;
public static final boolean DEBUG_CLINGS = false;
+ public static final boolean DEBUG_WINDOW_STATE = true;
public static final boolean ENABLE_NOTIFICATION_PANEL_CLING = false;
@@ -1844,7 +1846,7 @@
&& window == StatusBarManager.WINDOW_STATUS_BAR
&& mStatusBarWindowState != state) {
mStatusBarWindowState = state;
- if (DEBUG) Log.d(TAG, "Status bar " + StatusBarManager.windowStateToString(state));
+ if (DEBUG_WINDOW_STATE) Log.d(TAG, "Status bar " + windowStateToString(state));
mStatusBarWindow.setEnabled(showing);
if (!showing) {
mStatusBarView.collapseAllPanels(false);
@@ -1854,7 +1856,7 @@
&& window == StatusBarManager.WINDOW_NAVIGATION_BAR
&& mNavigationBarWindowState != state) {
mNavigationBarWindowState = state;
- if (DEBUG) Log.d(TAG, "Navigation bar " + StatusBarManager.windowStateToString(state));
+ if (DEBUG_WINDOW_STATE) Log.d(TAG, "Navigation bar " + windowStateToString(state));
mNavigationBarView.setEnabled(showing);
}
}
@@ -2177,6 +2179,15 @@
+ " scroll " + mScrollView.getScrollX() + "," + mScrollView.getScrollY());
}
+ pw.print(" mStatusBarWindowState=");
+ pw.println(windowStateToString(mStatusBarWindowState));
+ dumpBarTransitions(pw, "mStatusBarView", mStatusBarView.getBarTransitions());
+ if (mNavigationBarView != null) {
+ pw.print(" mNavigationBarWindowState=");
+ pw.println(windowStateToString(mNavigationBarWindowState));
+ dumpBarTransitions(pw, "mNavigationBarView", mNavigationBarView.getBarTransitions());
+ }
+
pw.print(" mNavigationBarView=");
if (mNavigationBarView == null) {
pw.println("null");
@@ -2242,6 +2253,11 @@
mNetworkController.dump(fd, pw, args);
}
+ private static void dumpBarTransitions(PrintWriter pw, String var, BarTransitions transitions) {
+ pw.print(" "); pw.print(var); pw.print(".BarTransitions.mMode=");
+ pw.println(BarTransitions.modeToString(transitions.getMode()));
+ }
+
@Override
public void createAndAddWindows() {
addStatusBarWindow();
diff --git a/policy/src/com/android/internal/policy/impl/BarController.java b/policy/src/com/android/internal/policy/impl/BarController.java
index 554fd1cc..01c53fe 100644
--- a/policy/src/com/android/internal/policy/impl/BarController.java
+++ b/policy/src/com/android/internal/policy/impl/BarController.java
@@ -33,7 +33,7 @@
* Controls state/behavior specific to a system bar window.
*/
public class BarController {
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = true;
private static final int TRANSIENT_BAR_NONE = 0;
private static final int TRANSIENT_BAR_SHOWING = 1;
@@ -126,6 +126,7 @@
private void updateState(final int state) {
if (state != mState) {
mState = state;
+ if (DEBUG) Slog.d(mTag, "mState: " + StatusBarManager.windowStateToString(state));
mHandler.post(new Runnable() {
@Override
public void run() {
@@ -135,6 +136,7 @@
statusbar.setWindowState(mStatusBarManagerId, state);
}
} catch (RemoteException e) {
+ if (DEBUG) Slog.w(mTag, "Error posting window state", e);
// re-acquire status bar service next time it is needed.
mStatusBarService = null;
}
@@ -204,7 +206,7 @@
mLastTransparent = SystemClock.uptimeMillis();
}
mTransientBarState = state;
- if (DEBUG) Slog.d(mTag, "New state: " + transientBarStateToString(state));
+ if (DEBUG) Slog.d(mTag, "mTransientBarState: " + transientBarStateToString(state));
}
}
@@ -227,8 +229,10 @@
public void dump(PrintWriter pw, String prefix) {
if (mWin != null) {
- pw.print(prefix); pw.print(mTag); pw.print(' ');
- pw.print("mTransientBar"); pw.print('=');
+ pw.print(prefix); pw.println(mTag);
+ pw.print(" "); pw.print("mState"); pw.print('=');
+ pw.println(StatusBarManager.windowStateToString(mState));
+ pw.print(" "); pw.print("mTransientBar"); pw.print('=');
pw.println(transientBarStateToString(mTransientBarState));
}
}