AndroidTestCase.[set|get]TestContext are added as APIs

android.test.runner is using AndroidTestCase.[set|get]TestContext
methods from android.test.base. The problem is that the methods are
internal APIs and this is preventing us from hiding the impl library of
android.test.base to others.

Marking those two methods as APIs.

Bug: 157007292
Test: m
Test: android.test.runner

Change-Id: I8ea5421723a4a40d580956e5ceb51be70253f0eb
This commit is contained in:
Jiyong Park 2020-06-01 10:56:48 +09:00
parent ed6b129e16
commit 04f520d136
2 changed files with 3 additions and 2 deletions

View File

@ -7,8 +7,10 @@ package android.test {
method @Deprecated public void assertReadingContentUriRequiresPermission(android.net.Uri, String);
method @Deprecated public void assertWritingContentUriRequiresPermission(android.net.Uri, String);
method @Deprecated public android.content.Context getContext();
method @Deprecated public android.content.Context getTestContext();
method @Deprecated protected void scrubClass(Class<?>) throws java.lang.IllegalAccessException;
method @Deprecated public void setContext(android.content.Context);
method @Deprecated public void setTestContext(android.content.Context);
method @Deprecated @android.test.suitebuilder.annotation.Suppress public void testAndroidTestCaseSetupProperly();
field @Deprecated protected android.content.Context mContext;
}

View File

@ -71,14 +71,13 @@ public class AndroidTestCase extends TestCase {
* latter is provided by the context set with the {@link #setContext}
* method.
*
* @hide
*/
public void setTestContext(Context context) {
mTestContext = context;
}
/**
* @hide
* Returns the test context that was set via {@link #setTestContext(Context)}.
*/
public Context getTestContext() {
return mTestContext;