Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6a13c52 authored by Bruno Martins's avatar Bruno Martins Committed by Michael Bestas
Browse files

BasebandVersionPreferenceController: Trim baseband if needed

Some Qualcomm MSIM devices report the baseband version twice.
Handle it gracefully, similarly to CAF.

Change-Id: I93bd071f31fed120c20185c4e0ec40edb7ca342b
parent 50b7a020
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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;

@@ -41,7 +42,13 @@ 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;
    }
}