[DO NOT MERGE] Fix Conscrypt CTS for sc-v2-dev.

Background: Cherry-picks ag/15934029 and ag/15934004 were not
included in the release Mainline module for sc-v2.  They contain
one required bugfix b/191150645 for Android Auto (which does
not use Mainline) and some unrelated bug fixes which were in
the same upstream merge.  The end result is that sc-v2 CTS
would fail with a prebuilt Mainline Conscrypt module installed.
See b/209335673 for further details.

This change reverts all of ag/15934029 and ag/15934004 except
for the parts relating to b/191150645 and modifies the tests so
they will run with our without the Mainline module installed.
This involves skipping some additional tests added for
b/191150645 but still includes the main tests, i.e. that all
Providers' key factories inter-operate correctly.

Bug: 209335673
Bug: 191150645
Test: atest CtsLibcoreTestCases with and without the module installed.
Change-Id: Ic3a137bbc18429927354cc4094124fa5271d97a9
Merged-In: Ic3a137bbc18429927354cc4094124fa5271d97a9
diff --git a/build.gradle b/build.gradle
index 08b9ebd..162c491 100644
--- a/build.gradle
+++ b/build.gradle
@@ -165,8 +165,8 @@
     }
 
     if (!androidProject) {
-        sourceCompatibility = JavaVersion.VERSION_1_8
-        targetCompatibility = JavaVersion.VERSION_1_8
+        sourceCompatibility = JavaVersion.VERSION_1_7
+        targetCompatibility = JavaVersion.VERSION_1_7
 
         [tasks.named("compileJava"), tasks.named("compileTestJava")].forEach { t ->
             t.configure {