summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-20 02:22:19 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-20 02:22:19 +0000
commit91bc7be71258dfd87d308f414c4f92b1c5efeaca (patch)
treea579e9cf8616a9fb63b3b5031c538004c28f7b48 /core/java
parentda7191db0f7b500d3f7b93e797175ff5a3184f91 (diff)
parentdc4de88fec9540c1da48e5f9e5a9a8b01c3f9410 (diff)
Merge "Use sysprop library for telephony props" am: afb16fa9d4 am: dc4de88fec
Change-Id: Iae5ca6c30dd3a72d5da921cf45d9c282bcff2703
Diffstat (limited to 'core/java')
-rwxr-xr-xcore/java/android/os/Build.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 772109a339f5..cc8f2d6e046e 100755
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -26,17 +26,17 @@ import android.annotation.UnsupportedAppUsage;
import android.app.ActivityThread;
import android.app.Application;
import android.content.Context;
+import android.sysprop.TelephonyProperties;
import android.text.TextUtils;
import android.util.Slog;
import android.view.View;
-import com.android.internal.telephony.TelephonyProperties;
-
import dalvik.system.VMRuntime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import java.util.stream.Collectors;
/**
* Information about the current build, extracted from system properties.
@@ -99,7 +99,8 @@ public class Build {
* {@link #getRadioVersion} instead.
*/
@Deprecated
- public static final String RADIO = getString(TelephonyProperties.PROPERTY_BASEBAND_VERSION);
+ public static final String RADIO = joinListOrElse(
+ TelephonyProperties.baseband_version(), UNKNOWN);
/** The name of the hardware (from the kernel command line or /proc). */
public static final String HARDWARE = getString("ro.hardware");
@@ -1089,7 +1090,8 @@ public class Build {
final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
final String currentBootloader = SystemProperties.get("ro.bootloader");
final String requiredRadio = SystemProperties.get("ro.build.expect.baseband");
- final String currentRadio = SystemProperties.get("gsm.version.baseband");
+ final String currentRadio = joinListOrElse(
+ TelephonyProperties.baseband_version(), "");
if (TextUtils.isEmpty(system)) {
Slog.e(TAG, "Required ro.system.build.fingerprint is empty!");
@@ -1263,8 +1265,7 @@ public class Build {
* null (if, for instance, the radio is not currently on).
*/
public static String getRadioVersion() {
- String propVal = SystemProperties.get(TelephonyProperties.PROPERTY_BASEBAND_VERSION);
- return TextUtils.isEmpty(propVal) ? null : propVal;
+ return joinListOrElse(TelephonyProperties.baseband_version(), null);
}
@UnsupportedAppUsage
@@ -1289,4 +1290,10 @@ public class Build {
return -1;
}
}
+
+ private static <T> String joinListOrElse(List<T> list, String defaultValue) {
+ String ret = list.stream().map(elem -> elem == null ? "" : elem.toString())
+ .collect(Collectors.joining(","));
+ return ret.isEmpty() ? defaultValue : ret;
+ }
}