DO NOT MERGE - Mark RQ3A.210410.001 as merged

Bug: 190855093
Merged-In: I58f4cd524010ea13d2437abb6bf37cbea0b9f528
Change-Id: I49ad331affe9b532dc28161a4b0babf52bd18d1d
diff --git a/Android.bp b/Android.bp
index f00cf8e..8ab10a5 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_package_root {
     name: "android.frameworks",
 }
diff --git a/OWNERS b/OWNERS
index 70e48e5..2488b0f 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,8 +1 @@
-per-file *.hal,*.aidl,OWNERS = set noparent
-per-file *.hal,*.aidl,OWNERS = elsk@google.com,malchev@google.com,smoreland@google.com
-
-elsk@google.com
-maco@google.com
-malchev@google.com
-smoreland@google.com
-yim@google.com # VTS
+include platform/hardware/interfaces:/OWNERS
diff --git a/automotive/display/1.0/Android.bp b/automotive/display/1.0/Android.bp
index 28e1f22..4074b77 100644
--- a/automotive/display/1.0/Android.bp
+++ b/automotive/display/1.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.automotive.display@1.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
         "IAutomotiveDisplayProxyService.hal",
diff --git a/automotive/display/1.0/vts/functional/Android.bp b/automotive/display/1.0/vts/functional/Android.bp
index ce87e37..7e14e58 100644
--- a/automotive/display/1.0/vts/functional/Android.bp
+++ b/automotive/display/1.0/vts/functional/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_test {
     name: "VtsHalAutomotiveDisplayV1_0TargetTest",
     srcs: [
diff --git a/bufferhub/1.0/Android.bp b/bufferhub/1.0/Android.bp
index 741709f..2c5aa0a 100644
--- a/bufferhub/1.0/Android.bp
+++ b/bufferhub/1.0/Android.bp
@@ -1,5 +1,9 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.bufferhub@1.0",
     root: "android.frameworks",
@@ -15,4 +19,8 @@
         "android.hidl.base@1.0",
     ],
     gen_java: true,
+    apex_available: [
+        "com.android.media.swcodec",
+        "//apex_available:platform",
+    ],
 }
diff --git a/bufferhub/1.0/README.md b/bufferhub/1.0/README.md
deleted file mode 100644
index bbc8a7b..0000000
--- a/bufferhub/1.0/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Why is this marked as '.hidl_for_test'?
-
-This is used to explicitly exclude the interface from the VNDK. Disallow direct vendor access
-as this interface should only be used by the Android platform. Vendors should use
-libnativewindow ll-ndk API to access BufferHub.
diff --git a/bufferhub/1.0/vts/functional/Android.bp b/bufferhub/1.0/vts/functional/Android.bp
index a5f8463..f936850 100644
--- a/bufferhub/1.0/vts/functional/Android.bp
+++ b/bufferhub/1.0/vts/functional/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_test {
     name: "VtsHalBufferHubV1_0TargetTest",
     defaults: [
@@ -43,4 +47,3 @@
         "-g",
     ]
 }
-
diff --git a/cameraservice/common/2.0/Android.bp b/cameraservice/common/2.0/Android.bp
index b58d2fc..507b22c 100644
--- a/cameraservice/common/2.0/Android.bp
+++ b/cameraservice/common/2.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.cameraservice.common@2.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
     ],
diff --git a/cameraservice/device/2.0/Android.bp b/cameraservice/device/2.0/Android.bp
index a37ac64..21162b7 100644
--- a/cameraservice/device/2.0/Android.bp
+++ b/cameraservice/device/2.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.cameraservice.device@2.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
         "ICameraDeviceCallback.hal",
diff --git a/cameraservice/service/2.0/Android.bp b/cameraservice/service/2.0/Android.bp
index 8e04217..e2311f6 100644
--- a/cameraservice/service/2.0/Android.bp
+++ b/cameraservice/service/2.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.cameraservice.service@2.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
         "ICameraService.hal",
diff --git a/cameraservice/service/2.1/Android.bp b/cameraservice/service/2.1/Android.bp
index a45b814..a1a7c73 100644
--- a/cameraservice/service/2.1/Android.bp
+++ b/cameraservice/service/2.1/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.cameraservice.service@2.1",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
         "ICameraService.hal",
diff --git a/cameraservice/vts/functional/Android.bp b/cameraservice/vts/functional/Android.bp
index b45c61d..32189bf 100644
--- a/cameraservice/vts/functional/Android.bp
+++ b/cameraservice/vts/functional/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_test {
     name: "VtsHalCameraServiceV2_0TargetTest",
     defaults: ["VtsHalTargetTestDefaults"],
@@ -39,10 +43,5 @@
         //       (http://b/123320603). This is needed for libmediandk's llndk only api.
         "-D__ANDROID_VNDK__",
     ],
-    auto_gen_config: true,
     test_suites: ["vts"],
 }
-
-vts_config {
-    name: "VtsHalCameraServiceV2_0Target",
-}
diff --git a/cameraservice/vts/functional/AndroidTest.xml b/cameraservice/vts/functional/AndroidTest.xml
deleted file mode 100644
index 10b0925..0000000
--- a/cameraservice/vts/functional/AndroidTest.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<configuration description="Config for VTS VtsHalCameraServiceV2_0* test cases">
-    <option name="config-descriptor:metadata" key="plan" value="vts-treble" />
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
-        <option name="abort-on-push-failure" value="false"/>
-        <option name="push-group" value="HalHidlTargetTest.push"/>
-    </target_preparer>
-    <multi_target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
-    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
-        <option name="test-module-name" value="VtsHalCameraServiceV2_0Target"/>
-        <option name="binary-test-working-directory" value="_32bit::/data/nativetest/" />
-        <option name="binary-test-working-directory" value="_64bit::/data/nativetest64/" />
-        <option name="binary-test-source" value="_32bit::DATA/nativetest/VtsHalCameraServiceV2_0TargetTest/VtsHalCameraServiceV2_0TargetTest" />
-        <option name="binary-test-source" value="_64bit::DATA/nativetest64/VtsHalCameraServiceV2_0TargetTest/VtsHalCameraServiceV2_0TargetTest" />
-        <option name="binary-test-type" value="gtest"/>
-        <option name="test-timeout" value="5m"/>
-    </test>
-</configuration>
diff --git a/displayservice/1.0/Android.bp b/displayservice/1.0/Android.bp
index 0ce1732..fa4a4b9 100644
--- a/displayservice/1.0/Android.bp
+++ b/displayservice/1.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.displayservice@1.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
         "IDisplayEventReceiver.hal",
diff --git a/displayservice/1.0/vts/functional/Android.bp b/displayservice/1.0/vts/functional/Android.bp
index 40a9092..02f7c73 100644
--- a/displayservice/1.0/vts/functional/Android.bp
+++ b/displayservice/1.0/vts/functional/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_test {
     name: "VtsFwkDisplayServiceV1_0TargetTest",
     defaults: ["VtsHalTargetTestDefaults"],
@@ -29,4 +33,3 @@
     ],
     test_suites: ["vts"],
 }
-
diff --git a/schedulerservice/1.0/Android.bp b/schedulerservice/1.0/Android.bp
index 7dbfb17..1ee7dcf 100644
--- a/schedulerservice/1.0/Android.bp
+++ b/schedulerservice/1.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.schedulerservice@1.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "ISchedulingPolicyService.hal",
     ],
diff --git a/sensorservice/1.0/Android.bp b/sensorservice/1.0/Android.bp
index a7d6d50..3b2b73e 100644
--- a/sensorservice/1.0/Android.bp
+++ b/sensorservice/1.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.sensorservice@1.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
         "IDirectReportChannel.hal",
diff --git a/sensorservice/1.0/vts/OWNERS b/sensorservice/1.0/vts/OWNERS
new file mode 100644
index 0000000..90c2330
--- /dev/null
+++ b/sensorservice/1.0/vts/OWNERS
@@ -0,0 +1,3 @@
+arthuri@google.com
+bduddie@google.com
+stange@google.com
diff --git a/sensorservice/1.0/vts/functional/Android.bp b/sensorservice/1.0/vts/functional/Android.bp
index cca3999..feb01ab 100644
--- a/sensorservice/1.0/vts/functional/Android.bp
+++ b/sensorservice/1.0/vts/functional/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_test {
     name: "VtsHalSensorManagerV1_0TargetTest",
     defaults: ["hidl_defaults"],
diff --git a/sensorservice/libsensorndkbridge/Android.bp b/sensorservice/libsensorndkbridge/Android.bp
index a2b5061..33b9619 100644
--- a/sensorservice/libsensorndkbridge/Android.bp
+++ b/sensorservice/libsensorndkbridge/Android.bp
@@ -12,6 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_shared {
     name: "libsensorndkbridge",
     proprietary: true,
diff --git a/sensorservice/libsensorndkbridge/OWNERS b/sensorservice/libsensorndkbridge/OWNERS
new file mode 100644
index 0000000..90c2330
--- /dev/null
+++ b/sensorservice/libsensorndkbridge/OWNERS
@@ -0,0 +1,3 @@
+arthuri@google.com
+bduddie@google.com
+stange@google.com
diff --git a/stats/1.0/Android.bp b/stats/1.0/Android.bp
index aa4d500..5488b87 100644
--- a/stats/1.0/Android.bp
+++ b/stats/1.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.stats@1.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: true,
-    },
     srcs: [
         "types.hal",
         "IStats.hal",
diff --git a/stats/1.0/test_client/Android.bp b/stats/1.0/test_client/Android.bp
index 85d2882..6f323a1 100644
--- a/stats/1.0/test_client/Android.bp
+++ b/stats/1.0/test_client/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary {
     name: "stats_client",
     srcs: [
@@ -11,4 +15,3 @@
         "android.frameworks.stats@1.0",
     ],
 }
-
diff --git a/stats/1.0/vts/functional/Android.bp b/stats/1.0/vts/functional/Android.bp
index 0d8a7fb..4259123 100644
--- a/stats/1.0/vts/functional/Android.bp
+++ b/stats/1.0/vts/functional/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_test {
     name: "VtsHalStatsV1_0TargetTest",
     defaults: ["VtsHalTargetTestDefaults"],
diff --git a/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp b/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp
index 2aa675e..b1a0cd2 100644
--- a/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp
+++ b/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp
@@ -48,7 +48,7 @@
     sp<IStats> client;
 };
 
-// Sanity check IStats::reportSpeakerImpedance.
+// Validate IStats::reportSpeakerImpedance.
 TEST_P(StatsHidlTest, reportSpeakerImpedance) {
     SpeakerImpedance impedance = {.speakerLocation = 0,
                                   .milliOhms = static_cast<int32_t>(1234 * 1000)};
@@ -57,7 +57,7 @@
     ASSERT_TRUE(ret.isOk());
 }
 
-// Sanity check IStats::reportHardwareFailed.
+// Validate IStats::reportHardwareFailed.
 TEST_P(StatsHidlTest, reportHardwareFailed) {
     HardwareFailed failed = {.hardwareType = HardwareFailed::HardwareType::CODEC,
                              .hardwareLocation = 0,
@@ -68,7 +68,7 @@
     ASSERT_TRUE(ret.isOk());
 }
 
-// Sanity check IStats::reportChargeCycles.
+// Validate IStats::reportChargeCycles.
 TEST_P(StatsHidlTest, reportChargeCycles) {
     std::vector<int> charge_cycles = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
     ChargeCycles cycles;
@@ -79,7 +79,7 @@
     ASSERT_TRUE(ret.isOk());
 }
 
-// Sanity check IStats::reportBatteryHealthSnapshot.
+// Validate IStats::reportBatteryHealthSnapshot.
 TEST_P(StatsHidlTest, reportBatteryHealthSnapshot) {
     BatteryHealthSnapshotArgs args{.temperatureDeciC = 3000,
                                    .voltageMicroV = 1,
@@ -94,7 +94,7 @@
     ASSERT_TRUE(ret.isOk());
 }
 
-// Sanity check IStats::reportSlowIo.
+// Validate IStats::reportSlowIo.
 TEST_P(StatsHidlTest, reportSlowIo) {
     SlowIo slowio = {.operation = SlowIo::IoOperation::READ, .count = 5};
 
@@ -104,7 +104,7 @@
     ASSERT_TRUE(ret.isOk());
 }
 
-// Sanity check IStats::reportBatteryCausedShutdown.
+// Validate IStats::reportBatteryCausedShutdown.
 TEST_P(StatsHidlTest, reportBatteryCausedShutdown) {
     BatteryCausedShutdown shutdown = {.voltageMicroV = 3};
 
@@ -113,7 +113,7 @@
     ASSERT_TRUE(ret.isOk());
 }
 
-// Sanity check IStats::reportUsbPortOverheatEvent.
+// Validate IStats::reportUsbPortOverheatEvent.
 TEST_P(StatsHidlTest, reportUsbPortOverheatEvent) {
     UsbPortOverheatEvent event = {.plugTemperatureDeciC = 210,
                                   .maxTemperatureDeciC = 220,
@@ -126,7 +126,7 @@
     ASSERT_TRUE(ret.isOk());
 }
 
-// Sanity check IStats::reportVendorAtom.
+// Validate IStats::reportVendorAtom.
 TEST_P(StatsHidlTest, reportVendorAtom) {
     std::vector<Value> values;
     Value tmp;
diff --git a/vr/composer/1.0/Android.bp b/vr/composer/1.0/Android.bp
index e064ba5..3c91185 100644
--- a/vr/composer/1.0/Android.bp
+++ b/vr/composer/1.0/Android.bp
@@ -1,11 +1,12 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.vr.composer@1.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: false,
-    },
     srcs: [
         "IVrComposerClient.hal",
     ],
diff --git a/bufferhub/1.0/.hidl_for_test b/vr/composer/2.0/.hidl_for_system_ext
similarity index 100%
rename from bufferhub/1.0/.hidl_for_test
rename to vr/composer/2.0/.hidl_for_system_ext
diff --git a/vr/composer/2.0/Android.bp b/vr/composer/2.0/Android.bp
index d1d5632..83e4a3b 100644
--- a/vr/composer/2.0/Android.bp
+++ b/vr/composer/2.0/Android.bp
@@ -1,11 +1,13 @@
 // This file is autogenerated by hidl-gen -Landroidbp.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 hidl_interface {
     name: "android.frameworks.vr.composer@2.0",
     root: "android.frameworks",
-    vndk: {
-        enabled: false,
-    },
+    system_ext_specific: true,
     srcs: [
         "IVrComposerClient.hal",
     ],