summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-04-04 17:54:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-04 17:54:52 +0000
commit35dec44394358bac2cdf31d5e8377687a1723476 (patch)
tree390d96b4607c4335e2ca05cc31fb8e5a0ce43191 /packages
parent33d0dad1bce329b5794091c31c50543666b3a251 (diff)
parentdbce182acc6493f3866a2c22431ab1deaef8f277 (diff)
downloadframeworks_base-35dec44394358bac2cdf31d5e8377687a1723476.zip
frameworks_base-35dec44394358bac2cdf31d5e8377687a1723476.tar.gz
frameworks_base-35dec44394358bac2cdf31d5e8377687a1723476.tar.bz2
Merge "Resurface inet problems in status bar icons."
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java15
2 files changed, 29 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index f1c8e01..89da08f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -17,6 +17,8 @@
package com.android.systemui.statusbar;
import android.content.Context;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
@@ -35,11 +37,14 @@ public class SignalClusterView
static final boolean DEBUG = false;
static final String TAG = "SignalClusterView";
+ static final PorterDuffColorFilter PROBLEM_FILTER
+ = new PorterDuffColorFilter(0xffab653b, PorterDuff.Mode.SRC_ATOP);
NetworkController mNC;
private boolean mWifiVisible = false;
private int mWifiStrengthId = 0;
+ private boolean mInetProblem;
private boolean mMobileVisible = false;
private int mMobileStrengthId = 0, mMobileTypeId = 0;
private boolean mIsAirplaneMode = false;
@@ -96,19 +101,22 @@ public class SignalClusterView
}
@Override
- public void setWifiIndicators(boolean visible, int strengthIcon, String contentDescription) {
+ public void setWifiIndicators(boolean visible, int strengthIcon, boolean problem,
+ String contentDescription) {
mWifiVisible = visible;
mWifiStrengthId = strengthIcon;
+ mInetProblem = problem;
mWifiDescription = contentDescription;
apply();
}
@Override
- public void setMobileDataIndicators(boolean visible, int strengthIcon,
+ public void setMobileDataIndicators(boolean visible, int strengthIcon, boolean problem,
int typeIcon, String contentDescription, String typeContentDescription) {
mMobileVisible = visible;
mMobileStrengthId = strengthIcon;
+ mInetProblem = problem;
mMobileTypeId = typeIcon;
mMobileDescription = contentDescription;
mMobileTypeDescription = typeContentDescription;
@@ -158,13 +166,17 @@ public class SignalClusterView
apply();
}
+ private void applyInetProblem(ImageView iv) {
+ iv.setColorFilter(mInetProblem ? PROBLEM_FILTER : null);
+ }
+
// Run after each indicator change.
private void apply() {
if (mWifiGroup == null) return;
if (mWifiVisible) {
mWifi.setImageResource(mWifiStrengthId);
-
+ applyInetProblem(mWifi);
mWifiGroup.setContentDescription(mWifiDescription);
mWifiGroup.setVisibility(View.VISIBLE);
} else {
@@ -179,7 +191,7 @@ public class SignalClusterView
if (mMobileVisible && !mIsAirplaneMode) {
mMobile.setImageResource(mMobileStrengthId);
mMobileType.setImageResource(mMobileTypeId);
-
+ applyInetProblem(mMobile);
mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription);
mMobileGroup.setVisibility(View.VISIBLE);
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 09f1695..92c008e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -126,6 +126,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
private int mConnectedNetworkType = ConnectivityManager.TYPE_NONE;
private String mConnectedNetworkTypeName;
private int mInetCondition = 0;
+ private int mLastInetCondition = 0;
private static final int INET_CONDITION_THRESHOLD = 50;
private boolean mAirplaneMode = false;
@@ -156,9 +157,9 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
boolean mDataAndWifiStacked = false;
public interface SignalCluster {
- void setWifiIndicators(boolean visible, int strengthIcon,
+ void setWifiIndicators(boolean visible, int strengthIcon, boolean problem,
String contentDescription);
- void setMobileDataIndicators(boolean visible, int strengthIcon,
+ void setMobileDataIndicators(boolean visible, int strengthIcon, boolean problem,
int typeIcon, String contentDescription, String typeContentDescription);
void setIsAirplaneMode(boolean is, int airplaneIcon);
}
@@ -288,6 +289,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
// only show wifi in the cluster if connected or if wifi-only
mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature),
mWifiIconId,
+ mInetCondition == 0,
mContentDescriptionWifi);
if (mIsWimaxEnabled && mWimaxConnected) {
@@ -295,6 +297,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
cluster.setMobileDataIndicators(
true,
mAlwaysShowCdmaRssi ? mPhoneSignalIconId : mWimaxIconId,
+ mInetCondition == 0,
mDataTypeIconId,
mContentDescriptionWimax,
mContentDescriptionDataType);
@@ -303,6 +306,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
cluster.setMobileDataIndicators(
mHasMobileDataFeature,
mShowPhoneRSSIForData ? mPhoneSignalIconId : mDataSignalIconId,
+ mInetCondition == 0,
mDataTypeIconId,
mContentDescriptionPhoneSignal,
mContentDescriptionDataType);
@@ -1145,6 +1149,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
if (mLastPhoneSignalIconId != mPhoneSignalIconId
|| mLastWifiIconId != mWifiIconId
+ || mLastInetCondition != mInetCondition
|| mLastWimaxIconId != mWimaxIconId
|| mLastDataTypeIconId != mDataTypeIconId
|| mLastAirplaneMode != mAirplaneMode
@@ -1179,6 +1184,10 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
mLastWifiIconId = mWifiIconId;
}
+ if (mLastInetCondition != mInetCondition) {
+ mLastInetCondition = mInetCondition;
+ }
+
// the wimax icon on phones
if (mLastWimaxIconId != mWimaxIconId) {
mLastWimaxIconId = mWimaxIconId;
@@ -1424,6 +1433,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
cluster.setWifiIndicators(
show,
iconId,
+ mDemoInetCondition == 0,
"Demo");
}
}
@@ -1456,6 +1466,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
cluster.setMobileDataIndicators(
show,
iconId,
+ mDemoInetCondition == 0,
mDemoDataTypeIconId,
"Demo",
"Demo");