summaryrefslogtreecommitdiff
path: root/test-mock/src/android/test/mock
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2020-05-29 10:51:18 +0900
committerJiyong Park <jiyong@google.com>2020-06-25 08:08:40 +0900
commitb4e458d1063a3ece9a7f539ed6dbaeb6fb9c495d (patch)
tree396a48975f40319da149d7aa25a9101578315d92 /test-mock/src/android/test/mock
parent2852591c40948f5cd0bc053e65b8b14df150c354 (diff)
Don't use impl lib of android.test.[mock|base|runners]
The java_sdk_library modules are now added with 'default_to_stubs: true' so that their impl libraries are not used even when the clients don't have sdk_version property set. This will allow us to replace the direct references to the stub libraries of the java_sdk_library modules with the references to the modules themselves (e.g. android.test.base.stubs -> android.test.base) in many of the CTS tests without unintentionally exposing the private APIs in the impl lib. As part of the change, MockContentProvider.getIContentProviderBinder() now returns an anonymous Binder object instead of throwing an exception. This is to eliminate the need for clients to override the now inaccessible method to escape from the exception. Also, InstrumentationTestRunner.addTestListener method is added to the stub because it is used by several tests (MtpServiceTests, etc.) Bug: 157007292 Test: m Change-Id: I14cf217f21fd3534c920c3a6336cf2d14c02e60c
Diffstat (limited to 'test-mock/src/android/test/mock')
-rw-r--r--test-mock/src/android/test/mock/MockContentProvider.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/test-mock/src/android/test/mock/MockContentProvider.java b/test-mock/src/android/test/mock/MockContentProvider.java
index d1d64d39b688..a5c254f1aca2 100644
--- a/test-mock/src/android/test/mock/MockContentProvider.java
+++ b/test-mock/src/android/test/mock/MockContentProvider.java
@@ -33,6 +33,7 @@ import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
+import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.ICancellationSignal;
@@ -336,7 +337,7 @@ public class MockContentProvider extends ContentProvider {
* @hide
*/
public IBinder getIContentProviderBinder() {
- throw new UnsupportedOperationException("unimplemented mock method");
+ return new Binder();
}
/**