Skip to content

Commit

Permalink
SystemUI: Provide correct resource type
Browse files Browse the repository at this point in the history
- The value stored for when the network
class is unknown is 0. We attempt to get
the resource for this value, which doesn't exist,
resulting in a crash
- Store an empty string for when the
network class is unknown, which is also the
default value.

Change-Id: I1c10dfe18b7dd78e798c2b5a89ca2974136b7e84
CRs-Fixed: 953821
  • Loading branch information
Wileen Chiu authored and Gerrit - the friendly Code Review server committed Dec 29, 2015
1 parent 13a8a3c commit 36ef3e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/res/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2427,6 +2427,7 @@
<bool name="config_display_rat">false</bool>

<!-- config 2G/3G/4G RAT strings for carriers -->
<string name="config_rat_unknown" translatable="false">""</string>
<string name="config_rat_2g" translatable="false">2G</string>
<string name="config_rat_3g" translatable="false">3G</string>
<string name="config_rat_4g" translatable="false">4G</string>
Expand Down
1 change: 1 addition & 0 deletions core/res/res/values/symbols.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,7 @@
<java-symbol type="string" name="def_wifi_direct_name" />
<java-symbol type="string" name="def_custom_bt_defname" />
<!-- config 2G/3G/4G RAT strings for carriers -->
<java-symbol type="string" name="config_rat_unknown" />
<java-symbol type="string" name="config_rat_2g" />
<java-symbol type="string" name="config_rat_3g" />
<java-symbol type="string" name="config_rat_4g" />
Expand Down
3 changes: 2 additions & 1 deletion packages/Keyguard/src/com/android/keyguard/CarrierText.java
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ public CharSequence getTransformation(CharSequence source, View view) {
}

private String networkClassToString (int networkClass) {
final int[] classIds = { 0, // TelephonyManager.NETWORK_CLASS_UNKNOWN
final int[] classIds =
{com.android.internal.R.string.config_rat_unknown, // TelephonyManager.NETWORK_CLASS_UNKNOWN
com.android.internal.R.string.config_rat_2g,
com.android.internal.R.string.config_rat_3g,
com.android.internal.R.string.config_rat_4g };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ private String getNetworkClassString(ServiceState state) {
}

private String networkClassToString (int networkClass) {
final int[] classIds = { 0, // TelephonyManager.NETWORK_CLASS_UNKNOWN
final int[] classIds =
{com.android.internal.R.string.config_rat_unknown, // TelephonyManager.NETWORK_CLASS_UNKNOWN
com.android.internal.R.string.config_rat_2g,
com.android.internal.R.string.config_rat_3g,
com.android.internal.R.string.config_rat_4g };
Expand Down

0 comments on commit 36ef3e3

Please sign in to comment.