Mark ab/7061308 as merged in stage.

Bug: 180401296
Merged-In: I116d8de660132eab7bc4f916d43863a22ce1721e
Change-Id: Ie48e8787a7738ae029b569baee9b1b2a0090b22f
diff --git a/Android.bp b/Android.bp
index ed6396a..750884b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,43 @@
+// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
+//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
+//     DEPENDING ON IT IN YOUR PROJECT. ***
+package {
+    default_applicable_licenses: ["external_pdfium_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: "external_pdfium_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+        "SPDX-license-identifier-Artistic",
+        "SPDX-license-identifier-BSD",
+        "SPDX-license-identifier-FTL",
+        "SPDX-license-identifier-MIT",
+        "SPDX-license-identifier-OFL", // by exception only
+        "SPDX-license-identifier-Zlib",
+        "SPDX-license-identifier-libtiff",
+        "legacy_unencumbered",
+    ],
+    license_text: [
+        "LICENSE",
+    ],
+}
+
 cc_defaults {
     name: "pdfium-common",
     cflags: [
diff --git a/METADATA b/METADATA
index d97975c..2cfbecc 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,9 @@
+# *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
+#     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
+#     DEPENDING ON IT IN YOUR PROJECT. ***
 third_party {
-  license_type: NOTICE
+  # would be NOTICE save for OFL 1.1 in:
+  #   testing/resources/pixel/bug_925736.pdf
+  #   testing/resources/text_font.pdf
+  license_type: BY_EXCEPTION_ONLY
 }
diff --git a/constants/Android.bp b/constants/Android.bp
index 23c9755..caa06a7 100644
--- a/constants/Android.bp
+++ b/constants/Android.bp
@@ -1,6 +1,14 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_headers {
     name: "libpdfium-constants",
     export_include_dirs: ["."],
     visibility: ["//external/pdfium:__subpackages__"],
 }
-
diff --git a/core/fdrm/Android.bp b/core/fdrm/Android.bp
index c35475a..574a9ff 100644
--- a/core/fdrm/Android.bp
+++ b/core/fdrm/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fdrm",
     defaults: ["pdfium-core"],
diff --git a/core/fpdfapi/cmaps/Android.bp b/core/fpdfapi/cmaps/Android.bp
index e2d5067..27e3439 100644
--- a/core/fpdfapi/cmaps/Android.bp
+++ b/core/fpdfapi/cmaps/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-cmaps",
     defaults: ["pdfium-core"],
diff --git a/core/fpdfapi/edit/Android.bp b/core/fpdfapi/edit/Android.bp
index bbd2b63..1822b06 100644
--- a/core/fpdfapi/edit/Android.bp
+++ b/core/fpdfapi/edit/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-edit",
     defaults: ["pdfium-core"],
diff --git a/core/fpdfapi/font/Android.bp b/core/fpdfapi/font/Android.bp
index c4054f4..ae6301e 100644
--- a/core/fpdfapi/font/Android.bp
+++ b/core/fpdfapi/font/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-font",
     defaults: ["pdfium-core"],
diff --git a/core/fpdfapi/page/Android.bp b/core/fpdfapi/page/Android.bp
index 650e4f8..e44cca2 100644
--- a/core/fpdfapi/page/Android.bp
+++ b/core/fpdfapi/page/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-page",
     defaults: ["pdfium-core"],
diff --git a/core/fpdfapi/parser/Android.bp b/core/fpdfapi/parser/Android.bp
index 6864dfa..cacb42e 100644
--- a/core/fpdfapi/parser/Android.bp
+++ b/core/fpdfapi/parser/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-parser",
     defaults: ["pdfium-core"],
diff --git a/core/fpdfapi/render/Android.bp b/core/fpdfapi/render/Android.bp
index 60818b5..79b0db6 100644
--- a/core/fpdfapi/render/Android.bp
+++ b/core/fpdfapi/render/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-render",
     defaults: ["pdfium-core"],
diff --git a/core/fpdfdoc/Android.bp b/core/fpdfdoc/Android.bp
index 5bb33ea..6931dc5 100644
--- a/core/fpdfdoc/Android.bp
+++ b/core/fpdfdoc/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fpdfdoc",
     defaults: ["pdfium-core"],
diff --git a/core/fpdftext/Android.bp b/core/fpdftext/Android.bp
index 711f35d..b3b4ef0 100644
--- a/core/fpdftext/Android.bp
+++ b/core/fpdftext/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fpdftext",
     defaults: ["pdfium-core"],
diff --git a/core/fxcodec/Android.bp b/core/fxcodec/Android.bp
index b5d78d1..7e5e69b 100644
--- a/core/fxcodec/Android.bp
+++ b/core/fxcodec/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fxcodec",
     defaults: ["pdfium-core"],
diff --git a/core/fxcrt/Android.bp b/core/fxcrt/Android.bp
index 5207656..5f6cb41 100644
--- a/core/fxcrt/Android.bp
+++ b/core/fxcrt/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fxcrt",
     defaults: ["pdfium-core"],
diff --git a/core/fxge/Android.bp b/core/fxge/Android.bp
index fe648c6..973ca03 100644
--- a/core/fxge/Android.bp
+++ b/core/fxge/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fxge",
     defaults: ["pdfium-core"],
diff --git a/fpdfsdk/Android.bp b/fpdfsdk/Android.bp
index af37009..f9c3861 100644
--- a/fpdfsdk/Android.bp
+++ b/fpdfsdk/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fpdfsdk",
     defaults: ["pdfium-core"],
diff --git a/fpdfsdk/formfiller/Android.bp b/fpdfsdk/formfiller/Android.bp
index 5dc4ba6..960992a 100644
--- a/fpdfsdk/formfiller/Android.bp
+++ b/fpdfsdk/formfiller/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-formfiller",
     defaults: ["pdfium-core"],
diff --git a/fpdfsdk/pwl/Android.bp b/fpdfsdk/pwl/Android.bp
index d57a01f..74fc563 100644
--- a/fpdfsdk/pwl/Android.bp
+++ b/fpdfsdk/pwl/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-pwl",
     defaults: ["pdfium-core"],
diff --git a/fxjs/Android.bp b/fxjs/Android.bp
index 9616816..2dc3861 100644
--- a/fxjs/Android.bp
+++ b/fxjs/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 "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_library_static {
     name: "libpdfium-fxjs",
     defaults: ["pdfium-core"],
diff --git a/third_party/Android.bp b/third_party/Android.bp
index 824544e..6571fb1 100644
--- a/third_party/Android.bp
+++ b/third_party/Android.bp
@@ -1,3 +1,18 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "external_pdfium_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Artistic
+    //   SPDX-license-identifier-BSD
+    //   SPDX-license-identifier-FTL
+    //   SPDX-license-identifier-MIT
+    //   SPDX-license-identifier-Zlib
+    //   SPDX-license-identifier-libtiff
+    //   legacy_unencumbered
+    default_applicable_licenses: ["external_pdfium_license"],
+}
+
 cc_defaults {
     name: "pdfium-third-party",
     defaults: [
@@ -97,4 +112,3 @@
         "skia_shared/*.cpp",
     ],
 }
-