diff options
| author | 2015-04-20 16:38:51 -0400 | |
|---|---|---|
| committer | 2015-04-20 16:38:51 -0400 | |
| commit | 0d6a1c445c98f67b4fd314b58d703ec1c28e5658 (patch) | |
| tree | e249aaedf68b69417efeda132137004a999c7cd7 | |
| parent | ca02bc7cebabcf347bde98a45cce41c7d1ab26ee (diff) | |
SysUI: Stop wifi scanning so much
Seems that QS to end up in a listening state while the phone is sleeping
so switch scanning to only happen while the detail panel is showing.
Bug: 20137092
Change-Id: Ib067531c8af75f9f93b10e087b6fc252b5e508fa
3 files changed, 13 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index f4fd6a297a73..b5c1ca893686 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -338,6 +338,7 @@ public class QSPanel extends ViewGroup { r.detailAdapter = r.tile.getDetailAdapter(); if (r.detailAdapter == null) return; } + r.tile.setDetailListening(show); int x = r.tileView.getLeft() + r.tileView.getWidth() / 2; int y = r.tileView.getTop() + r.tileView.getHeight() / 2; handleShowDetailImpl(r, show, x, y); diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java index 5a84db547e1e..b9574dc12ec3 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java @@ -149,6 +149,10 @@ public abstract class QSTile<TState extends State> implements Listenable { return mState; } + public void setDetailListening(boolean listening) { + // optional + } + // call only on tile worker looper private void handleSetCallback(Callback callback) { diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java index 70746c746976..d589366e7958 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java @@ -67,9 +67,16 @@ public class WifiTile extends QSTile<QSTile.SignalState> { public void setListening(boolean listening) { if (listening) { mController.addNetworkSignalChangedCallback(mCallback); - mWifiController.addAccessPointCallback(mDetailAdapter); } else { mController.removeNetworkSignalChangedCallback(mCallback); + } + } + + @Override + public void setDetailListening(boolean listening) { + if (listening) { + mWifiController.addAccessPointCallback(mDetailAdapter); + } else { mWifiController.removeAccessPointCallback(mDetailAdapter); } } |