Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 637544032
  • Loading branch information
DeviceInfra authored and Copybara-Service committed May 27, 2024
1 parent 7256270 commit 2a44938
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
public enum AndroidProperty {
ABI("ro.product.cpu.abi", "ro.product.cpu.abi2"),
ABILIST("ro.product.cpu.abilist"),
BASEBAND_VERSION("gsm.version.baseband"),
BOOT_TO_VR("ro.boot.vr"),
BRAND("ro.product.brand"),
BUILD("ro.build.display.id"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ public ImmutableList<String> getCarrierIds(String serial)
.collect(toImmutableList());
}

/** Returns the radio version (i.e., the baseband version) of the device. */
public String getRadioVersion(String serial) throws MobileHarnessException, InterruptedException {
return adbUtil.getProperty(serial, AndroidProperty.BASEBAND_VERSION);
}

private Stream<String> getAvailableSimInfoStream(String serial)
throws MobileHarnessException, InterruptedException {
String adbOutput = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public enum Name {
FREE_INTERNAL_STORAGE,
/** The version of gms core on the device. */
GMS_VERSION,
/** GServices Android ID(go/android-id). */
/** GServices Android ID. */
GSERVICES_ANDROID_ID,
/** The hardware name of the device. */
HARDWARE,
Expand Down Expand Up @@ -280,9 +280,15 @@ public enum Name {
/** The ATE cluster name */
CLUSTER,

// Riemann's custom dimensions, go/portable-lab-device-dimension.
// Riemann's custom dimensions.
/** A comma-separated string containing the carrier ID of each SIM on the device. */
CARRIER_IDS;
CARRIER_IDS,

/** The radio version (i.e., the baseband version) of the device. */
RADIO_VERSION,

/** A comma-separated string containing information of all available SIM cards on the device. */
SIM_INFOS;

public String lowerCaseName() {
return Ascii.toLowerCase(name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,4 +913,19 @@ public void getCarrierIds_noCarrierId_returnsEmptyList() throws Exception {

assertThat(systemSpecUtil.getCarrierIds(SERIAL)).isEmpty();
}

@Test
public void getRadioVersion_hasValue_success() throws Exception {
String baseband = "g5123b-130914-240205-B-11405587";
when(adbUtil.getProperty(SERIAL, AndroidProperty.BASEBAND_VERSION)).thenReturn(baseband);

assertThat(systemSpecUtil.getRadioVersion(SERIAL)).isEqualTo(baseband);
}

@Test
public void getRadioVersion_noValue_success() throws Exception {
when(adbUtil.getProperty(SERIAL, AndroidProperty.BASEBAND_VERSION)).thenReturn("");

assertThat(systemSpecUtil.getRadioVersion(SERIAL)).isEmpty();
}
}

0 comments on commit 2a44938

Please sign in to comment.