Refactor signature compliance checking code

Refactor the signature compliance checking code to make it easier to
reuse different parts by providing a clear separation of concerns and
removing duplicated code.

The IntentTest and SignatureTest both share some code for processing an
API description file into JDiffClassDescription objects. That code is
extracted into the ApiDocumentParser class. The only main difference
between the two usages is that SignatureTest checks the
JDiffClassDescription against the accessible runtime Class object
whereas IntentTest extracts values of some fields.

That code difference is abstracted away behind the
ApiDocumentParser.Listener interface whose completedClass(...) method is
invoked with a JDiffClassDescription, fully populated with information
about its members.

JClassDiffDescription fulfilled two separate roles:
1) Providing a representation of the API
2) Checking runtime compliance with the API description.

The latter itself consisted of two parts, finding the runtime element
(e.g. class, method, etc.) using reflection and then comparing the
runtime element against its description. These were extracted out into
ReflectionHelper and ApiComplianceChecker classes respectively.

Various formatting and structural issues in the code were cleaned up.

Tested using:
    m -j32 CtsApiSignatureTestCases && \
        cts-tradefed run cts -a arm64-v8a -m CtsApiSignatureTestCases
And:
    m -j32 CtsIntentSignatureTestCases && \
        cts-tradefed run cts -a arm64-v8a -m CtsIntentSignatureTestCases
And:
    m -j32 signature-hostside signature-tests && \
        cts/tests/signature/tests/signature/run_unit_tests.sh

Bug: 35192974
Bug: 30188076
Test: see above
Change-Id: Id9ca8c93372d6e89f59eed55db5a96c2f3e17b32
10 files changed