[LSC] Add LOCAL_LICENSE_KINDS to development

Added SPDX-license-identifier-Apache-2.0 to:
  apps/BluetoothDebug/Android.bp
  apps/BuildWidget/Android.bp
  apps/CustomLocale/Android.bp
  apps/DevelopmentSettings/Android.bp
  apps/Fallback/Android.bp
  apps/GestureBuilder/Android.bp
  apps/NinePatchLab/Android.bp
  apps/OBJViewer/Android.bp
  apps/PushApiAuthenticator/Android.bp
  apps/PushApiTestAppOne/Android.bp
  apps/PushApiTestAppTwo/Android.bp
  apps/SdkSetup/Android.bp
  apps/SettingInjectorSample/Android.bp
  apps/WidgetPreview/Android.bp
  apps/launchperf/Android.bp
  cmds/monkey/Android.mk
  gsi/gsi_util/Android.bp
  gsi/repack_super_image/Android.bp
  host/windows/Android.bp
  python-packages/Android.bp
  samples/AccelerometerPlay/Android.bp
  samples/AdaptiveIconSample/Android.bp
  samples/AliasActivity/Android.bp
  samples/AndroidBeamDemo/Android.bp
  samples/AppNavigation/Android.bp
  samples/AutofillKeyboard/Android.bp
  samples/BackupRestore/Android.bp
  samples/BasicGLSurfaceView/Android.bp
  samples/BluetoothChat/Android.bp
  samples/BrokenKeyDerivation/Android.bp
  samples/BrokenKeyDerivation/tests/Android.bp
  samples/BusinessCard/Android.bp
  samples/Compass/Android.bp
  samples/ContactManager/Android.bp
  samples/CubeLiveWallpaper/Android.bp
  samples/DataWiper/Android.bp
  samples/DeviceAdminWhitelistedAccount/Android.bp
  samples/FixedGridLayout/Android.bp
  samples/HeavyWeight/Android.bp
  samples/HelloActivity/Android.bp
  samples/HelloActivity/tests/Android.bp
  samples/HelloEffects/Android.bp
  samples/Home/Android.bp
  samples/HoneycombGallery/Android.bp
  samples/InlineFillService/Android.bp
  samples/JetBoy/Android.bp
  samples/LceDemo/Android.bp
  samples/LunarLander/Android.bp
  samples/LunarLander/tests/Android.bp
  samples/MultiResolution/Android.bp
  samples/MultiWindow/Android.bp
  samples/MySampleRss/Android.bp
  samples/NotePad/Android.bp
  samples/Obb/Android.bp
  samples/RSSReader/Android.bp
  samples/ReceiveShareDemo/Android.bp
  samples/SampleSyncAdapter/Android.bp
  samples/SimpleJNI/Android.bp
  samples/SimpleJNI/jni/Android.bp
  samples/SipDemo/Android.bp
  samples/SkeletonApp/Android.bp
  samples/SkeletonApp/tests/Android.bp
  samples/Snake/Android.bp
  samples/Snake/tests/Android.bp
  samples/SoftKeyboard/Android.bp
  samples/SpellChecker/HelloSpellChecker/Android.bp
  samples/SpellChecker/SampleSpellCheckerService/Android.bp
  samples/StackWidget/Android.bp
  samples/ThemedNavBarKeyboard/Android.bp
  samples/ToyVpn/Android.bp
  samples/TtsEngine/Android.bp
  samples/USB/AdbTest/Android.bp
  samples/USB/MissileLauncher/Android.bp
  samples/UiAutomator/Android.mk
  samples/Vault/Android.bp
  samples/Vault/tests/Android.bp
  samples/VoiceRecognitionService/Android.bp
  samples/VoicemailProviderDemo/Android.bp
  samples/WeatherListWidget/Android.bp
  samples/WiFiDirectDemo/Android.bp
  samples/WiFiDirectServiceDiscovery/Android.bp
  samples/Wiktionary/Android.bp
  samples/WiktionarySimple/Android.bp
  samples/XmlAdapters/Android.bp
  samples/apkcachetest/Android.bp
  samples/training/NsdChat/Android.bp
  scripts/Android.bp
  testrunner/Android.mk
  testrunner/tests/Android_native.mk
  tools/apkcheck/Android.bp
  tools/bugreport/Android.bp
  tools/etc1tool/Android.bp
  tools/idegen/Android.bp
  tools/mkstubs/Android.bp
  tools/rmtypedefs/Android.bp
  vndk/Android.bp
  vndk/tools/Android.bp
  vndk/tools/elfcheck/Android.bp
  vndk/tools/header-checker/Android.bp
  vndk/tools/header-checker/src/repr/protobuf/proto/Android.bp
  vndk/tools/header-checker/tests/integration/ifunc/Android.bp
  vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
  vndk/tools/image-diff-tool/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CPL-1.0 SPDX-license-identifier-MIT
    SPDX-license-identifier-Unicode-DFS SPDX-license-identifier-W3C
    legacy_restricted legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-CPL-1.0
to:
  samples/SearchableDictionary/Android.bp

Added SPDX-license-identifier-Apache-2.0 legacy_unencumbered
to:
  tools/Android.bp

Added SPDX-license-identifier-BSD SPDX-license-identifier-CPL-1.0
    SPDX-license-identifier-MIT SPDX-license-identifier-Unicode-DFS
    SPDX-license-identifier-W3C
to:
  sdk/Android.bp

Added legacy_restricted
to:
  samples/KeyChainDemo/Android.bp
  tools/line_endings/Android.bp
  vndk/tools/definition-tool/datasets/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I9847e00fb4278bc083b4debbc751003c995ea45c
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..f3c8764
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,48 @@
+//
+// Copyright (C) 2021 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.
+
+package {
+    default_applicable_licenses: ["development_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: "development_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+        "SPDX-license-identifier-BSD",
+        "SPDX-license-identifier-CPL-1.0",
+        "SPDX-license-identifier-MIT",
+        "SPDX-license-identifier-Unicode-DFS",
+        "SPDX-license-identifier-W3C",
+        "legacy_restricted",
+        "legacy_unencumbered",
+    ],
+    // large-scale-change unable to identify any license_text files
+}
diff --git a/apps/BluetoothDebug/Android.bp b/apps/BluetoothDebug/Android.bp
index 9ab3d7a..8033a29 100644
--- a/apps/BluetoothDebug/Android.bp
+++ b/apps/BluetoothDebug/Android.bp
@@ -1,3 +1,20 @@
+package {
+    default_applicable_licenses: ["development_apps_BluetoothDebug_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_BluetoothDebug_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "BluetoothDebug",
     srcs: ["**/*.java"],
diff --git a/apps/BuildWidget/Android.bp b/apps/BuildWidget/Android.bp
index 32e84cd..af3b502 100644
--- a/apps/BuildWidget/Android.bp
+++ b/apps/BuildWidget/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "BuildWidget",
     // Only compile source java files in this apk.
diff --git a/apps/CustomLocale/Android.bp b/apps/CustomLocale/Android.bp
index bd6e462..f48e403 100644
--- a/apps/CustomLocale/Android.bp
+++ b/apps/CustomLocale/Android.bp
@@ -1,3 +1,20 @@
+package {
+    default_applicable_licenses: ["development_apps_CustomLocale_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_CustomLocale_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "CustomLocale",
     srcs: ["**/*.java"],
diff --git a/apps/DevelopmentSettings/Android.bp b/apps/DevelopmentSettings/Android.bp
index ab19383..5743b39 100644
--- a/apps/DevelopmentSettings/Android.bp
+++ b/apps/DevelopmentSettings/Android.bp
@@ -1,3 +1,22 @@
+package {
+    default_applicable_licenses: [
+        "development_apps_DevelopmentSettings_license",
+    ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_DevelopmentSettings_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "DevelopmentSettings",
     sdk_version: "current",
diff --git a/apps/Fallback/Android.bp b/apps/Fallback/Android.bp
index 7107ec8..516f7cf 100644
--- a/apps/Fallback/Android.bp
+++ b/apps/Fallback/Android.bp
@@ -1,3 +1,20 @@
+package {
+    default_applicable_licenses: ["development_apps_Fallback_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_Fallback_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "Fallback",
     srcs: ["**/*.java"],
diff --git a/apps/GestureBuilder/Android.bp b/apps/GestureBuilder/Android.bp
index b7f2cb7..6cea312 100644
--- a/apps/GestureBuilder/Android.bp
+++ b/apps/GestureBuilder/Android.bp
@@ -14,6 +14,23 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["development_apps_GestureBuilder_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_GestureBuilder_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_test {
     name: "GestureBuilder",
     srcs: ["**/*.java"],
diff --git a/apps/NinePatchLab/Android.bp b/apps/NinePatchLab/Android.bp
index 57e5509..baaf263 100644
--- a/apps/NinePatchLab/Android.bp
+++ b/apps/NinePatchLab/Android.bp
@@ -1,3 +1,20 @@
+package {
+    default_applicable_licenses: ["development_apps_NinePatchLab_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_NinePatchLab_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_test {
     name: "NinePatchLab",
     srcs: ["**/*.java"],
diff --git a/apps/PushApiAuthenticator/Android.bp b/apps/PushApiAuthenticator/Android.bp
index edab9a1..48ffea0 100644
--- a/apps/PushApiAuthenticator/Android.bp
+++ b/apps/PushApiAuthenticator/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app_certificate {
     name: "development_apps_pushapiauthenticator",
     certificate: "cert",
diff --git a/apps/PushApiTestAppOne/Android.bp b/apps/PushApiTestAppOne/Android.bp
index b74fcef..d4fda4f 100644
--- a/apps/PushApiTestAppOne/Android.bp
+++ b/apps/PushApiTestAppOne/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app_certificate {
     name: "development_apps_pushapitestappone_cert",
     certificate: "cert",
diff --git a/apps/PushApiTestAppTwo/Android.bp b/apps/PushApiTestAppTwo/Android.bp
index b1ce9c4..5d37a44 100644
--- a/apps/PushApiTestAppTwo/Android.bp
+++ b/apps/PushApiTestAppTwo/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app_certificate {
     name: "development_apps_pushapitestapptwo_cert",
     certificate: "cert",
diff --git a/apps/SdkSetup/Android.bp b/apps/SdkSetup/Android.bp
index ac45411..4c8d230 100644
--- a/apps/SdkSetup/Android.bp
+++ b/apps/SdkSetup/Android.bp
@@ -1,3 +1,20 @@
+package {
+    default_applicable_licenses: ["development_apps_SdkSetup_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_SdkSetup_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "SdkSetup",
     privileged: true,
@@ -17,4 +34,4 @@
     sub_dir: "permissions",
     src: "com.android.sdksetup.xml",
     filename_from_src: true,
-}
\ No newline at end of file
+}
diff --git a/apps/SettingInjectorSample/Android.bp b/apps/SettingInjectorSample/Android.bp
index 33cb42e..d70ee02 100644
--- a/apps/SettingInjectorSample/Android.bp
+++ b/apps/SettingInjectorSample/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "SettingInjectorSample",
     // Only compile source java files in this apk.
diff --git a/apps/WidgetPreview/Android.bp b/apps/WidgetPreview/Android.bp
index 080080f..65fa278 100644
--- a/apps/WidgetPreview/Android.bp
+++ b/apps/WidgetPreview/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "WidgetPreview",
     srcs: ["**/*.java"],
diff --git a/apps/launchperf/Android.bp b/apps/launchperf/Android.bp
index 861980b..cc19f4b 100644
--- a/apps/launchperf/Android.bp
+++ b/apps/launchperf/Android.bp
@@ -1,3 +1,20 @@
+package {
+    default_applicable_licenses: ["development_apps_launchperf_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_apps_launchperf_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_test {
     name: "launchperf",
     srcs: ["**/*.java"],
diff --git a/cmds/monkey/Android.mk b/cmds/monkey/Android.mk
index 90dd3cd..6e42eb9 100644
--- a/cmds/monkey/Android.mk
+++ b/cmds/monkey/Android.mk
@@ -5,12 +5,18 @@
 include $(CLEAR_VARS)
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 LOCAL_MODULE := monkeylib
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_MODULE_STEM := monkey
 include $(BUILD_JAVA_LIBRARY)
 
 ################################################################
 include $(CLEAR_VARS)
 LOCAL_MODULE := monkey
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_MODULE_CLASS := EXECUTABLES
 LOCAL_SRC_FILES := monkey
 LOCAL_REQUIRED_MODULES := monkeylib
diff --git a/gsi/gsi_util/Android.bp b/gsi/gsi_util/Android.bp
index abc08f5..bdd8fa7 100644
--- a/gsi/gsi_util/Android.bp
+++ b/gsi/gsi_util/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"],
+}
+
 python_binary_host {
   name: "gsi_util",
   srcs: [
diff --git a/gsi/repack_super_image/Android.bp b/gsi/repack_super_image/Android.bp
index afbde09..1f1c7e2 100644
--- a/gsi/repack_super_image/Android.bp
+++ b/gsi/repack_super_image/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"],
+}
+
 python_binary_host {
   name: "repack_super_image",
   main: "repack_super_image.py",
diff --git a/host/windows/Android.bp b/host/windows/Android.bp
index 576d184..11c714b 100644
--- a/host/windows/Android.bp
+++ b/host/windows/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_defaults {
     name: "AdbWinApi_defaults",
 
diff --git a/python-packages/Android.bp b/python-packages/Android.bp
index 57031f5..ec592db 100644
--- a/python-packages/Android.bp
+++ b/python-packages/Android.bp
@@ -12,6 +12,23 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+package {
+    default_applicable_licenses: ["development_python-packages_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_python-packages_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 python_library_host {
   name: "adb_py",
   srcs: [
diff --git a/samples/AccelerometerPlay/Android.bp b/samples/AccelerometerPlay/Android.bp
index a338994..869efe9 100644
--- a/samples/AccelerometerPlay/Android.bp
+++ b/samples/AccelerometerPlay/Android.bp
@@ -13,6 +13,25 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: [
+        "development_samples_AccelerometerPlay_license",
+    ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_samples_AccelerometerPlay_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "AccelerometerPlay",
     // Only compile source java files in this apk.
diff --git a/samples/AdaptiveIconSample/Android.bp b/samples/AdaptiveIconSample/Android.bp
index c0ca255..30f2b8b 100644
--- a/samples/AdaptiveIconSample/Android.bp
+++ b/samples/AdaptiveIconSample/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "AdaptiveIconSample",
     // Only compile source java files in this apk.
diff --git a/samples/AliasActivity/Android.bp b/samples/AliasActivity/Android.bp
index 8e7f8cb..529fa66 100644
--- a/samples/AliasActivity/Android.bp
+++ b/samples/AliasActivity/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "AliasActivity",
     installable: false,
diff --git a/samples/AndroidBeamDemo/Android.bp b/samples/AndroidBeamDemo/Android.bp
index 09df349..fdc2748 100644
--- a/samples/AndroidBeamDemo/Android.bp
+++ b/samples/AndroidBeamDemo/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "AndroidBeamDemo",
     // Only compile source java files in this apk.
diff --git a/samples/AppNavigation/Android.bp b/samples/AppNavigation/Android.bp
index 1b360a4..1013538 100644
--- a/samples/AppNavigation/Android.bp
+++ b/samples/AppNavigation/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "AppNavigation",
     srcs: ["src/**/*.java"],
diff --git a/samples/AutofillKeyboard/Android.bp b/samples/AutofillKeyboard/Android.bp
index 57a4249..099bbb8 100644
--- a/samples/AutofillKeyboard/Android.bp
+++ b/samples/AutofillKeyboard/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "AutofillKeyboard",
     srcs: ["**/*.java"],
diff --git a/samples/BackupRestore/Android.bp b/samples/BackupRestore/Android.bp
index b605a8f..8aad3f7 100644
--- a/samples/BackupRestore/Android.bp
+++ b/samples/BackupRestore/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "BackupRestore",
     // Only compile source java files in this apk.
diff --git a/samples/BasicGLSurfaceView/Android.bp b/samples/BasicGLSurfaceView/Android.bp
index 0384cf2..9298aaf 100644
--- a/samples/BasicGLSurfaceView/Android.bp
+++ b/samples/BasicGLSurfaceView/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "BasicGLSurfaceView",
     // Only compile source java files in this apk.
diff --git a/samples/BluetoothChat/Android.bp b/samples/BluetoothChat/Android.bp
index f15127e..6393f69 100644
--- a/samples/BluetoothChat/Android.bp
+++ b/samples/BluetoothChat/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "BluetoothChat",
     // Only compile source java files in this apk.
diff --git a/samples/BrokenKeyDerivation/Android.bp b/samples/BrokenKeyDerivation/Android.bp
index 54bceb8..dd6e06f 100644
--- a/samples/BrokenKeyDerivation/Android.bp
+++ b/samples/BrokenKeyDerivation/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "BrokenKeyDerivation",
     // Only compile source java files in this apk.
diff --git a/samples/BrokenKeyDerivation/tests/Android.bp b/samples/BrokenKeyDerivation/tests/Android.bp
index 158ae3d..94a5c40 100644
--- a/samples/BrokenKeyDerivation/tests/Android.bp
+++ b/samples/BrokenKeyDerivation/tests/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "BrokenKeyDerivationTests",
     srcs: ["**/*.java"],
diff --git a/samples/BusinessCard/Android.bp b/samples/BusinessCard/Android.bp
index 9e6d953..5e1e3ef 100644
--- a/samples/BusinessCard/Android.bp
+++ b/samples/BusinessCard/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "BusinessCard",
     // Only compile source java files in this apk.
diff --git a/samples/Compass/Android.bp b/samples/Compass/Android.bp
index 68e8a6b..b2c6a01 100644
--- a/samples/Compass/Android.bp
+++ b/samples/Compass/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "Compass",
     // Only compile source java files in this apk.
diff --git a/samples/ContactManager/Android.bp b/samples/ContactManager/Android.bp
index ea551be..1a6a2b6 100644
--- a/samples/ContactManager/Android.bp
+++ b/samples/ContactManager/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "ContactManager",
     // Only compile source java files in this apk.
diff --git a/samples/CubeLiveWallpaper/Android.bp b/samples/CubeLiveWallpaper/Android.bp
index 6f4df0a..e5b910f 100644
--- a/samples/CubeLiveWallpaper/Android.bp
+++ b/samples/CubeLiveWallpaper/Android.bp
@@ -14,6 +14,25 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: [
+        "development_samples_CubeLiveWallpaper_license",
+    ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_samples_CubeLiveWallpaper_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "CubeLiveWallpapers",
     srcs: ["**/*.java"],
diff --git a/samples/DataWiper/Android.bp b/samples/DataWiper/Android.bp
index c1e5f57..8243f7d 100644
--- a/samples/DataWiper/Android.bp
+++ b/samples/DataWiper/Android.bp
@@ -16,6 +16,10 @@
 
 // We build two apps from the same source
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "DataWiper",
     srcs: ["src/**/*.java"],
diff --git a/samples/DeviceAdminWhitelistedAccount/Android.bp b/samples/DeviceAdminWhitelistedAccount/Android.bp
index b58d366..164e360 100644
--- a/samples/DeviceAdminWhitelistedAccount/Android.bp
+++ b/samples/DeviceAdminWhitelistedAccount/Android.bp
@@ -16,6 +16,10 @@
 
 // We build two apps from the same source
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "DeviceAdminWhitelistedAccount",
     srcs: ["src/**/*.java"],
diff --git a/samples/FixedGridLayout/Android.bp b/samples/FixedGridLayout/Android.bp
index 9095999..ae7fec3 100644
--- a/samples/FixedGridLayout/Android.bp
+++ b/samples/FixedGridLayout/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "FixedGridLayout",
     srcs: ["**/*.java"],
diff --git a/samples/HelloActivity/Android.bp b/samples/HelloActivity/Android.bp
index 03f26b3..72a99d6 100644
--- a/samples/HelloActivity/Android.bp
+++ b/samples/HelloActivity/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "HelloActivity",
     // Only compile source java files in this apk.
diff --git a/samples/HelloActivity/tests/Android.bp b/samples/HelloActivity/tests/Android.bp
index f9346ca..62c5ec2 100644
--- a/samples/HelloActivity/tests/Android.bp
+++ b/samples/HelloActivity/tests/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "HelloActivityTests",
     srcs: ["**/*.java"],
diff --git a/samples/HelloEffects/Android.bp b/samples/HelloEffects/Android.bp
index 23887bb..f1d949e 100644
--- a/samples/HelloEffects/Android.bp
+++ b/samples/HelloEffects/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "HelloEffects",
     srcs: ["**/*.java"],
diff --git a/samples/Home/Android.bp b/samples/Home/Android.bp
index 0d1bb77..c0d8f46 100644
--- a/samples/Home/Android.bp
+++ b/samples/Home/Android.bp
@@ -1,3 +1,20 @@
+package {
+    default_applicable_licenses: ["development_samples_Home_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_samples_Home_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "Home",
     srcs: ["**/*.java"],
diff --git a/samples/HoneycombGallery/Android.bp b/samples/HoneycombGallery/Android.bp
index 238bcd9..f0a3dda 100644
--- a/samples/HoneycombGallery/Android.bp
+++ b/samples/HoneycombGallery/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "HoneycombGallery",
     // Only compile source java files in this apk.
diff --git a/samples/InlineFillService/Android.bp b/samples/InlineFillService/Android.bp
index f8d65d0..ee86da7 100644
--- a/samples/InlineFillService/Android.bp
+++ b/samples/InlineFillService/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"],
+}
+
 android_app {
     name: "InlineFillService",
     srcs: [
@@ -23,4 +27,4 @@
         "androidx.annotation_annotation",
         "androidx.autofill_autofill"
     ],
-}
\ No newline at end of file
+}
diff --git a/samples/JetBoy/Android.bp b/samples/JetBoy/Android.bp
index 9600510..40a8fda 100644
--- a/samples/JetBoy/Android.bp
+++ b/samples/JetBoy/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "JETBoy",
     srcs: ["**/*.java"],
diff --git a/samples/KeyChainDemo/Android.bp b/samples/KeyChainDemo/Android.bp
index da407b2..ac09875 100644
--- a/samples/KeyChainDemo/Android.bp
+++ b/samples/KeyChainDemo/Android.bp
@@ -1,3 +1,12 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "development_license"
+    // to get the below license kinds:
+    //   legacy_restricted
+    default_applicable_licenses: ["development_license"],
+}
+
 android_app {
     name: "KeyChainDemo",
     // Only compile source java files in this apk.
diff --git a/samples/LceDemo/Android.bp b/samples/LceDemo/Android.bp
index 2140d36..a193acc 100644
--- a/samples/LceDemo/Android.bp
+++ b/samples/LceDemo/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "LceDemo",
     // Only compile source java files in this apk.
diff --git a/samples/LunarLander/Android.bp b/samples/LunarLander/Android.bp
index 382f312..576401f 100644
--- a/samples/LunarLander/Android.bp
+++ b/samples/LunarLander/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "LunarLander",
     // Only compile source java files in this apk.
diff --git a/samples/LunarLander/tests/Android.bp b/samples/LunarLander/tests/Android.bp
index 0adb26b..6799dc3 100644
--- a/samples/LunarLander/tests/Android.bp
+++ b/samples/LunarLander/tests/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "LunarLanderTests",
     srcs: ["**/*.java"],
diff --git a/samples/MultiResolution/Android.bp b/samples/MultiResolution/Android.bp
index 878be59..e84897a 100644
--- a/samples/MultiResolution/Android.bp
+++ b/samples/MultiResolution/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "MultiResolution",
     // Only compile source java files in this apk.
diff --git a/samples/MultiWindow/Android.bp b/samples/MultiWindow/Android.bp
index 12f160f..4ef0848 100644
--- a/samples/MultiWindow/Android.bp
+++ b/samples/MultiWindow/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "MultiWindow",
     // Only compile source java files in this apk.
diff --git a/samples/NotePad/Android.bp b/samples/NotePad/Android.bp
index adbe9ea..68e1a49 100644
--- a/samples/NotePad/Android.bp
+++ b/samples/NotePad/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "NotePad",
     // Only compile source java files in this apk.
diff --git a/samples/Obb/Android.bp b/samples/Obb/Android.bp
index 65a5861..0c2d8f5 100644
--- a/samples/Obb/Android.bp
+++ b/samples/Obb/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "ObbApp",
     // Only compile source java files in this apk.
diff --git a/samples/RSSReader/Android.bp b/samples/RSSReader/Android.bp
index 671519b..f782ac9 100644
--- a/samples/RSSReader/Android.bp
+++ b/samples/RSSReader/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "RSSReader",
     srcs: ["**/*.java"],
diff --git a/samples/ReceiveShareDemo/Android.bp b/samples/ReceiveShareDemo/Android.bp
index aac100e..bec4293 100644
--- a/samples/ReceiveShareDemo/Android.bp
+++ b/samples/ReceiveShareDemo/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "ReceiveShareDemo",
     // Only compile source java files in this apk.
diff --git a/samples/SampleSyncAdapter/Android.bp b/samples/SampleSyncAdapter/Android.bp
index 09cc114..b415834 100644
--- a/samples/SampleSyncAdapter/Android.bp
+++ b/samples/SampleSyncAdapter/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "SampleSyncAdapter",
     // Only compile source java files in this apk.
diff --git a/samples/SearchableDictionary/Android.bp b/samples/SearchableDictionary/Android.bp
index 2b39bcf..a0de356 100644
--- a/samples/SearchableDictionary/Android.bp
+++ b/samples/SearchableDictionary/Android.bp
@@ -1,3 +1,13 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "development_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    //   SPDX-license-identifier-CPL-1.0
+    default_applicable_licenses: ["development_license"],
+}
+
 android_app {
     name: "SearchableDictionary",
     srcs: ["**/*.java"],
diff --git a/samples/SimpleJNI/Android.bp b/samples/SimpleJNI/Android.bp
index 5a01b57..57a78a8 100644
--- a/samples/SimpleJNI/Android.bp
+++ b/samples/SimpleJNI/Android.bp
@@ -17,6 +17,10 @@
 // This makefile shows how to build a shared library and an activity that
 // bundles the shared library and calls it using JNI.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "SimpleJNI",
     srcs: ["**/*.java"],
diff --git a/samples/SimpleJNI/jni/Android.bp b/samples/SimpleJNI/jni/Android.bp
index f9b06d3..b34ed01 100644
--- a/samples/SimpleJNI/jni/Android.bp
+++ b/samples/SimpleJNI/jni/Android.bp
@@ -17,6 +17,10 @@
 // This makefile supplies the rules for building a library of JNI code for
 // use by our example of how to bundle a shared library with an APK.
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_shared {
     name: "libsimplejni",
     // All of the source files that we will compile.
diff --git a/samples/SipDemo/Android.bp b/samples/SipDemo/Android.bp
index ddde982..ec111db 100644
--- a/samples/SipDemo/Android.bp
+++ b/samples/SipDemo/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "SipDemo",
     // Only compile source java files in this apk.
diff --git a/samples/SkeletonApp/Android.bp b/samples/SkeletonApp/Android.bp
index c870447..9ed80d8 100644
--- a/samples/SkeletonApp/Android.bp
+++ b/samples/SkeletonApp/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "SkeletonApp",
     // Only compile source java files in this apk.
diff --git a/samples/SkeletonApp/tests/Android.bp b/samples/SkeletonApp/tests/Android.bp
index 7722927..018e286 100644
--- a/samples/SkeletonApp/tests/Android.bp
+++ b/samples/SkeletonApp/tests/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "SkeletonAppTests",
     srcs: ["**/*.java"],
diff --git a/samples/Snake/Android.bp b/samples/Snake/Android.bp
index 645f4d2..93eb174 100644
--- a/samples/Snake/Android.bp
+++ b/samples/Snake/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "Snake",
     // Only compile source java files in this apk.
diff --git a/samples/Snake/tests/Android.bp b/samples/Snake/tests/Android.bp
index 82c541f..a0425ce 100644
--- a/samples/Snake/tests/Android.bp
+++ b/samples/Snake/tests/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "SnakeTests",
     srcs: ["**/*.java"],
diff --git a/samples/SoftKeyboard/Android.bp b/samples/SoftKeyboard/Android.bp
index 984c2fd..b96d42a 100644
--- a/samples/SoftKeyboard/Android.bp
+++ b/samples/SoftKeyboard/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "SoftKeyboard",
     srcs: ["**/*.java"],
diff --git a/samples/SpellChecker/HelloSpellChecker/Android.bp b/samples/SpellChecker/HelloSpellChecker/Android.bp
index 248908e..1f1ef78 100644
--- a/samples/SpellChecker/HelloSpellChecker/Android.bp
+++ b/samples/SpellChecker/HelloSpellChecker/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "HelloSpellChecker",
     srcs: ["**/*.java"],
diff --git a/samples/SpellChecker/SampleSpellCheckerService/Android.bp b/samples/SpellChecker/SampleSpellCheckerService/Android.bp
index b140932..12cdee0 100644
--- a/samples/SpellChecker/SampleSpellCheckerService/Android.bp
+++ b/samples/SpellChecker/SampleSpellCheckerService/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "SampleSpellCheckerService",
     srcs: ["**/*.java"],
diff --git a/samples/StackWidget/Android.bp b/samples/StackWidget/Android.bp
index 5ec823a..d8e8601 100644
--- a/samples/StackWidget/Android.bp
+++ b/samples/StackWidget/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "StackWidget",
     // Only compile source java files in this apk.
diff --git a/samples/ThemedNavBarKeyboard/Android.bp b/samples/ThemedNavBarKeyboard/Android.bp
index 2c6bb45..d2fa55a 100644
--- a/samples/ThemedNavBarKeyboard/Android.bp
+++ b/samples/ThemedNavBarKeyboard/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "ThemedNavBarKeyboard",
     srcs: ["**/*.java"],
diff --git a/samples/ToyVpn/Android.bp b/samples/ToyVpn/Android.bp
index 430fccb..a6b1f0a 100644
--- a/samples/ToyVpn/Android.bp
+++ b/samples/ToyVpn/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "ToyVpn",
     // Only compile source java files in this apk.
diff --git a/samples/TtsEngine/Android.bp b/samples/TtsEngine/Android.bp
index 5aff363..7fa6dc4 100644
--- a/samples/TtsEngine/Android.bp
+++ b/samples/TtsEngine/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "TtsEngine",
     srcs: ["src/**/*.java"],
diff --git a/samples/USB/AdbTest/Android.bp b/samples/USB/AdbTest/Android.bp
index c812f80..9abd714 100644
--- a/samples/USB/AdbTest/Android.bp
+++ b/samples/USB/AdbTest/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "AdbTest",
     srcs: ["**/*.java"],
diff --git a/samples/USB/MissileLauncher/Android.bp b/samples/USB/MissileLauncher/Android.bp
index 249349e..cdbbe2f 100644
--- a/samples/USB/MissileLauncher/Android.bp
+++ b/samples/USB/MissileLauncher/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "MissileLauncher",
     srcs: ["**/*.java"],
diff --git a/samples/UiAutomator/Android.mk b/samples/UiAutomator/Android.mk
index 336fcf8..5f4c593 100644
--- a/samples/UiAutomator/Android.mk
+++ b/samples/UiAutomator/Android.mk
@@ -22,6 +22,8 @@
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_MODULE := uiautomator.samples
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_JAVA_LIBRARIES := uiautomator.core android.test.base.stubs
 LOCAL_STATIC_JAVA_LIBRARIES := junit
diff --git a/samples/Vault/Android.bp b/samples/Vault/Android.bp
index 65276df..6da74a4 100644
--- a/samples/Vault/Android.bp
+++ b/samples/Vault/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test_helper_app {
     name: "Vault",
     srcs: ["**/*.java"],
diff --git a/samples/Vault/tests/Android.bp b/samples/Vault/tests/Android.bp
index 6b28d6e..4076d7a 100644
--- a/samples/Vault/tests/Android.bp
+++ b/samples/Vault/tests/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "VaultTests",
     libs: [
diff --git a/samples/VoiceRecognitionService/Android.bp b/samples/VoiceRecognitionService/Android.bp
index 9ad9811..8819491 100644
--- a/samples/VoiceRecognitionService/Android.bp
+++ b/samples/VoiceRecognitionService/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "VoiceRecognitionService",
     srcs: ["**/*.java"],
diff --git a/samples/VoicemailProviderDemo/Android.bp b/samples/VoicemailProviderDemo/Android.bp
index 2b98c08..66211bd 100644
--- a/samples/VoicemailProviderDemo/Android.bp
+++ b/samples/VoicemailProviderDemo/Android.bp
@@ -14,6 +14,25 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: [
+        "development_samples_VoicemailProviderDemo_license",
+    ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "development_samples_VoicemailProviderDemo_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 android_app {
     name: "VoicemailProviderDemo",
     // Only compile source java files in this apk.
diff --git a/samples/WeatherListWidget/Android.bp b/samples/WeatherListWidget/Android.bp
index 23cc352..55d4335 100644
--- a/samples/WeatherListWidget/Android.bp
+++ b/samples/WeatherListWidget/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "WeatherListWidget",
     // Only compile source java files in this apk.
diff --git a/samples/WiFiDirectDemo/Android.bp b/samples/WiFiDirectDemo/Android.bp
index e6bcc65..7d539ca 100644
--- a/samples/WiFiDirectDemo/Android.bp
+++ b/samples/WiFiDirectDemo/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "WiFiDirectDemo",
     // Only compile source java files in this apk.
diff --git a/samples/WiFiDirectServiceDiscovery/Android.bp b/samples/WiFiDirectServiceDiscovery/Android.bp
index bb41aec..69588fd 100644
--- a/samples/WiFiDirectServiceDiscovery/Android.bp
+++ b/samples/WiFiDirectServiceDiscovery/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "WiFiDirectServiceDiscovery",
     // Only compile source java files in this apk.
diff --git a/samples/Wiktionary/Android.bp b/samples/Wiktionary/Android.bp
index 48995e9..42d337b 100644
--- a/samples/Wiktionary/Android.bp
+++ b/samples/Wiktionary/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "Wiktionary",
     // Only compile source java files in this apk.
diff --git a/samples/WiktionarySimple/Android.bp b/samples/WiktionarySimple/Android.bp
index 0cc9c98..168f24f 100644
--- a/samples/WiktionarySimple/Android.bp
+++ b/samples/WiktionarySimple/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "WiktionarySimple",
     // Only compile source java files in this apk.
diff --git a/samples/XmlAdapters/Android.bp b/samples/XmlAdapters/Android.bp
index 8ca7218..278bc59 100644
--- a/samples/XmlAdapters/Android.bp
+++ b/samples/XmlAdapters/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "xmladapters",
     // Only compile source java files in this apk.
diff --git a/samples/apkcachetest/Android.bp b/samples/apkcachetest/Android.bp
index 67ffeb9..6d1bfaa 100644
--- a/samples/apkcachetest/Android.bp
+++ b/samples/apkcachetest/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_test {
     name: "ApkCacheTest",
     srcs: ["src/**/*.java"],
diff --git a/samples/training/NsdChat/Android.bp b/samples/training/NsdChat/Android.bp
index 574553c..dc1f127 100644
--- a/samples/training/NsdChat/Android.bp
+++ b/samples/training/NsdChat/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 android_app {
     name: "NsdChat",
     // Only compile source java files in this apk.
diff --git a/scripts/Android.bp b/scripts/Android.bp
index c0f6201..4c5895e 100644
--- a/scripts/Android.bp
+++ b/scripts/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"],
+}
+
 python_library_host {
     name: "python-symbol",
     srcs: [
diff --git a/sdk/Android.bp b/sdk/Android.bp
index 0b1a318..d2cd3e0 100644
--- a/sdk/Android.bp
+++ b/sdk/Android.bp
@@ -1,3 +1,16 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "development_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    //   SPDX-license-identifier-CPL-1.0
+    //   SPDX-license-identifier-MIT
+    //   SPDX-license-identifier-Unicode-DFS
+    //   SPDX-license-identifier-W3C
+    default_applicable_licenses: ["development_license"],
+}
+
 genrule {
     name: "platform_tools_version",
     cmd: "sed 's/$${PLATFORM_SDK_VERSION}/0/ ; s/^Pkg.Revision=\\(.*\\)/#define PLATFORM_TOOLS_VERSION \"\\1\"/p ; d' $(in) > $(out)",
diff --git a/testrunner/Android.mk b/testrunner/Android.mk
index d0f773d..8c80143 100644
--- a/testrunner/Android.mk
+++ b/testrunner/Android.mk
@@ -10,6 +10,8 @@
 ########################
 include $(CLEAR_VARS)
 LOCAL_MODULE := test_defs.xml
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_PATH := $(local_target_dir)
@@ -18,6 +20,8 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := coverage_targets.xml
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_PATH := $(local_target_dir)
diff --git a/testrunner/tests/Android_native.mk b/testrunner/tests/Android_native.mk
index 6273ccb..e7ca0bf 100644
--- a/testrunner/tests/Android_native.mk
+++ b/testrunner/tests/Android_native.mk
@@ -15,6 +15,8 @@
 include $(CLEAR_VARS)
 test_module := foo
 LOCAL_MODULE := $(test_module)
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 recursive_var := $(recursive_var)
 LOCAL_MODULE_TAGS := tags
 LOCAL_SRC_FILES := src
diff --git a/tools/Android.bp b/tools/Android.bp
index b44c296..4e90ee0 100644
--- a/tools/Android.bp
+++ b/tools/Android.bp
@@ -1 +1,11 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "development_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    //   legacy_unencumbered
+    default_applicable_licenses: ["development_license"],
+}
+
 subdirs = ["*"]
diff --git a/tools/apkcheck/Android.bp b/tools/apkcheck/Android.bp
index 72997b5..8c71a63 100644
--- a/tools/apkcheck/Android.bp
+++ b/tools/apkcheck/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"],
+}
+
 java_binary_host {
     name: "apkcheck",
     wrapper: "etc/apkcheck",
diff --git a/tools/bugreport/Android.bp b/tools/bugreport/Android.bp
index 1144516..34d2dfb 100644
--- a/tools/bugreport/Android.bp
+++ b/tools/bugreport/Android.bp
@@ -1,6 +1,10 @@
 // Copyright 2006 The Android Open Source Project
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 java_binary_host {
     name: "BugReport",
     wrapper: "bugreport",
diff --git a/tools/etc1tool/Android.bp b/tools/etc1tool/Android.bp
index bfde785..35383da 100644
--- a/tools/etc1tool/Android.bp
+++ b/tools/etc1tool/Android.bp
@@ -3,6 +3,10 @@
 // Android.mk for etc1tool
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary_host {
     name: "etc1tool",
 
diff --git a/tools/idegen/Android.bp b/tools/idegen/Android.bp
index 5e57fe0..b1aa3e4 100644
--- a/tools/idegen/Android.bp
+++ b/tools/idegen/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 java_library_host {
     name: "idegen",
     srcs: ["**/*.java"],
diff --git a/tools/line_endings/Android.bp b/tools/line_endings/Android.bp
index 2e5f2e3..db0bc80 100644
--- a/tools/line_endings/Android.bp
+++ b/tools/line_endings/Android.bp
@@ -2,6 +2,15 @@
 //
 // Copies files into the directory structure described by a manifest
 
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "development_license"
+    // to get the below license kinds:
+    //   legacy_restricted
+    default_applicable_licenses: ["development_license"],
+}
+
 cc_binary_host {
     name: "line_endings",
     srcs: ["line_endings.c"],
diff --git a/tools/mkstubs/Android.bp b/tools/mkstubs/Android.bp
index cdc57ff..821539d 100644
--- a/tools/mkstubs/Android.bp
+++ b/tools/mkstubs/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 java_library_host {
     name: "mkstubs",
     srcs: ["src/**/*.java"],
diff --git a/tools/rmtypedefs/Android.bp b/tools/rmtypedefs/Android.bp
index 1b64f47..a548241 100644
--- a/tools/rmtypedefs/Android.bp
+++ b/tools/rmtypedefs/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"],
+}
+
 java_binary_host {
     name: "rmtypedefs",
     srcs: ["src/**/*.java"],
diff --git a/vndk/Android.bp b/vndk/Android.bp
index 5a94875..7f84950 100644
--- a/vndk/Android.bp
+++ b/vndk/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 subdirs = [
     "tools",
 ]
diff --git a/vndk/tools/Android.bp b/vndk/tools/Android.bp
index 9ba4391..28c6574 100644
--- a/vndk/tools/Android.bp
+++ b/vndk/tools/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 subdirs = [
     "header-checker",
     "vtable-dumper",
diff --git a/vndk/tools/definition-tool/datasets/Android.bp b/vndk/tools/definition-tool/datasets/Android.bp
index a5cf848..e7f646f 100644
--- a/vndk/tools/definition-tool/datasets/Android.bp
+++ b/vndk/tools/definition-tool/datasets/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 "development_license"
+    // to get the below license kinds:
+    //   legacy_restricted
+    default_applicable_licenses: ["development_license"],
+}
+
 filegroup {
     name: "vndk_lib_extra_lists",
     srcs: [
diff --git a/vndk/tools/elfcheck/Android.bp b/vndk/tools/elfcheck/Android.bp
index 2776d92..4fd75b5 100644
--- a/vndk/tools/elfcheck/Android.bp
+++ b/vndk/tools/elfcheck/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"],
+}
+
 blueprint_go_binary {
     name: "bpflatten",
     srcs: [
diff --git a/vndk/tools/header-checker/Android.bp b/vndk/tools/header-checker/Android.bp
index e372271..b040538 100644
--- a/vndk/tools/header-checker/Android.bp
+++ b/vndk/tools/header-checker/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_defaults {
     name: "header-checker-defaults",
 
diff --git a/vndk/tools/header-checker/src/repr/protobuf/proto/Android.bp b/vndk/tools/header-checker/src/repr/protobuf/proto/Android.bp
index b63254a..f05a007 100644
--- a/vndk/tools/header-checker/src/repr/protobuf/proto/Android.bp
+++ b/vndk/tools/header-checker/src/repr/protobuf/proto/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_host_static {
     name: "libheader-checker-proto",
 
diff --git a/vndk/tools/header-checker/tests/integration/ifunc/Android.bp b/vndk/tools/header-checker/tests/integration/ifunc/Android.bp
index 207fd9b..b3e10c8 100644
--- a/vndk/tools/header-checker/tests/integration/ifunc/Android.bp
+++ b/vndk/tools/header-checker/tests/integration/ifunc/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library {
     name: "libifunc",
     srcs: [
diff --git a/vndk/tools/header-checker/tests/integration/version_script_example/Android.bp b/vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
index 7228d3b..0a8c15b 100644
--- a/vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
+++ b/vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library {
     name: "libversion_script_example",
     srcs: [
diff --git a/vndk/tools/image-diff-tool/Android.bp b/vndk/tools/image-diff-tool/Android.bp
index 5b72552..ac5936e 100644
--- a/vndk/tools/image-diff-tool/Android.bp
+++ b/vndk/tools/image-diff-tool/Android.bp
@@ -14,6 +14,10 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 python_binary_host {
     name: "compare_images",
     main: "diff.py",