Expand the number of signature tests

Replaces CtsApiSignatureTestCases which tests whether the runtime seen
by an app that has <uses-library android:name="android.test.runner"/> in
its manifest provides the API in frameworks/bases/api/current.txt with a
number of tests that test different app configurations.

CtsCurrentApiSignatureTestCases
    tests that an app that is targeted at the current API level and does
    not have any <uses-library> entries in its manifest can access the
    API described in frameworks/base/api/current.txt - excluding APIs
    provided by the android.test.runner and android.test.mock libraries.

CtsSystemCurrentApiSignatureTestCases
    tests that an app that is targeted at the current API level and does
    not have any <uses-library> entries in its manifest can access the
    API described in frameworks/base/api/system-current.txt - excluding
    APIs provided by the android.test.runner and android.test.mock
    libraries.

CtsAndroidTestMockCurrentApiSignatureTestCases
    tests that an app that is targeted at the current API level and has
    <uses-library android:name="android.test.mock"/> in its manifest can
    access the API described in
    frameworks/base/test-runner/api/android-test-mock-current.txt.

CtsAndroidTestRunnerCurrentApiSignatureTestCases
    tests that an app that is targeted at the current API level and has
    <uses-library android:name="android.test.runner"/> in its manifest
    can access the API described in
    frameworks/base/test-runner/api/android-test-runner-current.txt and
    in frameworks/base/test-runner/api/android-test-mock-current.txt.

CtsLegacyTest26ApiSignatureTestCases
    tests that an app that is targeted at API level 26 can access the
    API described in
    frameworks/base/legacy-test/api/legacy-test-current.txt.

Adds tests/signature/runSignatureTests.sh to run the above tests.

The rest of the changes are made to support the above tests:
* Changes SignatureTest and other Java files to support providing an API
  description file containing classes that are not expected to be
  accessible to the application. This is used to ensure that optional
  classes are not visible unless specifically requested.

* Generates additional *.api files for use by the above tests.

* Refactors the makefiles for generating *.api files and building test
  APKs to extract the common behavior into separate reusable *.mk files
  to reduce duplication.

Bug: 35192974
Bug: 30188076
Test: ran tests/signature/runSignatureTests.sh
Change-Id: Ibb178052a6098e4b42921067ae8ec86d6e7cb379
24 files changed