Settings: Show SoC Model rather than value of ro.board.platform if available
* These properties were introduced in S, so why not use them?
Change-Id: I2abb584e140841c03f8daa7cc6c0107f24a0e234
diff --git a/res/values/leaf_strings.xml b/res/values/leaf_strings.xml
index 0cd6a6e..01831c2 100644
--- a/res/values/leaf_strings.xml
+++ b/res/values/leaf_strings.xml
@@ -63,6 +63,6 @@
<string name="notification_sound_vib_screen_on_summary">Play sound and vibration for notifications when screen is on</string>
<!-- Hardware info -->
- <string name="platform_revision">Platform</string>
+ <string name="soc_model">SoC Model</string>
<string name="total_ram">Total RAM</string>
</resources>
diff --git a/res/xml/hardware_info.xml b/res/xml/hardware_info.xml
index 055a62c..fc4c7b5 100644
--- a/res/xml/hardware_info.xml
+++ b/res/xml/hardware_info.xml
@@ -30,13 +30,13 @@
settings:controller="com.android.settings.deviceinfo.hardwareinfo.DeviceModelPreferenceController"
settings:enableCopying="true"/>
- <!-- Platform -->
+ <!-- SoC Model -->
<Preference
- android:key="hardware_info_platform"
- android:title="@string/platform_revision"
+ android:key="hardware_info_soc_model"
+ android:title="@string/soc_model"
android:summary="@string/summary_placeholder"
android:selectable="false"
- settings:controller="com.android.settings.deviceinfo.hardwareinfo.PlatformRevisionPreferenceController"
+ settings:controller="com.android.settings.deviceinfo.hardwareinfo.SoCModelPreferenceController"
settings:enableCopying="true"/>
<!-- Total RAM -->
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/PlatformRevisionPreferenceController.java b/src/com/android/settings/deviceinfo/hardwareinfo/SoCModelPreferenceController.java
similarity index 75%
rename from src/com/android/settings/deviceinfo/hardwareinfo/PlatformRevisionPreferenceController.java
rename to src/com/android/settings/deviceinfo/hardwareinfo/SoCModelPreferenceController.java
index beac9f8..04bbba2 100644
--- a/src/com/android/settings/deviceinfo/hardwareinfo/PlatformRevisionPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/SoCModelPreferenceController.java
@@ -17,15 +17,16 @@
package com.android.settings.deviceinfo.hardwareinfo;
import android.content.Context;
+import android.os.Build;
import android.os.SystemProperties;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.slices.Sliceable;
-public class PlatformRevisionPreferenceController extends BasePreferenceController {
+public class SoCModelPreferenceController extends BasePreferenceController {
- public PlatformRevisionPreferenceController(Context context, String preferenceKey) {
+ public SoCModelPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
}
@@ -42,6 +43,12 @@
@Override
public CharSequence getSummary() {
+ if (!Build.SOC_MODEL.equals(Build.UNKNOWN)) {
+ if (!Build.SOC_MANUFACTURER.equals(Build.UNKNOWN)) {
+ return Build.SOC_MANUFACTURER + " " + Build.SOC_MODEL;
+ }
+ return Build.SOC_MODEL;
+ }
return SystemProperties.get("ro.board.platform");
}
}