Skip to content

Commit 45b55df

Browse files
Settings: Show wave flavour instead of device name
Signed-off-by: Jyotiraditya Panda <jyotiraditya@aospa.co>
1 parent 2a1e7a9 commit 45b55df

2 files changed

Lines changed: 12 additions & 30 deletions

File tree

res/layout/wave_info.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@
6262
style="@style/TextAppearance.WaveInfoSummary" />
6363

6464
<TextView
65-
android:id="@+id/device_title"
65+
android:id="@+id/flavour_title"
6666
android:layout_width="match_parent"
6767
android:layout_height="wrap_content"
6868
android:layout_marginBottom="4dp"
69-
android:text="@string/wave_device_title"
69+
android:text="@string/wave_flavour_title"
7070
style="@style/TextAppearance.WaveInfoTitle" />
7171

7272
<TextView
73-
android:id="@+id/device_message"
73+
android:id="@+id/flavour_message"
7474
android:layout_width="match_parent"
7575
android:layout_height="wrap_content"
7676
android:layout_marginBottom="14dp"

src/com/android/settings/deviceinfo/aboutphone/WaveInfoPreferenceController.java

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,46 +32,28 @@ public class WaveInfoPreferenceController extends AbstractPreferenceController {
3232
private static final String KEY_WAVE_INFO = "wave_info";
3333

3434
private static final String PROP_WAVE_VERSION = "ro.wave.version";
35-
private static final String PROP_WAVE_VERSION_CODE = "ro.wave.version_code";
35+
private static final String PROP_WAVE_FLAVOUR = "ro.wave.flavour";
3636
private static final String PROP_WAVE_OFFICIAL = "ro.wave.is_official";
3737
private static final String PROP_WAVE_MAINTAINER = "ro.wave.maintainer_name";
38-
private static final String PROP_WAVE_DEVICE = "ro.wave.device_name";
3938

4039
public WaveInfoPreferenceController(Context context) {
4140
super(context);
4241
}
4342

44-
private String getDeviceName() {
45-
String device = SystemProperties.get(PROP_WAVE_DEVICE, "");
46-
if (device.equals("")) {
47-
device = Build.MANUFACTURER + " " + Build.MODEL;
48-
}
49-
return device;
50-
}
51-
52-
private String getWaveVersion() {
53-
final String version = SystemProperties.get(PROP_WAVE_VERSION,
54-
this.mContext.getString(R.string.device_info_default));
55-
final String versionCode = SystemProperties.get(PROP_WAVE_VERSION_CODE,
56-
this.mContext.getString(R.string.device_info_default));
57-
58-
return version + " | " + versionCode;
59-
}
60-
6143
@Override
6244
public void displayPreference(PreferenceScreen screen) {
6345
super.displayPreference(screen);
6446
final LayoutPreference waveInfoPreference = screen.findPreference(KEY_WAVE_INFO);
65-
final TextView version = (TextView) waveInfoPreference.findViewById(R.id.version_message);
66-
final TextView device = (TextView) waveInfoPreference.findViewById(R.id.device_message);
67-
final TextView maintainer = (TextView) waveInfoPreference.findViewById(R.id.maintainer_message);
68-
final TextView releaseType = (TextView) waveInfoPreference.findViewById(R.id.release_type_message);
69-
final String waveVersion = getWaveVersion();
70-
final String waveDevice = getDeviceName();
71-
final String waveMaintainer = SystemProperties.get(PROP_WAVE_MAINTAINER, this.mContext.getString(R.string.device_info_default));
47+
final TextView version = waveInfoPreference.findViewById(R.id.version_message);
48+
final TextView flavour = waveInfoPreference.findViewById(R.id.flavour_message);
49+
final TextView maintainer = waveInfoPreference.findViewById(R.id.maintainer_message);
50+
final TextView releaseType = waveInfoPreference.findViewById(R.id.release_type_message);
51+
final String waveVersion = SystemProperties.get(PROP_WAVE_VERSION, mContext.getString(R.string.device_info_default));
52+
final String waveFlavour = SystemProperties.get(PROP_WAVE_FLAVOUR, mContext.getString(R.string.device_info_default));
53+
final String waveMaintainer = SystemProperties.get(PROP_WAVE_MAINTAINER, mContext.getString(R.string.device_info_default));
7254
final String waveReleaseType = SystemProperties.getBoolean(PROP_WAVE_OFFICIAL, false) ? "Official" : "Unofficial";
7355
version.setText(waveVersion);
74-
device.setText(waveDevice);
56+
flavour.setText(waveFlavour);
7557
maintainer.setText(waveMaintainer);
7658
releaseType.setText(waveReleaseType);
7759
}

0 commit comments

Comments
 (0)