diff options
author | Daniel Sandler <dsandler@android.com> | 2011-12-01 12:41:57 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-01 12:41:57 -0800 |
commit | d884f5a14a1c481b33df050ee7e3671931bef07a (patch) | |
tree | 858be8ccde82782a7b4a59cf5f90b0f6d23c28d0 /packages | |
parent | 9b188ea2b74e749eef19fcb67feaca77e09f1cde (diff) | |
parent | 0c22fa749a779fd539c4c13f83364efc611c3694 (diff) | |
download | frameworks_base-d884f5a14a1c481b33df050ee7e3671931bef07a.zip frameworks_base-d884f5a14a1c481b33df050ee7e3671931bef07a.tar.gz frameworks_base-d884f5a14a1c481b33df050ee7e3671931bef07a.tar.bz2 |
am 0c22fa74: am b73dc9c8: Merge "Add copious navigation bar info to SystemUI dumps." into ics-mr1
* commit '0c22fa749a779fd539c4c13f83364efc611c3694':
Add copious navigation bar info to SystemUI dumps.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java | 80 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 13 |
2 files changed, 90 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 694da20..97a1855 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -20,6 +20,7 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.content.res.Resources; +import android.graphics.Rect; import android.os.ServiceManager; import android.util.AttributeSet; import android.util.Slog; @@ -32,6 +33,10 @@ import android.view.Surface; import android.view.WindowManager; import android.widget.LinearLayout; +import java.io.FileDescriptor; +import java.io.PrintWriter; +import java.lang.StringBuilder; + import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.R; @@ -237,4 +242,79 @@ public class NavigationBarView extends LinearLayout { Slog.d(TAG, "reorient(): rot=" + mDisplay.getRotation()); } } + + private String getResourceName(int resId) { + if (resId != 0) { + final android.content.res.Resources res = mContext.getResources(); + try { + return res.getResourceName(resId); + } catch (android.content.res.Resources.NotFoundException ex) { + return "(unknown)"; + } + } else { + return "(null)"; + } + } + + private static String visibilityToString(int vis) { + switch (vis) { + case View.INVISIBLE: + return "INVISIBLE"; + case View.GONE: + return "GONE"; + default: + return "VISIBLE"; + } + } + + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + pw.println("NavigationBarView {"); + final Rect r = new Rect(); + + pw.println(String.format(" this: " + PhoneStatusBar.viewInfo(this) + + " " + visibilityToString(getVisibility()))); + + getWindowVisibleDisplayFrame(r); + final boolean offscreen = r.right > mDisplay.getRawWidth() + || r.bottom > mDisplay.getRawHeight(); + pw.println(" window: " + + r.toShortString() + + " " + visibilityToString(getWindowVisibility()) + + (offscreen ? " OFFSCREEN!" : "")); + + pw.println(String.format(" mCurrentView: id=%s (%dx%d) %s", + getResourceName(mCurrentView.getId()), + mCurrentView.getWidth(), mCurrentView.getHeight(), + visibilityToString(mCurrentView.getVisibility()))); + + pw.println(String.format(" disabled=0x%08x vertical=%s hidden=%s low=%s menu=%s", + mDisabledFlags, + mVertical ? "true" : "false", + mHidden ? "true" : "false", + mLowProfile ? "true" : "false", + mShowMenu ? "true" : "false")); + + final View back = getBackButton(); + final View home = getHomeButton(); + final View recent = getRecentsButton(); + final View menu = getMenuButton(); + + pw.println(" back: " + + PhoneStatusBar.viewInfo(back) + + " " + visibilityToString(back.getVisibility()) + ); + pw.println(" home: " + + PhoneStatusBar.viewInfo(home) + + " " + visibilityToString(home.getVisibility()) + ); + pw.println(" rcnt: " + + PhoneStatusBar.viewInfo(recent) + + " " + visibilityToString(recent.getVisibility()) + ); + pw.println(" menu: " + + PhoneStatusBar.viewInfo(menu) + + " " + visibilityToString(menu.getVisibility()) + ); + pw.println(" }"); + } } 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 f0093d3..c69a145 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1735,9 +1735,9 @@ public class PhoneStatusBar extends StatusBar { return anim; } - public String viewInfo(View v) { - return "(" + v.getLeft() + "," + v.getTop() + ")(" + v.getRight() + "," + v.getBottom() - + " " + v.getWidth() + "x" + v.getHeight() + ")"; + public static String viewInfo(View v) { + return "[(" + v.getLeft() + "," + v.getTop() + ")(" + v.getRight() + "," + v.getBottom() + + ") " + v.getWidth() + "x" + v.getHeight() + "]"; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { @@ -1768,6 +1768,13 @@ public class PhoneStatusBar extends StatusBar { + " scroll " + mScrollView.getScrollX() + "," + mScrollView.getScrollY()); } + pw.print(" mNavigationBarView="); + if (mNavigationBarView == null) { + pw.println("null"); + } else { + mNavigationBarView.dump(fd, pw, args); + } + if (DUMPTRUCK) { synchronized (mNotificationData) { int N = mNotificationData.size(); |