Skip to content

Commit 9b5ae0c

Browse files
committed
Tuning parameters for mobile RSSI.
* Allow phone RSSI to be shown instead of data * Allow "3G" to be shown for all sub-4G networks Change-Id: I0dc61ee039d1065ad6ccd63a2b2420edc62cb62e
1 parent d939dd2 commit 9b5ae0c

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

packages/SystemUI/res/values/config.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,11 @@
4343
<!-- How many icons may be shown at once in the system bar. Includes any
4444
slots that may be reused for things like IME control. -->
4545
<integer name="config_maxNotificationIcons">5</integer>
46+
47+
<!-- Show phone (voice) signal strength instead of data in mobile RSSI. -->
48+
<bool name="config_showPhoneRSSIForData">false</bool>
49+
50+
<!-- When true, show 1/2G networks as 3G. -->
51+
<bool name="config_showMin3G">false</bool>
4652
</resources>
4753

packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public class NetworkController extends BroadcastReceiver {
8585
boolean mDataActive;
8686
int mMobileActivityIconId; // overlay arrows for data direction
8787
int mLastSignalLevel;
88+
boolean mShowPhoneRSSIForData = false;
89+
boolean mShowAtLeastThreeGees = false;
8890

8991
String mContentDescriptionPhoneSignal;
9092
String mContentDescriptionWifi;
@@ -151,11 +153,15 @@ void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon
151153
*/
152154
public NetworkController(Context context) {
153155
mContext = context;
156+
final Resources res = context.getResources();
154157

155158
ConnectivityManager cm = (ConnectivityManager)mContext.getSystemService(
156159
Context.CONNECTIVITY_SERVICE);
157160
mHasMobileDataFeature = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
158161

162+
mShowPhoneRSSIForData = res.getBoolean(R.bool.config_showPhoneRSSIForData);
163+
mShowAtLeastThreeGees = res.getBoolean(R.bool.config_showMin3G);
164+
159165
// set up the default wifi icon, used when no radios have ever appeared
160166
updateWifiIcons();
161167

@@ -240,7 +246,7 @@ public void addSignalCluster(SignalCluster cluster) {
240246
mContentDescriptionWifi);
241247
cluster.setMobileDataIndicators(
242248
mHasMobileDataFeature,
243-
mPhoneSignalIconId,
249+
mShowPhoneRSSIForData ? mPhoneSignalIconId : mDataSignalIconId,
244250
mMobileActivityIconId,
245251
mDataTypeIconId,
246252
mContentDescriptionPhoneSignal,
@@ -434,17 +440,25 @@ private final void updateTelephonySignalStrength() {
434440
private final void updateDataNetType() {
435441
switch (mDataNetType) {
436442
case TelephonyManager.NETWORK_TYPE_UNKNOWN:
437-
mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
438-
mDataTypeIconId = 0;
439-
mContentDescriptionDataType = mContext.getString(
440-
R.string.accessibility_data_connection_gprs);
441-
break;
443+
if (!mShowAtLeastThreeGees) {
444+
mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
445+
mDataTypeIconId = 0;
446+
mContentDescriptionDataType = mContext.getString(
447+
R.string.accessibility_data_connection_gprs);
448+
break;
449+
} else {
450+
// fall through
451+
}
442452
case TelephonyManager.NETWORK_TYPE_EDGE:
443-
mDataIconList = TelephonyIcons.DATA_E[mInetCondition];
444-
mDataTypeIconId = R.drawable.stat_sys_data_connected_e;
445-
mContentDescriptionDataType = mContext.getString(
446-
R.string.accessibility_data_connection_edge);
447-
break;
453+
if (!mShowAtLeastThreeGees) {
454+
mDataIconList = TelephonyIcons.DATA_E[mInetCondition];
455+
mDataTypeIconId = R.drawable.stat_sys_data_connected_e;
456+
mContentDescriptionDataType = mContext.getString(
457+
R.string.accessibility_data_connection_edge);
458+
break;
459+
} else {
460+
// fall through
461+
}
448462
case TelephonyManager.NETWORK_TYPE_UMTS:
449463
mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
450464
mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
@@ -496,10 +510,17 @@ private final void updateDataNetType() {
496510
R.string.accessibility_data_connection_4g);
497511
break;
498512
default:
499-
mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
500-
mDataTypeIconId = R.drawable.stat_sys_data_connected_g;
501-
mContentDescriptionDataType = mContext.getString(
502-
R.string.accessibility_data_connection_gprs);
513+
if (!mShowAtLeastThreeGees) {
514+
mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
515+
mDataTypeIconId = R.drawable.stat_sys_data_connected_g;
516+
mContentDescriptionDataType = mContext.getString(
517+
R.string.accessibility_data_connection_gprs);
518+
} else {
519+
mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
520+
mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
521+
mContentDescriptionDataType = mContext.getString(
522+
R.string.accessibility_data_connection_3g);
523+
}
503524
break;
504525
}
505526
if ((isCdma() && isCdmaEri()) || mPhone.isNetworkRoaming()) {
@@ -877,7 +898,7 @@ else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered) {
877898
mContentDescriptionWifi);
878899
cluster.setMobileDataIndicators(
879900
mHasMobileDataFeature,
880-
mPhoneSignalIconId,
901+
mShowPhoneRSSIForData ? mPhoneSignalIconId : mDataSignalIconId,
881902
mMobileActivityIconId,
882903
mDataTypeIconId,
883904
mContentDescriptionPhoneSignal,

0 commit comments

Comments
 (0)