Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +14 −0 Original line number Diff line number Diff line Loading @@ -777,6 +777,15 @@ public abstract class PanelView extends FrameLayout { public void setExpandedFraction(float frac) { setExpandedHeight(getMaxPanelHeight() * frac); if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mStatusBar.getBarState() == StatusBarState.KEYGUARD) { if (frac == 0.0f) { Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + Log.getStackTraceString(new Throwable())); } else if (frac == 1.0f) { mStatusBar.endWindowManagerLogging(); } } } public float getExpandedHeight() { Loading Loading @@ -808,6 +817,11 @@ public abstract class PanelView extends FrameLayout { } public void collapse(boolean delayed, float speedUpFactor) { if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mStatusBar.getBarState() == StatusBarState.KEYGUARD) { Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + Log.getStackTraceString(new Throwable())); } if (DEBUG) logf("collapse: " + this); if (mPeekPending || mPeekAnimator != null) { mCollapseAfterPeek = true; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +8 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, HeadsUpManager.OnHeadsUpChangedListener { static final String TAG = "PhoneStatusBar"; public static final boolean DEBUG = BaseStatusBar.DEBUG; public static final boolean DEBUG_EMPTY_KEYGUARD = true; public static final boolean SPEW = false; public static final boolean DUMPTRUCK = true; // extra dumpsys info public static final boolean DEBUG_GESTURES = false; Loading Loading @@ -2003,6 +2004,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStatusBarWindowManager.setPanelExpanded(isExpanded); } public void endWindowManagerLogging() { mStatusBarWindowManager.setLogState(false); } /** * All changes to the status bar and notifications funnel through here and are batched. */ Loading Loading @@ -3547,6 +3552,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // Make our window larger and the panel expanded. makeExpandedVisible(true); mNotificationPanel.instantExpand(); if (DEBUG_EMPTY_KEYGUARD) { mStatusBarWindowManager.setLogState(true); } } private void instantCollapseNotificationPanel() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +7 −1 Original line number Diff line number Diff line Loading @@ -20,12 +20,14 @@ import android.content.Context; import android.content.res.Resources; import android.util.AttributeSet; import android.util.EventLog; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityEvent; import com.android.systemui.EventLogTags; import com.android.systemui.R; import com.android.systemui.statusbar.StatusBarState; public class PhoneStatusBarView extends PanelBar { private static final String TAG = "PhoneStatusBarView"; Loading Loading @@ -108,7 +110,11 @@ public class PhoneStatusBarView extends PanelBar { @Override public void onAllPanelsCollapsed() { super.onAllPanelsCollapsed(); if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) { Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + Log.getStackTraceString(new Throwable())); } // Close the status bar in the next frame so we can show the end of the animation. postOnAnimation(new Runnable() { @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +55 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.pm.ActivityInfo; import android.content.res.Resources; import android.graphics.PixelFormat; import android.os.SystemProperties; import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; Loading @@ -31,6 +32,8 @@ import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.StatusBarState; import java.lang.reflect.Field; /** * Encapsulates all logic for the status bar window state management. */ Loading @@ -45,6 +48,7 @@ public class StatusBarWindowManager { private final boolean mKeyguardScreenRotation; private final State mCurrentState = new State(); private boolean mLogState; public StatusBarWindowManager(Context context) { mContext = context; Loading Loading @@ -129,9 +133,7 @@ public class StatusBarWindowManager { } private void applyHeight(State state) { boolean expanded = !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded() || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing || state.headsUpShowing); boolean expanded = isExpanded(state); if (expanded) { mLpChanged.height = ViewGroup.LayoutParams.MATCH_PARENT; } else { Loading @@ -139,6 +141,12 @@ public class StatusBarWindowManager { } } private boolean isExpanded(State state) { return !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded() || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing || state.headsUpShowing); } private void applyFitsSystemWindows(State state) { mStatusBarView.setFitsSystemWindows(!state.isKeyguardShowingAndNotOccluded()); } Loading Loading @@ -176,6 +184,9 @@ public class StatusBarWindowManager { applyFitsSystemWindows(state); applyModalFlag(state); if (mLp.copyFrom(mLpChanged) != 0) { if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mLogState) { logCurrentState(); } mWindowManager.updateViewLayout(mStatusBarView, mLp); } } Loading Loading @@ -272,6 +283,21 @@ public class StatusBarWindowManager { apply(mCurrentState); } public void setLogState(boolean logState) { mLogState = logState; if (logState) { Log.w(PhoneStatusBar.TAG, "===== Started logging WM state changes ====="); logCurrentState(); } else { Log.w(PhoneStatusBar.TAG, "===== Finished logging WM state changes ====="); } } private void logCurrentState() { Log.i(PhoneStatusBar.TAG, mCurrentState.toString() + "\n Expanded: " + isExpanded(mCurrentState)); } private static class State { boolean keyguardShowing; boolean keyguardOccluded; Loading @@ -294,5 +320,31 @@ public class StatusBarWindowManager { private boolean isKeyguardShowingAndNotOccluded() { return keyguardShowing && !keyguardOccluded; } @Override public String toString() { StringBuilder result = new StringBuilder(); String newLine = "\n"; result.append("Window State {"); result.append(newLine); Field[] fields = this.getClass().getDeclaredFields(); // Print field names paired with their values for (Field field : fields) { result.append(" "); try { result.append(field.getName()); result.append(": "); //requires access to private field: result.append(field.get(this)); } catch (IllegalAccessException ex) { } result.append(newLine); } result.append("}"); return result.toString(); } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +14 −0 Original line number Diff line number Diff line Loading @@ -777,6 +777,15 @@ public abstract class PanelView extends FrameLayout { public void setExpandedFraction(float frac) { setExpandedHeight(getMaxPanelHeight() * frac); if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mStatusBar.getBarState() == StatusBarState.KEYGUARD) { if (frac == 0.0f) { Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + Log.getStackTraceString(new Throwable())); } else if (frac == 1.0f) { mStatusBar.endWindowManagerLogging(); } } } public float getExpandedHeight() { Loading Loading @@ -808,6 +817,11 @@ public abstract class PanelView extends FrameLayout { } public void collapse(boolean delayed, float speedUpFactor) { if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mStatusBar.getBarState() == StatusBarState.KEYGUARD) { Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + Log.getStackTraceString(new Throwable())); } if (DEBUG) logf("collapse: " + this); if (mPeekPending || mPeekAnimator != null) { mCollapseAfterPeek = true; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +8 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, HeadsUpManager.OnHeadsUpChangedListener { static final String TAG = "PhoneStatusBar"; public static final boolean DEBUG = BaseStatusBar.DEBUG; public static final boolean DEBUG_EMPTY_KEYGUARD = true; public static final boolean SPEW = false; public static final boolean DUMPTRUCK = true; // extra dumpsys info public static final boolean DEBUG_GESTURES = false; Loading Loading @@ -2003,6 +2004,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStatusBarWindowManager.setPanelExpanded(isExpanded); } public void endWindowManagerLogging() { mStatusBarWindowManager.setLogState(false); } /** * All changes to the status bar and notifications funnel through here and are batched. */ Loading Loading @@ -3547,6 +3552,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // Make our window larger and the panel expanded. makeExpandedVisible(true); mNotificationPanel.instantExpand(); if (DEBUG_EMPTY_KEYGUARD) { mStatusBarWindowManager.setLogState(true); } } private void instantCollapseNotificationPanel() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +7 −1 Original line number Diff line number Diff line Loading @@ -20,12 +20,14 @@ import android.content.Context; import android.content.res.Resources; import android.util.AttributeSet; import android.util.EventLog; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityEvent; import com.android.systemui.EventLogTags; import com.android.systemui.R; import com.android.systemui.statusbar.StatusBarState; public class PhoneStatusBarView extends PanelBar { private static final String TAG = "PhoneStatusBarView"; Loading Loading @@ -108,7 +110,11 @@ public class PhoneStatusBarView extends PanelBar { @Override public void onAllPanelsCollapsed() { super.onAllPanelsCollapsed(); if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mBar.getBarState() == StatusBarState.KEYGUARD) { Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + Log.getStackTraceString(new Throwable())); } // Close the status bar in the next frame so we can show the end of the animation. postOnAnimation(new Runnable() { @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +55 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.pm.ActivityInfo; import android.content.res.Resources; import android.graphics.PixelFormat; import android.os.SystemProperties; import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; Loading @@ -31,6 +32,8 @@ import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.StatusBarState; import java.lang.reflect.Field; /** * Encapsulates all logic for the status bar window state management. */ Loading @@ -45,6 +48,7 @@ public class StatusBarWindowManager { private final boolean mKeyguardScreenRotation; private final State mCurrentState = new State(); private boolean mLogState; public StatusBarWindowManager(Context context) { mContext = context; Loading Loading @@ -129,9 +133,7 @@ public class StatusBarWindowManager { } private void applyHeight(State state) { boolean expanded = !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded() || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing || state.headsUpShowing); boolean expanded = isExpanded(state); if (expanded) { mLpChanged.height = ViewGroup.LayoutParams.MATCH_PARENT; } else { Loading @@ -139,6 +141,12 @@ public class StatusBarWindowManager { } } private boolean isExpanded(State state) { return !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded() || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing || state.headsUpShowing); } private void applyFitsSystemWindows(State state) { mStatusBarView.setFitsSystemWindows(!state.isKeyguardShowingAndNotOccluded()); } Loading Loading @@ -176,6 +184,9 @@ public class StatusBarWindowManager { applyFitsSystemWindows(state); applyModalFlag(state); if (mLp.copyFrom(mLpChanged) != 0) { if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mLogState) { logCurrentState(); } mWindowManager.updateViewLayout(mStatusBarView, mLp); } } Loading Loading @@ -272,6 +283,21 @@ public class StatusBarWindowManager { apply(mCurrentState); } public void setLogState(boolean logState) { mLogState = logState; if (logState) { Log.w(PhoneStatusBar.TAG, "===== Started logging WM state changes ====="); logCurrentState(); } else { Log.w(PhoneStatusBar.TAG, "===== Finished logging WM state changes ====="); } } private void logCurrentState() { Log.i(PhoneStatusBar.TAG, mCurrentState.toString() + "\n Expanded: " + isExpanded(mCurrentState)); } private static class State { boolean keyguardShowing; boolean keyguardOccluded; Loading @@ -294,5 +320,31 @@ public class StatusBarWindowManager { private boolean isKeyguardShowingAndNotOccluded() { return keyguardShowing && !keyguardOccluded; } @Override public String toString() { StringBuilder result = new StringBuilder(); String newLine = "\n"; result.append("Window State {"); result.append(newLine); Field[] fields = this.getClass().getDeclaredFields(); // Print field names paired with their values for (Field field : fields) { result.append(" "); try { result.append(field.getName()); result.append(": "); //requires access to private field: result.append(field.get(this)); } catch (IllegalAccessException ex) { } result.append(newLine); } result.append("}"); return result.toString(); } } }