Merge "Update USB HAL to V1.2 implementation"
diff --git a/Android.bp b/Android.bp
index 913278a..1b02430 100644
--- a/Android.bp
+++ b/Android.bp
@@ -5,3 +5,34 @@
         "hardware/qcom/bootctrl",
     ],
 }
+
+package {
+    default_applicable_licenses: ["device_google_bonito_license"],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'fileGroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// See: http://go/android-license-faq
+license {
+    name: "device_google_bonito_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+        "SPDX-license-identifier-BSD",
+        "SPDX-license-identifier-GPL-2.0",
+        "SPDX-license-identifier-MIT",
+        "legacy_unencumbered",
+    ],
+    // large-scale-change unable to identify any license_text files
+}
diff --git a/bonito/overlay_packages/SettingsOverlayG020A/Android.bp b/bonito/overlay_packages/SettingsOverlayG020A/Android.bp
index 0905e76..bc7be5c 100644
--- a/bonito/overlay_packages/SettingsOverlayG020A/Android.bp
+++ b/bonito/overlay_packages/SettingsOverlayG020A/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020A",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/bonito/overlay_packages/SettingsOverlayG020B/Android.bp b/bonito/overlay_packages/SettingsOverlayG020B/Android.bp
index 139ee73..df606df 100644
--- a/bonito/overlay_packages/SettingsOverlayG020B/Android.bp
+++ b/bonito/overlay_packages/SettingsOverlayG020B/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020B",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/bonito/overlay_packages/SettingsOverlayG020C/Android.bp b/bonito/overlay_packages/SettingsOverlayG020C/Android.bp
index b2b33b1..f4731f9 100644
--- a/bonito/overlay_packages/SettingsOverlayG020C/Android.bp
+++ b/bonito/overlay_packages/SettingsOverlayG020C/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020C",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/bonito/overlay_packages/SettingsOverlayG020D/Android.bp b/bonito/overlay_packages/SettingsOverlayG020D/Android.bp
index 033e3aa..bd88176 100644
--- a/bonito/overlay_packages/SettingsOverlayG020D/Android.bp
+++ b/bonito/overlay_packages/SettingsOverlayG020D/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020D",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/bootctrl/Android.bp b/bootctrl/Android.bp
index 9dcf767..e990ba1 100644
--- a/bootctrl/Android.bp
+++ b/bootctrl/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library {
     name: "bootctrl.sdm710",
     defaults: ["bootctrl_hal_defaults"],
diff --git a/dumpstate/Android.mk b/dumpstate/Android.mk
index 76c889b..6e7a539 100644
--- a/dumpstate/Android.mk
+++ b/dumpstate/Android.mk
@@ -17,6 +17,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 LOCAL_MODULE := android.hardware.dumpstate@1.1-service.bonito
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_INIT_RC := android.hardware.dumpstate@1.1-service.bonito.rc
 LOCAL_MODULE_RELATIVE_PATH := hw
 
diff --git a/gpt-utils/Android.bp b/gpt-utils/Android.bp
index 271e945..f599f1a 100644
--- a/gpt-utils/Android.bp
+++ b/gpt-utils/Android.bp
@@ -14,6 +14,15 @@
 // limitations under the License.
 //
 
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_google_bonito_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["device_google_bonito_license"],
+}
+
 cc_library {
     name: "libgptutils.bonito",
     vendor: true,
diff --git a/health/Android.bp b/health/Android.bp
index 9eb609f..8e1ab48 100644
--- a/health/Android.bp
+++ b/health/Android.bp
@@ -14,6 +14,10 @@
  * limitations under the License.
  */
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary {
     name: "android.hardware.health@2.0-service.bonito",
     init_rc: ["android.hardware.health@2.0-service.bonito.rc"],
diff --git a/json-c/Android.mk b/json-c/Android.mk
index 9cd1e23..1e04f3c 100644
--- a/json-c/Android.mk
+++ b/json-c/Android.mk
@@ -1,6 +1,9 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 LOCAL_MODULE := libjson
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-MIT legacy_unencumbered
+LOCAL_LICENSE_CONDITIONS := notice unencumbered
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/COPYING
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 LOCAL_SRC_FILES := arraylist.c \
 		debug.c \
diff --git a/keymaster/Android.bp b/keymaster/Android.bp
index 674c101..dc70586 100644
--- a/keymaster/Android.bp
+++ b/keymaster/Android.bp
@@ -12,6 +12,10 @@
 // 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.
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary {
     name: "wait_for_strongbox",
     relative_install_path: "hw",
diff --git a/pixelstats/Android.bp b/pixelstats/Android.bp
index dadea9d..ead8673 100644
--- a/pixelstats/Android.bp
+++ b/pixelstats/Android.bp
@@ -13,6 +13,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary {
   name: "pixelstats-vendor",
   init_rc: ["pixelstats-vendor.bonito.rc"],
@@ -34,4 +38,3 @@
   ],
   header_libs: ["chre_api"],
 }
-
diff --git a/powerstats/Android.bp b/powerstats/Android.bp
index ad273df..d7b5a2b 100644
--- a/powerstats/Android.bp
+++ b/powerstats/Android.bp
@@ -12,6 +12,10 @@
 // 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.
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary {
     name: "android.hardware.power.stats@1.0-service.pixel",
     relative_install_path: "hw",
diff --git a/rro_overlays/WifiOverlay/Android.bp b/rro_overlays/WifiOverlay/Android.bp
index c2089a1..3929ea9 100644
--- a/rro_overlays/WifiOverlay/Android.bp
+++ b/rro_overlays/WifiOverlay/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "WifiOverlay",
     theme: "WifiOverlay",
diff --git a/sargo/overlay_packages/SettingsOverlayG020E/Android.bp b/sargo/overlay_packages/SettingsOverlayG020E/Android.bp
index bd9ad01..ebaa5c2 100644
--- a/sargo/overlay_packages/SettingsOverlayG020E/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020E/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020E",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sargo/overlay_packages/SettingsOverlayG020E_VN/Android.bp b/sargo/overlay_packages/SettingsOverlayG020E_VN/Android.bp
index dc422bc..d4907cf 100644
--- a/sargo/overlay_packages/SettingsOverlayG020E_VN/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020E_VN/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020E_VN",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sargo/overlay_packages/SettingsOverlayG020F/Android.bp b/sargo/overlay_packages/SettingsOverlayG020F/Android.bp
index 22d7132..578209a 100644
--- a/sargo/overlay_packages/SettingsOverlayG020F/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020F/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020F",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sargo/overlay_packages/SettingsOverlayG020F_VN/Android.bp b/sargo/overlay_packages/SettingsOverlayG020F_VN/Android.bp
index f158bc9..f469305 100644
--- a/sargo/overlay_packages/SettingsOverlayG020F_VN/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020F_VN/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020F_VN",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sargo/overlay_packages/SettingsOverlayG020G/Android.bp b/sargo/overlay_packages/SettingsOverlayG020G/Android.bp
index 1922cce..8d17e62 100644
--- a/sargo/overlay_packages/SettingsOverlayG020G/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020G/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020G",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sargo/overlay_packages/SettingsOverlayG020G_VN/Android.bp b/sargo/overlay_packages/SettingsOverlayG020G_VN/Android.bp
index 5aea994..1e71af2 100644
--- a/sargo/overlay_packages/SettingsOverlayG020G_VN/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020G_VN/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020G_VN",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sargo/overlay_packages/SettingsOverlayG020H/Android.bp b/sargo/overlay_packages/SettingsOverlayG020H/Android.bp
index 98a401c..e04eb93 100644
--- a/sargo/overlay_packages/SettingsOverlayG020H/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020H/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020H",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sargo/overlay_packages/SettingsOverlayG020H_VN/Android.bp b/sargo/overlay_packages/SettingsOverlayG020H_VN/Android.bp
index 1096140..e5f9c3b 100644
--- a/sargo/overlay_packages/SettingsOverlayG020H_VN/Android.bp
+++ b/sargo/overlay_packages/SettingsOverlayG020H_VN/Android.bp
@@ -1,4 +1,8 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 runtime_resource_overlay {
     name: "SettingsOverlayG020H_VN",
     product_specific: true,
-}
\ No newline at end of file
+}
diff --git a/sdm710/thermal-engine/Android.mk b/sdm710/thermal-engine/Android.mk
index 5e477c6..12de449 100644
--- a/sdm710/thermal-engine/Android.mk
+++ b/sdm710/thermal-engine/Android.mk
@@ -7,6 +7,8 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := libThermal_headers
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 LOCAL_VENDOR_MODULE := true
 include $(BUILD_HEADER_LIBRARY)
diff --git a/self-extractors/qcom/staging/Android.mk b/self-extractors/qcom/staging/Android.mk
index 7c88157..4ffd0cf 100644
--- a/self-extractors/qcom/staging/Android.mk
+++ b/self-extractors/qcom/staging/Android.mk
@@ -4,6 +4,9 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
 LOCAL_MODULE := ims
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYRIGHT $(LOCAL_PATH)/../LICENSE
 LOCAL_MODULE_TAGS := optional
 LOCAL_BUILT_MODULE_STEM := package.apk
 LOCAL_MODULE_OWNER := qcom
@@ -15,6 +18,9 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
 LOCAL_MODULE := QtiTelephonyService
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYRIGHT $(LOCAL_PATH)/../LICENSE
 LOCAL_MODULE_TAGS := optional
 LOCAL_BUILT_MODULE_STEM := package.apk
 LOCAL_MODULE_OWNER := qcom
@@ -23,4 +29,3 @@
 LOCAL_CERTIFICATE := platform
 include $(BUILD_PREBUILT)
 endif
-
diff --git a/self-extractors_sargo/qcom/staging/Android.mk b/self-extractors_sargo/qcom/staging/Android.mk
index 9d76fef..577d632 100644
--- a/self-extractors_sargo/qcom/staging/Android.mk
+++ b/self-extractors_sargo/qcom/staging/Android.mk
@@ -4,6 +4,9 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
 LOCAL_MODULE := ims
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYRIGHT $(LOCAL_PATH)/../LICENSE
 LOCAL_MODULE_TAGS := optional
 LOCAL_BUILT_MODULE_STEM := package.apk
 LOCAL_MODULE_OWNER := qcom
@@ -15,6 +18,9 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
 LOCAL_MODULE := QtiTelephonyService
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYRIGHT $(LOCAL_PATH)/../LICENSE
 LOCAL_MODULE_TAGS := optional
 LOCAL_BUILT_MODULE_STEM := package.apk
 LOCAL_MODULE_OWNER := qcom
diff --git a/usb/Android.bp b/usb/Android.bp
index 4cbca75..cc21f75 100644
--- a/usb/Android.bp
+++ b/usb/Android.bp
@@ -12,6 +12,10 @@
 // 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.
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary {
     name: "android.hardware.usb@1.2-service.bonito",
     relative_install_path: "hw",
diff --git a/voice_processing/Android.bp b/voice_processing/Android.bp
index 48d21dd..2fe366e 100644
--- a/voice_processing/Android.bp
+++ b/voice_processing/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: "libqcomvoiceprocessingdescriptors",
     srcs: ["voice_processing_descriptors.c"],