summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Roshan Pius <rpius@google.com> 2023-10-19 20:27:51 +0000
committer Android Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com> 2023-10-19 20:27:51 +0000
commit869155b835c71888c45ef9f5e6ffa9618e9ee858 (patch)
tree9983e5e0f06c71feb5007be8ec306642b5699e22
parentd93418c1295fc1d9ab0661aab5bf0afac42b1bb8 (diff)
nfc(api): Dependencies to include in framework-nfc
1. Separate out NFC protos included in NFC API classes 2. Allow NFC flags to be included in NFC Apex Bug: 303286040 Test: Compiles (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:84948ad7775427e91da76239e135069e2c34681c) Merged-In: I6848686b892bec543f977d48e5410af444eb2f7c Change-Id: I6848686b892bec543f977d48e5410af444eb2f7c
-rw-r--r--AconfigFlags.bp4
-rw-r--r--ProtoLibraries.bp34
-rw-r--r--core/proto/android/nfc/Android.bp43
3 files changed, 38 insertions, 43 deletions
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index f0e0c30fd031..3e1ffd2b3735 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -123,6 +123,10 @@ aconfig_declarations {
java_aconfig_library {
name: "android.nfc.flags-aconfig-java",
aconfig_declarations: "android.nfc.flags-aconfig",
+ min_sdk_version: "VanillaIceCream",
+ apex_available: [
+ "com.android.nfcservices",
+ ],
defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
diff --git a/ProtoLibraries.bp b/ProtoLibraries.bp
index 45bb16184069..5a802f553c5b 100644
--- a/ProtoLibraries.bp
+++ b/ProtoLibraries.bp
@@ -77,6 +77,40 @@ gensrcs {
output_extension: "proto.h",
}
+// ==== nfc framework java library ==============================
+gensrcs {
+ name: "framework-nfc-javastream-protos",
+
+ tools: [
+ "aprotoc",
+ "protoc-gen-javastream",
+ "soong_zip",
+ ],
+
+ cmd: "mkdir -p $(genDir)/$(in) " +
+ "&& $(location aprotoc) " +
+ " --plugin=$(location protoc-gen-javastream) " +
+ " --javastream_out=$(genDir)/$(in) " +
+ " -Iexternal/protobuf/src " +
+ " -I . " +
+ " $(in) " +
+ "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
+
+ srcs: [
+ "core/proto/android/app/pendingintent.proto",
+ "core/proto/android/content/component_name.proto",
+ "core/proto/android/content/intent.proto",
+ "core/proto/android/nfc/*.proto",
+ "core/proto/android/os/patternmatcher.proto",
+ ],
+
+ data: [
+ ":libprotobuf-internal-protos",
+ ],
+
+ output_extension: "srcjar",
+}
+
// ==== java proto host library ==============================
java_library_host {
name: "platformprotos",
diff --git a/core/proto/android/nfc/Android.bp b/core/proto/android/nfc/Android.bp
deleted file mode 100644
index 6a62c917f240..000000000000
--- a/core/proto/android/nfc/Android.bp
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Copyright (C) 2023 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: ["Android-Apache-2.0"],
-}
-
-filegroup {
- name: "srcs_nfc_proto",
- srcs: [
- "*.proto",
- ],
-}
-
-// Will be statically linked by `framework-nfc`.
-java_library {
- name: "nfc-proto-java-gen",
- installable: false,
- proto: {
- type: "stream",
- include_dirs: [
- "external/protobuf/src",
- ],
- },
- srcs: [
- ":srcs_nfc_proto",
- ],
- sdk_version: "current",
- min_sdk_version: "current",
-}