summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInseob Kim <inseob@google.com>2019-10-31 19:56:35 +0900
committerInseob Kim <inseob@google.com>2019-11-01 12:40:51 +0900
commit5a630f03b368c9a988e9e604d4c8609c7ab09092 (patch)
treef7faa3fb0a8b3e5453c4a0ef935e4f86d4e8bb24
parent9cc29b34b202db69c255e6d035646d791dc925cb (diff)
Schematize Telephony System Properties
Properties accessed across partitions are now schematized and will become APIs to make explicit interfaces among partitions. Bug: 117924132 Bug: 141246285 Test: lunch blueline-userdebug; m checkbuild Change-Id: I17266c28b12f11dffac82a0e6b7bad0f274357a9
-rw-r--r--service/java/com/android/server/wifi/hotspot2/SystemInfo.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/SystemInfo.java b/service/java/com/android/server/wifi/hotspot2/SystemInfo.java
index fe675c6f5..e39eb185b 100644
--- a/service/java/com/android/server/wifi/hotspot2/SystemInfo.java
+++ b/service/java/com/android/server/wifi/hotspot2/SystemInfo.java
@@ -20,15 +20,16 @@ import android.annotation.NonNull;
import android.content.Context;
import android.os.Build;
import android.os.SystemProperties;
+import android.sysprop.TelephonyProperties;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.telephony.TelephonyProperties;
import com.android.server.wifi.WifiNative;
import java.util.Locale;
+import java.util.stream.Collectors;
/**
* Provide APIs for retrieving system information, so that they can be mocked for unit tests.
@@ -141,9 +142,11 @@ public class SystemInfo {
* @return the version that consists of build id and baseband version.
*/
public String getFirmwareVersion() {
+ String version = TelephonyProperties.baseband_version().stream()
+ .map(elem -> elem == null ? "" : elem).collect(Collectors.joining(","));
return new StringBuffer(Build.ID)
.append("/")
- .append(SystemProperties.get(TelephonyProperties.PROPERTY_BASEBAND_VERSION,
- UNKNOWN_INFO)).toString();
+ .append(version.isEmpty() ? UNKNOWN_INFO : version)
+ .toString();
}
}