Merge branch 'upstream-google' into upgrade am: 58bd83a4a4 am: 55f5d07e50
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/robolectric/+/20740694
Change-Id: I7d9c2e894f678ca3701eb6e8ec522f721a3f3508
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/processor/Android.bp b/processor/Android.bp
index 46a8dc3..9d28322 100644
--- a/processor/Android.bp
+++ b/processor/Android.bp
@@ -78,7 +78,7 @@
// Disable annotation processing while compiling tests to avoid executing RobolectricProcessor.
javacflags: ["-proc:none"],
- // Disabling tests as they fail in the bramble build.
+ // Disabling as javahost test is broken bramble
test_options: {
unit_test: false,
},
diff --git a/robolectric/src/test/java/org/robolectric/shadows/ShadowCompanionDeviceManagerTest.java b/robolectric/src/test/java/org/robolectric/shadows/ShadowCompanionDeviceManagerTest.java
index 8437c7a..6b7a35c 100644
--- a/robolectric/src/test/java/org/robolectric/shadows/ShadowCompanionDeviceManagerTest.java
+++ b/robolectric/src/test/java/org/robolectric/shadows/ShadowCompanionDeviceManagerTest.java
@@ -129,6 +129,7 @@
"deviceProfile",
/* selfManaged= */ false,
/* notifyOnDeviceNearby= */ false,
+ /* revoked */ false,
/* timeApprovedMs= */ 0,
/* lastTimeConnectedMs= */ 0);
assertThat(companionDeviceManager.getAssociations()).isEmpty();
diff --git a/robolectric/src/test/java/org/robolectric/shadows/ShadowNfcAdapterTest.java b/robolectric/src/test/java/org/robolectric/shadows/ShadowNfcAdapterTest.java
index 6b849c2..5d43069 100644
--- a/robolectric/src/test/java/org/robolectric/shadows/ShadowNfcAdapterTest.java
+++ b/robolectric/src/test/java/org/robolectric/shadows/ShadowNfcAdapterTest.java
@@ -209,6 +209,6 @@
}
private static Tag createMockTag() {
- return Tag.createMockTag(new byte[0], new int[0], new Bundle[0]);
+ return Tag.createMockTag(new byte[0], new int[0], new Bundle[0], 0L);
}
}
diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowCompanionDeviceManager.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowCompanionDeviceManager.java
index 7937487..679ad04 100644
--- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowCompanionDeviceManager.java
+++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowCompanionDeviceManager.java
@@ -22,6 +22,7 @@
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
+
/** Shadow for CompanionDeviceManager. */
@Implements(value = CompanionDeviceManager.class, minSdk = VERSION_CODES.O)
public class ShadowCompanionDeviceManager {
@@ -138,6 +139,7 @@
info.deviceProfile(),
info.selfManaged(),
info.notifyOnDeviceNearby(),
+ info.revoked(),
info.timeApprovedMs(),
info.lastTimeConnectedMs());
}
@@ -152,6 +154,7 @@
info.getDeviceProfile(),
info.isSelfManaged(),
info.isNotifyOnDeviceNearby(),
+ info.isRevoked(),
info.getTimeApprovedMs(),
info.getLastTimeConnectedMs());
}
@@ -182,6 +185,8 @@
public abstract boolean notifyOnDeviceNearby();
+ public abstract boolean revoked();
+
public abstract long timeApprovedMs();
public abstract long lastTimeConnectedMs();
@@ -205,6 +210,7 @@
String deviceProfile,
boolean selfManaged,
boolean notifyOnDeviceNearby,
+ boolean revoked,
long timeApprovedMs,
long lastTimeConnectedMs) {
return RoboAssociationInfo.builder()
@@ -213,10 +219,10 @@
.setPackageName(packageName)
.setDeviceMacAddress(deviceMacAddress)
.setDisplayName(displayName)
- .setDeviceProfile(deviceProfile)
.setSelfManaged(selfManaged)
.setNotifyOnDeviceNearby(notifyOnDeviceNearby)
.setTimeApprovedMs(timeApprovedMs)
+ .setRevoked(revoked)
.setLastTimeConnectedMs(lastTimeConnectedMs)
.build();
}
@@ -240,6 +246,8 @@
public abstract Builder setNotifyOnDeviceNearby(boolean notifyOnDeviceNearby);
+ public abstract Builder setRevoked(boolean revoked);
+
public abstract Builder setTimeApprovedMs(long timeApprovedMs);
public abstract Builder setLastTimeConnectedMs(long lastTimeConnectedMs);