summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2015-04-20 16:38:51 -0400
committerJason Monk <jmonk@google.com>2015-04-20 16:38:51 -0400
commit0d6a1c445c98f67b4fd314b58d703ec1c28e5658 (patch)
treee249aaedf68b69417efeda132137004a999c7cd7 /packages/SystemUI/src/com/android/systemui
parentca02bc7cebabcf347bde98a45cce41c7d1ab26ee (diff)
downloadframeworks_base-0d6a1c445c98f67b4fd314b58d703ec1c28e5658.zip
frameworks_base-0d6a1c445c98f67b4fd314b58d703ec1c28e5658.tar.gz
frameworks_base-0d6a1c445c98f67b4fd314b58d703ec1c28e5658.tar.bz2
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
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSTile.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java9
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 f4fd6a2..b5c1ca8 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 5a84db5..b9574dc 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 70746c7..d589366 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);
}
}