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:
Bruno Martins
2020-04-24 22:22:47 +01:00
committed by Michael Bestas
parent 0e30559b26
commit e1b61b66ce

View File

@@ -18,6 +18,7 @@ package com.android.settings.deviceinfo.firmwareversion;
import android.content.Context;
import android.os.SystemProperties;
import android.text.TextUtils;
import androidx.annotation.VisibleForTesting;
@@ -42,8 +43,14 @@ public class BasebandVersionPreferenceController extends BasePreferenceControlle
@Override
public CharSequence getSummary() {
return SystemProperties.get(BASEBAND_PROPERTY,
String baseband = SystemProperties.get(BASEBAND_PROPERTY,
mContext.getString(R.string.device_info_default));
for (String str : baseband.split(",")) {
if (!TextUtils.isEmpty(str)) {
return str;
}
}
return baseband;
}
}
// LINT.ThenChange(BasebandVersionPreference.kt)