diff options
author | Adnan Begovic <adnan@cyngn.com> | 2015-10-26 17:09:26 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-26 17:09:26 -0700 |
commit | 26ab72c232cede93d790ff502fea13d63f2a90e8 (patch) | |
tree | a605b78bfabedf15eda2bd57be43cc915c4ca4e6 /src/com/android/settings | |
parent | fb6fd3df017838c62f19a6ebd23d61c94f2782ba (diff) | |
download | packages_apps_Settings-26ab72c232cede93d790ff502fea13d63f2a90e8.zip packages_apps_Settings-26ab72c232cede93d790ff502fea13d63f2a90e8.tar.gz packages_apps_Settings-26ab72c232cede93d790ff502fea13d63f2a90e8.tar.bz2 |
Settings: Add CM Api level to about phone.
Change-Id: I802202719ca9a2d1f98fda807f133efceec7be4a
Diffstat (limited to 'src/com/android/settings')
-rw-r--r-- | src/com/android/settings/DeviceInfoSettings.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index 68851b2..35991b6 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -83,6 +83,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In private static final String KEY_SAFETY_LEGAL = "safetylegal"; private static final String KEY_MOD_VERSION = "mod_version"; private static final String KEY_MOD_BUILD_DATE = "build_date"; + private static final String KEY_MOD_API_LEVEL = "mod_api_level"; static final int TAPS_TO_BE_A_DEVELOPER = 7; @@ -133,6 +134,8 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In setValueSummary(KEY_MOD_VERSION, "ro.cm.display.version"); findPreference(KEY_MOD_VERSION).setEnabled(true); setValueSummary(KEY_MOD_BUILD_DATE, "ro.build.date"); + setExplicitValueSummary(KEY_MOD_API_LEVEL, constructApiLevelString()); + findPreference(KEY_MOD_API_LEVEL).setEnabled(true); if (!SELinux.isSELinuxEnabled()) { String status = getResources().getString(R.string.selinux_status_disabled); @@ -344,6 +347,14 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In } } + private void setExplicitValueSummary(String preference, String value) { + try { + findPreference(preference).setSummary(value); + } catch (RuntimeException e) { + // No recovery + } + } + private void sendFeedback() { String reporterPackage = getFeedbackReporterPackage(getActivity()); if (TextUtils.isEmpty(reporterPackage)) { @@ -382,6 +393,14 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In } } + private static String constructApiLevelString() { + int sdkInt = cyanogenmod.os.Build.CM_VERSION.SDK_INT; + StringBuilder builder = new StringBuilder(); + builder.append(cyanogenmod.os.Build.getNameForSDKInt(sdkInt)) + .append(" (" + sdkInt + ")"); + return builder.toString(); + } + public static String formatKernelVersion(String rawKernelVersion) { // Example (see tests for more): // Linux version 3.0.31-g6fb96c9 (android-build@xxx.xxx.xxx.xxx.com) \ |