Stubs libraries android.test.mock.stubs and
android.test.mock.stubs-system are now built in Android.bp.
(Note that API check and update are still done in Android.mk)
As a good side effect, this allows android.test.runner[-minus-junit]
libraries (that are defined in Android.bp) to be built with the
android.test.mock.stubs instead of the runtime library
android.test.mock. This in turn allows us to prevent java:sdk ->
java:platform dependency also in Soong, because the runner libraries
were the only violators.
Bug: 73829976
Test: m -j android.test.mock.stubs android.test.mock.stubs-system
Test: m -j checkapi
Test: m -j update-api
Change-Id: I830a8eb13aa43b9aa4c8394f3c2fd91ee18b1f85
android.test.legacy is now build against SDK, thus available to apps
build with SDK.
In doing so, android.test.mock.stubs had to be built with SDK (because
it is used by android.test.legacy). However, this wasn't trivial.
The problem was that some classes in test-mock implemented abstract
methods of platform classes. Even though they are marked as @hide,
doclava automatically emit them to the stub file because otherwise the
class in the stub file does not implement some abstract methods from its
parent class, which in turn makes the stub file non-compilable.
This CL solves the problem by introducing an adapter class in between
the class in test-mock and the class in the framework. The adapter class
implements abstract methods which are @hide and having reference to
types that aren't available to SDK. The abstract methods are removed
from the original class. Then doclava does not emit the abstract
methods.
Also by @hide'ing the adapter classes, they are not compiled when
building the stub library.
Bug: 30188076
Bug: 73339598
Test: m -j android.test.base
Test: m -j android.test.legacy
Test: m -j android.test.mock.stubs
are successful and do not show link-check warning
Change-Id: I8e432950e693ee3c6f0240852e62da6133d31571
When generating the stubs for android.test.mock, the main framework
source is also included. The source in turn has references to the
conscrypt, okhttp, and bouncycastle ibraries (e.g. ActivityThread.java uses
com.android.org.conscrypt.OpenSSLSocketImpl).
Although this does not break the build because doclava does not abort on
non-existing symbols, this creates a lot of error messages to the log
output:
frameworks/base/test-mock/../core/java/android/app/ActivityThread.java:143: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.OpenSSLSocketImpl;
^
frameworks/base/test-mock/../core/java/android/app/ActivityThread.java:144: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.TrustedCertificateStore;
^
...
Therefore adding the missing libraries to the classpath to prevent the
scary messages.
Test: mma -j under frameworks/base/test-mock does not show the error
messages.
Change-Id: I899be8ff7466f9483e4f3ae8328bc9c72bbe22ed
The android.test.mock package contains one class with some methods that
are annotated with @SystemApi which are not present in the
android.test.mock.stubs. This adds a new android.test.mock.stubs-system
library that includes those additional methods.
Checked that the new API definition files contain the exact same
definitions for the android.test.mock packages as are found in the
api/system-current.txt and api/system-removed.txt files.
Bug: 30188076
Test: make update-api && make checkbuild
Change-Id: I4644d30716e556204caa4acb53d7af84ca520271
This ensures that the API definitions for the android.test.mock package
matches the definitions in the api/current.txt file.
Bug: 30188076
Test: make update-api
Change-Id: Id325b8cf2f189117ac4cfe7634095ab710eee004
The legacy-test library has been deprecated in favour of the
android.test.base library which is part of the SDK.
The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.
* core/tests/overlaytests/OverlayAppFiltered/Android.mk
Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
for module 'com.android.overlaytest.filtered_app_overlay' does not
depend on classes from legacy-test
* core/tests/overlaytests/OverlayAppFirst/Android.mk
Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
for module 'com.android.overlaytest.first_app_overlay' does not
depend on classes from legacy-test
* core/tests/overlaytests/OverlayAppSecond/Android.mk
Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
for module 'com.android.overlaytest.second_app_overlay' does not
depend on classes from legacy-test
* core/tests/overlaytests/OverlayTest/Android.mk
Replaced 'legacy-test' with 'android.test.base' in
LOCAL_JAVA_LIBRARIES because the source for module 'OverlayTest'
depends on classes from android.test.base
* core/tests/overlaytests/OverlayTestOverlay/Android.mk
Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
for module 'com.android.overlaytest.overlay' does not depend on
classes from legacy-test
* test-mock/Android.mk
Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
for module 'repackaged.android.test.mock' does not depend on
classes from legacy-test
Bug: 30188076
Test: make checkbuild
Change-Id: I729412304884cf5da88b05dbe8fbe645ad7b5b15
Make it consistent with the test-mock and test-runner directories.
Also renames the files in api/ subdirectory.
Bug: 30188076
Test: make checkbuild
Change-Id: If4f99a65fcca416ede5b3e63481398f0b451bcb7
Extracts the source for the android.test.mock library from the
frameworks/base/test-runner directory into its own
frameworks/base/test-mock directory. They are already treated separately
at runtime and compile time so this just makes the separation complete.
Bug: 30188076
Test: make checkbuild
Change-Id: I20e5b06ba79677e76117c82e9f9e2ecd15e5fed6