Loading telephony/java/android/telephony/TelephonyManager.java +38 −1 Original line number Diff line number Diff line Loading @@ -6587,11 +6587,48 @@ public class TelephonyManager { * @hide */ public void setBasebandVersionForPhone(int phoneId, String version) { setTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_BASEBAND_VERSION, version); } /** * Get baseband version for the default phone. * * @return baseband version. * @hide */ public String getBasebandVersion() { int phoneId = getPhoneId(); return getBasebandVersionForPhone(phoneId); } /** * Get baseband version for the default phone using the legacy approach. * This change was added in P, to ensure backward compatiblity. * * @return baseband version. * @hide */ private String getBasebandVersionLegacy(int phoneId) { if (SubscriptionManager.isValidPhoneId(phoneId)) { String prop = TelephonyProperties.PROPERTY_BASEBAND_VERSION + ((phoneId == 0) ? "" : Integer.toString(phoneId)); SystemProperties.set(prop, version); return SystemProperties.get(prop); } return null; } /** * Get baseband version by phone id. * * @return baseband version. * @hide */ public String getBasebandVersionForPhone(int phoneId) { String version = getBasebandVersionLegacy(phoneId); if (version != null && !version.isEmpty()) { setBasebandVersionForPhone(phoneId, version); } return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_BASEBAND_VERSION, ""); } /** Loading Loading
telephony/java/android/telephony/TelephonyManager.java +38 −1 Original line number Diff line number Diff line Loading @@ -6587,11 +6587,48 @@ public class TelephonyManager { * @hide */ public void setBasebandVersionForPhone(int phoneId, String version) { setTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_BASEBAND_VERSION, version); } /** * Get baseband version for the default phone. * * @return baseband version. * @hide */ public String getBasebandVersion() { int phoneId = getPhoneId(); return getBasebandVersionForPhone(phoneId); } /** * Get baseband version for the default phone using the legacy approach. * This change was added in P, to ensure backward compatiblity. * * @return baseband version. * @hide */ private String getBasebandVersionLegacy(int phoneId) { if (SubscriptionManager.isValidPhoneId(phoneId)) { String prop = TelephonyProperties.PROPERTY_BASEBAND_VERSION + ((phoneId == 0) ? "" : Integer.toString(phoneId)); SystemProperties.set(prop, version); return SystemProperties.get(prop); } return null; } /** * Get baseband version by phone id. * * @return baseband version. * @hide */ public String getBasebandVersionForPhone(int phoneId) { String version = getBasebandVersionLegacy(phoneId); if (version != null && !version.isEmpty()) { setBasebandVersionForPhone(phoneId, version); } return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_BASEBAND_VERSION, ""); } /** Loading