diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowAppOpsManager.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowAppOpsManager.java index 9e44aefc266..d2222d676c7 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowAppOpsManager.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowAppOpsManager.java @@ -59,7 +59,7 @@ import org.robolectric.util.ReflectionHelpers; import org.robolectric.util.ReflectionHelpers.ClassParameter; -@Implements(value = AppOpsManager.class) +@Implements(value = AppOpsManager.class, looseSignatures = true) public class ShadowAppOpsManager { // OpEntry fields that the shadow doesn't currently allow the test to configure. @@ -399,15 +399,18 @@ protected int noteProxyOpNoThrow( @RequiresApi(api = Build.VERSION_CODES.S) @Implementation(minSdk = Build.VERSION_CODES.S) protected int noteProxyOpNoThrow( - int op, Object attributionSource, String message, boolean ignoredSkipProxyOperation) { + Object op, Object attributionSource, Object message, Object ignoredSkipProxyOperation) { + Preconditions.checkArgument(op instanceof Integer); Preconditions.checkArgument(attributionSource instanceof AttributionSource); + Preconditions.checkArgument(message == null || message instanceof String); + Preconditions.checkArgument(ignoredSkipProxyOperation instanceof Boolean); AttributionSource castedAttributionSource = (AttributionSource) attributionSource; return noteProxyOpNoThrow( - op, + (int) op, castedAttributionSource.getNextPackageName(), castedAttributionSource.getNextUid(), castedAttributionSource.getNextAttributionTag(), - message); + (String) message); } @Implementation(minSdk = KITKAT)