summaryrefslogtreecommitdiff
path: root/test-mock/src
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2020-03-09 15:49:01 -0600
committerJeff Sharkey <jsharkey@android.com>2020-03-10 16:36:21 -0600
commit8b0cff710816999fddd33d3591bc52c87600c095 (patch)
tree463ec67d993b5f6eb45ea24ad024a76368510255 /test-mock/src
parentf46b9c9656a28732d12efee205fbf4bb2acf2b87 (diff)
Give hidden API behavior to legacy apps.
Starting in R, there is a new public API overload that delivers a flags argument. Some apps may be relying on a previous hidden API that delivered a userId argument, and this change is used to control delivery of the new flags argument in its place. There are dozens of these hidden API users are in the system UID, either in the system process or the Settings app, so we hard-code giving them the legacy behavior, since refactoring would be messy between internal and AOSP branches. Also adjust incoming and outgoing method signatures to use slightly more flexible Collection<Uri>, which has handy methods like contains() and isEmpty(). Bug: 150939131 Test: atest --test-mapping packages/providers/MediaProvider Test: atest FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest Exempt-From-Owner-Approval: trivial refactoring Change-Id: If6a77449e19215cf1c60d4217e62fc04b0959bfc
Diffstat (limited to 'test-mock/src')
-rw-r--r--test-mock/src/android/test/mock/MockContentResolver.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/test-mock/src/android/test/mock/MockContentResolver.java b/test-mock/src/android/test/mock/MockContentResolver.java
index 8283019a10ec..8f4bcccb0cba 100644
--- a/test-mock/src/android/test/mock/MockContentResolver.java
+++ b/test-mock/src/android/test/mock/MockContentResolver.java
@@ -25,6 +25,7 @@ import android.content.IContentProvider;
import android.database.ContentObserver;
import android.net.Uri;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -172,7 +173,7 @@ public class MockContentResolver extends ContentResolver {
* from observers elsewhere in the system.
*/
@Override
- public void notifyChange(@NonNull Iterable<Uri> uris, @Nullable ContentObserver observer,
+ public void notifyChange(@NonNull Collection<Uri> uris, @Nullable ContentObserver observer,
@NotifyFlags int flags) {
}
}