diff options
author | John Wang <johnwang@google.com> | 2012-02-13 17:16:41 -0800 |
---|---|---|
committer | John Wang <johnwang@google.com> | 2012-02-13 17:48:24 -0800 |
commit | d55cde1384598b31d900f804a197fa3b1467202d (patch) | |
tree | a8731ab45a2218984b9fe37de4ec200be36fa828 /packages | |
parent | 197fe26940022be75384f4038dd789f446d33122 (diff) | |
download | frameworks_base-d55cde1384598b31d900f804a197fa3b1467202d.zip frameworks_base-d55cde1384598b31d900f804a197fa3b1467202d.tar.gz frameworks_base-d55cde1384598b31d900f804a197fa3b1467202d.tar.bz2 |
Only use CDMA rssi for config_alwaysUseCdmaRssi.
If config_alwaysUseCdmaRssi is true, the RSSI signal bar only
shows the CDMA value, no matter it connects to EVDO or WiMax .
bug:5941743
Change-Id: I4187571898a9fb47162e1ccf0cc4c59c3136ae0b
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java | 24 |
1 files changed, 17 insertions, 7 deletions
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 d46ab6c..506dd9a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -88,6 +88,7 @@ public class NetworkController extends BroadcastReceiver { int mLastSignalLevel; boolean mShowPhoneRSSIForData = false; boolean mShowAtLeastThreeGees = false; + boolean mAlwaysShowCdmaRssi = false; String mContentDescriptionPhoneSignal; String mContentDescriptionWifi; @@ -156,7 +157,7 @@ public class NetworkController extends BroadcastReceiver { IBatteryStats mBatteryStats; public interface SignalCluster { - void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon, + void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon, String contentDescription); void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon, int typeIcon, String contentDescription, String typeContentDescription); @@ -176,6 +177,8 @@ public class NetworkController extends BroadcastReceiver { mShowPhoneRSSIForData = res.getBoolean(R.bool.config_showPhoneRSSIForData); mShowAtLeastThreeGees = res.getBoolean(R.bool.config_showMin3G); + mAlwaysShowCdmaRssi = res.getBoolean( + com.android.internal.R.bool.config_alwaysUseCdmaRssi); // set up the default wifi icon, used when no radios have ever appeared updateWifiIcons(); @@ -287,7 +290,7 @@ public class NetworkController extends BroadcastReceiver { // wimax is special cluster.setMobileDataIndicators( true, - mWimaxIconId, + mAlwaysShowCdmaRssi ? mPhoneSignalIconId : mWimaxIconId, mMobileActivityIconId, mDataTypeIconId, mContentDescriptionWimax, @@ -351,7 +354,7 @@ public class NetworkController extends BroadcastReceiver { @Override public void onSignalStrengthsChanged(SignalStrength signalStrength) { if (DEBUG) { - Slog.d(TAG, "onSignalStrengthsChanged signalStrength=" + signalStrength + + Slog.d(TAG, "onSignalStrengthsChanged signalStrength=" + signalStrength + ((signalStrength == null) ? "" : (" level=" + signalStrength.getLevel()))); } mSignalStrength = signalStrength; @@ -469,7 +472,15 @@ public class NetworkController extends BroadcastReceiver { } else { int iconLevel; int[] iconList; - mLastSignalLevel = iconLevel = mSignalStrength.getLevel(); + if (isCdma() && mAlwaysShowCdmaRssi) { + mLastSignalLevel = iconLevel = mSignalStrength.getCdmaLevel(); + if(DEBUG) Slog.d(TAG, "mAlwaysShowCdmaRssi=" + mAlwaysShowCdmaRssi + + " set to cdmaLevel=" + mSignalStrength.getCdmaLevel() + + " instead of level=" + mSignalStrength.getLevel()); + } else { + mLastSignalLevel = iconLevel = mSignalStrength.getLevel(); + } + if (isCdma()) { if (isCdmaEri()) { iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; @@ -487,7 +498,6 @@ public class NetworkController extends BroadcastReceiver { mPhoneSignalIconId = iconList[iconLevel]; mContentDescriptionPhoneSignal = mContext.getString( AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[iconLevel]); - mDataSignalIconId = TelephonyIcons.DATA_SIGNAL_STRENGTH[mInetCondition][iconLevel]; } } @@ -908,7 +918,7 @@ public class NetworkController extends BroadcastReceiver { mobileLabel = ""; } } else { - mobileLabel + mobileLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); } @@ -1181,7 +1191,7 @@ public class NetworkController extends BroadcastReceiver { v.setText(wifiLabel); } } - + // mobile label N = mMobileLabelViews.size(); for (int i=0; i<N; i++) { |