summaryrefslogtreecommitdiff
path: root/test-mock
diff options
context:
space:
mode:
Diffstat (limited to 'test-mock')
-rw-r--r--test-mock/Android.bp13
-rw-r--r--test-mock/src/android/test/mock/MockContext.java15
2 files changed, 23 insertions, 5 deletions
diff --git a/test-mock/Android.bp b/test-mock/Android.bp
index 460a26d63cd6..22320fd53631 100644
--- a/test-mock/Android.bp
+++ b/test-mock/Android.bp
@@ -27,12 +27,13 @@ package {
java_sdk_library {
name: "android.test.mock",
-
- srcs: [
- ":android-test-mock-sources",
+ srcs: [":android-test-mock-sources"],
+ api_srcs: [
// Note: Below are NOT APIs of this library. We only take APIs under
// the android.test.mock package. They however provide private APIs that
- // android.test.mock APIs references to.
+ // android.test.mock APIs references to. We need to have the classes in
+ // source code form to have access to the @hide comment which disappears
+ // when the classes are compiled into a Jar library.
":framework-core-sources-for-test-mock",
":framework_native_aidl",
],
@@ -42,10 +43,12 @@ java_sdk_library {
"app-compat-annotations",
"unsupportedappusage",
],
-
api_packages: [
"android.test.mock",
],
+ permitted_packages: [
+ "android.test.mock",
+ ],
compile_dex: true,
default_to_stubs: true,
dist_group: "android",
diff --git a/test-mock/src/android/test/mock/MockContext.java b/test-mock/src/android/test/mock/MockContext.java
index 7a1dda37de70..49daad324bd1 100644
--- a/test-mock/src/android/test/mock/MockContext.java
+++ b/test-mock/src/android/test/mock/MockContext.java
@@ -573,11 +573,26 @@ public class MockContext extends Context {
/** @hide */
@Override
+ @SystemApi
+ public Intent registerReceiverForAllUsers(BroadcastReceiver receiver,
+ IntentFilter filter, String broadcastPermission, Handler scheduler, int flags) {
+ throw new UnsupportedOperationException();
+ }
+
+ /** @hide */
+ @Override
public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
IntentFilter filter, String broadcastPermission, Handler scheduler) {
throw new UnsupportedOperationException();
}
+ /** @hide */
+ @Override
+ public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
+ IntentFilter filter, String broadcastPermission, Handler scheduler, int flags) {
+ throw new UnsupportedOperationException();
+ }
+
@Override
public void unregisterReceiver(BroadcastReceiver receiver) {
throw new UnsupportedOperationException();