BasebandVersionPreferenceController: Trim baseband if needed
Some Qualcomm MSIM devices report the baseband version twice. Handle it gracefully, similarly to CAF. Change-Id: I93bd071f31fed120c20185c4e0ec40edb7ca342b
This commit is contained in:
committed by
Michael Bestas
parent
0e30559b26
commit
e1b61b66ce
@@ -18,6 +18,7 @@ package com.android.settings.deviceinfo.firmwareversion;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
|
|
||||||
@@ -42,8 +43,14 @@ public class BasebandVersionPreferenceController extends BasePreferenceControlle
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CharSequence getSummary() {
|
public CharSequence getSummary() {
|
||||||
return SystemProperties.get(BASEBAND_PROPERTY,
|
String baseband = SystemProperties.get(BASEBAND_PROPERTY,
|
||||||
mContext.getString(R.string.device_info_default));
|
mContext.getString(R.string.device_info_default));
|
||||||
|
for (String str : baseband.split(",")) {
|
||||||
|
if (!TextUtils.isEmpty(str)) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return baseband;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// LINT.ThenChange(BasebandVersionPreference.kt)
|
// LINT.ThenChange(BasebandVersionPreference.kt)
|
||||||
|
|||||||
Reference in New Issue
Block a user