diff options
Diffstat (limited to 'packages/SystemUI')
7 files changed, 26 insertions, 68 deletions
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index d32ce55..fcf7e3e 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -276,19 +276,6 @@ <!-- Content description of the data signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_data_signal_full">Data signal full.</string> - <!-- Content description of the WIFI signal when WIFI is disabled for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_off">Wifi off.</string> - <!-- Content description of the WIFI signal when no signal for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_no_wifi">Wifi disconnected.</string> - <!-- Content description of the WIFI signal when it is one bar for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_one_bar">Wifi one bar.</string> - <!-- Content description of the WIFI signal when it is two bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_two_bars">Wifi two bars.</string> - <!-- Content description of the WIFI signal when it is three bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_three_bars">Wifi three bars.</string> - <!-- Content description of the WIFI signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_signal_full">Wifi signal full.</string> - <!-- Content description of the wifi label showing what we are connected to. [CHAR LIMIT=NONE] --> <string name="accessibility_wifi_name">Connected to <xliff:g id="wifi" example="Home Network">%s</xliff:g>.</string> diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index 2ded919..94d5170 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -158,6 +158,9 @@ public class QSPanel extends ViewGroup { mColumns = columns; postInvalidate(); } + for (TileRecord r : mRecords) { + r.tile.clearState(); + } if (mListening) { refreshAllTiles(); } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java index 38fade2..b330582 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java @@ -61,8 +61,8 @@ public abstract class QSTile<TState extends State> implements Listenable { protected final Handler mUiHandler = new Handler(Looper.getMainLooper()); private Callback mCallback; - protected final TState mState = newTileState(); - private final TState mTmpState = newTileState(); + protected TState mState = newTileState(); + private TState mTmpState = newTileState(); private boolean mAnnounceNextStateChange; abstract protected TState newTileState(); @@ -139,6 +139,10 @@ public abstract class QSTile<TState extends State> implements Listenable { mHandler.obtainMessage(H.REFRESH_STATE, arg).sendToTarget(); } + public final void clearState() { + mHandler.sendEmptyMessage(H.CLEAR_STATE); + } + public void userSwitch(int newUserId) { mHandler.obtainMessage(H.USER_SWITCH, newUserId, 0).sendToTarget(); } @@ -178,6 +182,11 @@ public abstract class QSTile<TState extends State> implements Listenable { // optional } + protected void handleClearState() { + mTmpState = newTileState(); + mState = newTileState(); + } + protected void handleRefreshState(Object arg) { handleUpdateState(mTmpState, arg); final boolean changed = mTmpState.copyTo(mState); @@ -246,6 +255,7 @@ public abstract class QSTile<TState extends State> implements Listenable { private static final int TOGGLE_STATE_CHANGED = 8; private static final int SCAN_STATE_CHANGED = 9; private static final int DESTROY = 10; + private static final int CLEAR_STATE = 11; private H(Looper looper) { super(looper); @@ -286,6 +296,9 @@ public abstract class QSTile<TState extends State> implements Listenable { } else if (msg.what == DESTROY) { name = "handleDestroy"; handleDestroy(); + } else if (msg.what == CLEAR_STATE) { + name = "handleClearState"; + handleClearState(); } else { throw new IllegalArgumentException("Unknown msg: " + msg.what); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 9343172..889160d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -658,11 +658,6 @@ public abstract class PanelView extends FrameLayout { (animator.getDuration() * getCannedFlingDurationFactor() / collapseSpeedUpFactor)); } - if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD - && mStatusBar.getBarState() == StatusBarState.KEYGUARD) { - Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " - + Log.getStackTraceString(new Throwable())); - } } animator.addListener(new AnimatorListenerAdapter() { private boolean mCancelled; @@ -777,15 +772,6 @@ 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() { @@ -817,11 +803,6 @@ 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; 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 f0e50f8..88aa071 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -185,7 +185,6 @@ 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; @@ -2009,10 +2008,6 @@ 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. */ @@ -2675,7 +2670,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, pw.print(" status bar gestures: "); mGestureRec.dump(fd, pw, args); } - + if (mStatusBarWindowManager != null) { + mStatusBarWindowManager.dump(fd, pw, args); + } if (mNetworkController != null) { mNetworkController.dump(fd, pw, args); } @@ -3592,9 +3589,6 @@ 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() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 6a46924..6d04b28 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -20,14 +20,12 @@ 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"; @@ -118,11 +116,6 @@ 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(mHideExpandedRunnable); mLastFullyOpenedPanel = null; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java index 0d816dd..038fefb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -21,7 +21,6 @@ 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; @@ -32,6 +31,8 @@ import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.StatusBarState; +import java.io.FileDescriptor; +import java.io.PrintWriter; import java.lang.reflect.Field; /** @@ -48,7 +49,6 @@ public class StatusBarWindowManager { private final boolean mKeyguardScreenRotation; private final State mCurrentState = new State(); - private boolean mLogState; public StatusBarWindowManager(Context context) { mContext = context; @@ -183,9 +183,6 @@ public class StatusBarWindowManager { applyFitsSystemWindows(state); applyModalFlag(state); if (mLp.copyFrom(mLpChanged) != 0) { - if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mLogState) { - logCurrentState(); - } mWindowManager.updateViewLayout(mStatusBarView, mLp); } } @@ -282,19 +279,9 @@ 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)); + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + pw.println("StatusBarWindowManager state:"); + pw.println(mCurrentState); } private static class State { |