diff options
author | Danesh M <daneshm90@gmail.com> | 2016-02-17 14:51:38 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-02-17 15:15:43 -0800 |
commit | 3ac48ea998a9191fdc9ead18088c3e33961e0630 (patch) | |
tree | e1ceeca57e4a8e37e755159f4b44950d5b09c60f | |
parent | 67365603060148a8a59dd0dde831174202554d61 (diff) | |
download | packages_apps_Settings-3ac48ea998a9191fdc9ead18088c3e33961e0630.zip packages_apps_Settings-3ac48ea998a9191fdc9ead18088c3e33961e0630.tar.gz packages_apps_Settings-3ac48ea998a9191fdc9ead18088c3e33961e0630.tar.bz2 |
RegulatoryDialog : Use String.split to avoid crash on empty args
If a device only supports SAR image vs values, and empty overlay
will cause TextUtils.split to return an empty array and hence number
of format arguments will be mismatched. Instead use String.split
which returns a non-empty string array in the event that the source is empty.
Change-Id: I3d99e3378264d7b26d69ebe6c9c35c3c925f5c49
CYNGNOS-2050
-rw-r--r-- | src/com/android/settings/deviceinfo/Status.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java index 270da97..4c905eb 100644 --- a/src/com/android/settings/deviceinfo/Status.java +++ b/src/com/android/settings/deviceinfo/Status.java @@ -425,9 +425,9 @@ public class Status extends InstrumentedPreferenceActivity { public static String getSarValues(Resources res) { String headLevel = String.format(res.getString(R.string.maximum_head_level, - TextUtils.split(res.getString(R.string.sar_head_level), ","))); + res.getString(R.string.sar_head_level).split(","))); String bodyLevel = String.format(res.getString(R.string.maximum_body_level, - TextUtils.split(res.getString(R.string.sar_body_level), ","))); + res.getString(R.string.sar_body_level).split(","))); return headLevel + "\n" + bodyLevel; } |