Merge "Add @RedactionType annotations to VpnTransportInfo."
diff --git a/Android.bp b/Android.bp
index 0b0a9b7..1415b6a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -257,37 +257,6 @@
srcs: ["framework-jarjar-rules.txt"],
}
-filegroup {
- name: "libincident_aidl",
- srcs: [
- "core/java/android/os/IIncidentDumpCallback.aidl",
- "core/java/android/os/IIncidentManager.aidl",
- "core/java/android/os/IIncidentReportStatusListener.aidl",
- ],
- path: "core/java",
-}
-
-filegroup {
- name: "libvibrator_aidl",
- srcs: [
- "core/java/android/os/IExternalVibrationController.aidl",
- "core/java/android/os/IExternalVibratorService.aidl",
- ],
- path: "core/java",
-}
-
-filegroup {
- name: "libpowermanager_aidl",
- srcs: [
- "core/java/android/os/Temperature.aidl",
- "core/java/android/os/CoolingDevice.aidl",
- "core/java/android/os/IThermalEventListener.aidl",
- "core/java/android/os/IThermalStatusListener.aidl",
- "core/java/android/os/IThermalService.aidl",
- ],
- path: "core/java",
-}
-
java_library {
name: "framework-minus-apex",
defaults: ["framework-aidl-export-defaults"],
@@ -376,84 +345,6 @@
src: ":framework-minus-apex",
}
-genrule {
- name: "statslog-framework-java-gen",
- tools: ["stats-log-api-gen"],
- cmd: "$(location stats-log-api-gen) --java $(out) --module framework" +
- " --javaPackage com.android.internal.util --javaClass FrameworkStatsLog --worksource",
- out: ["com/android/internal/util/FrameworkStatsLog.java"],
-}
-
-java_library {
- name: "uieventloggerlib",
- srcs: [
- "core/java/com/android/internal/logging/UiEvent.java",
- "core/java/com/android/internal/logging/UiEventLogger.java",
- "core/java/com/android/internal/logging/UiEventLoggerImpl.java",
- "core/java/com/android/internal/logging/InstanceId.java",
- "core/java/com/android/internal/logging/InstanceIdSequence.java",
- ":statslog-framework-java-gen",
- ],
-}
-
-gensrcs {
- name: "framework-javastream-protos",
- depfile: true,
-
- tools: [
- "aprotoc",
- "protoc-gen-javastream",
- "soong_zip",
- ],
-
- cmd: "mkdir -p $(genDir)/$(in) " +
- "&& $(location aprotoc) " +
- " --plugin=$(location protoc-gen-javastream) " +
- " --dependency_out=$(depfile) " +
- " --javastream_out=$(genDir)/$(in) " +
- " -Iexternal/protobuf/src " +
- " -I . " +
- " $(in) " +
- "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
-
- srcs: [
- ":ipconnectivity-proto-src",
- ":libstats_atom_enum_protos",
- ":libtombstone_proto-src",
- "core/proto/**/*.proto",
- "libs/incident/**/*.proto",
- ],
- output_extension: "srcjar",
-}
-
-gensrcs {
- name: "framework-cppstream-protos",
- depfile: true,
-
- tools: [
- "aprotoc",
- "protoc-gen-cppstream",
- ],
-
- cmd: "mkdir -p $(genDir) " +
- "&& $(location aprotoc) " +
- " --plugin=$(location protoc-gen-cppstream) " +
- " --dependency_out=$(depfile) " +
- " --cppstream_out=$(genDir) " +
- " -Iexternal/protobuf/src " +
- " -I . " +
- " $(in)",
-
- srcs: [
- ":ipconnectivity-proto-src",
- ":libstats_atom_enum_protos",
- "core/proto/**/*.proto",
- "libs/incident/**/*.proto",
- ],
-
- output_extension: "proto.h",
-}
-
filegroup {
name: "framework-annotations",
srcs: [
@@ -528,30 +419,6 @@
],
}
-filegroup {
- name: "framework-services-net-module-wifi-shared-srcs",
- srcs: [
- "core/java/android/net/DhcpResults.java",
- "core/java/android/util/LocalLog.java",
- ],
-}
-
-// keep these files in sync with the package/Tethering/jarjar-rules.txt and
-// package/Connectivity/jarjar-rules.txt for the tethering module and connectivity module.
-filegroup {
- name: "framework-connectivity-shared-srcs",
- srcs: [
- "core/java/android/util/LocalLog.java",
- // This should be android.util.IndentingPrintWriter, but it's not available in all branches.
- "core/java/com/android/internal/util/IndentingPrintWriter.java",
- "core/java/com/android/internal/util/IState.java",
- "core/java/com/android/internal/util/MessageUtils.java",
- "core/java/com/android/internal/util/State.java",
- "core/java/com/android/internal/util/StateMachine.java",
- "core/java/com/android/internal/util/WakeupMessage.java",
- ],
-}
-
// Build ext.jar
// ============================================================
java_library {
@@ -566,371 +433,6 @@
dxflags: ["--core-library"],
}
-// ==== java proto host library ==============================
-java_library_host {
- name: "platformprotos",
- srcs: [
- ":ipconnectivity-proto-src",
- ":libstats_atom_enum_protos",
- ":libstats_internal_protos",
- ":statsd_internal_protos",
- "cmds/am/proto/instrumentation_data.proto",
- "cmds/statsd/src/**/*.proto",
- "core/proto/**/*.proto",
- "libs/incident/proto/**/*.proto",
- ],
- proto: {
- include_dirs: [
- "external/protobuf/src",
- "frameworks/proto_logging/stats",
- ],
- type: "full",
- },
- errorprone: {
- javacflags: ["-Xep:MissingOverride:OFF"], // b/72714520
- },
-}
-
-// ==== java proto device library (for test only) ==============================
-java_library {
- name: "platformprotosnano",
- proto: {
- type: "nano",
- output_params: ["store_unknown_fields=true"],
- include_dirs: ["external/protobuf/src"],
- },
- exclude_srcs: [
- "core/proto/android/privacy.proto",
- "core/proto/android/section.proto",
- ],
- sdk_version: "9",
- srcs: [
- ":ipconnectivity-proto-src",
- ":libstats_atom_enum_protos",
- "core/proto/**/*.proto",
- "libs/incident/proto/android/os/**/*.proto",
- ],
-}
-
-// ==== java proto device library (for test only) ==============================
-java_library {
- name: "platformprotoslite",
- proto: {
- type: "lite",
- include_dirs: ["external/protobuf/src"],
- },
-
- srcs: [
- ":ipconnectivity-proto-src",
- ":libstats_atom_enum_protos",
- "core/proto/**/*.proto",
- "libs/incident/proto/android/os/**/*.proto",
- ],
- exclude_srcs: [
- "core/proto/android/privacy.proto",
- "core/proto/android/section.proto",
- ],
- sdk_version: "core_current",
- // Protos have lots of MissingOverride and similar.
- errorprone: {
- javacflags: ["-XepDisableAllChecks"],
- },
-}
-
-// ==== c++ proto device library ==============================
-cc_defaults {
- name: "libplatformprotos-defaults",
-
- proto: {
- export_proto_headers: true,
- include_dirs: [
- "external/protobuf/src",
- ],
- },
-
- cflags: [
- "-Wall",
- "-Werror",
- "-Wno-unused-parameter",
- ],
-
- srcs: [
- ":ipconnectivity-proto-src",
- ":libstats_atom_enum_protos",
- "core/proto/**/*.proto",
- ],
-}
-
-cc_library {
- name: "libplatformprotos",
- defaults: ["libplatformprotos-defaults"],
- host_supported: true,
-
- target: {
- host: {
- proto: {
- type: "full",
- },
- },
- android: {
- proto: {
- type: "lite",
- },
- shared_libs: [
- "libprotobuf-cpp-lite",
- ],
- shared: {
- enabled: false,
- },
- },
- },
-}
-
-// This library is meant for vendor code that needs to output protobuf. It links
-// against the static version of libprotobuf-cpp-lite, for which we can not guarantee
-// binary compatibility.
-cc_library {
- name: "libplatformprotos-static",
- defaults: ["libplatformprotos-defaults"],
- host_supported: false,
-
- // This is okay because this library is only built as a static library. The C++
- // API is not guaranteed. The proto API is guaranteed to be stable via Metrics Council,
- // but is not authorized to be used outside of debugging.
- vendor_available: true,
-
- target: {
- android: {
- proto: {
- type: "lite",
- },
- static_libs: [
- "libprotobuf-cpp-lite",
- ],
- shared: {
- enabled: false,
- },
- },
- },
-}
-
-// This is the full proto version of libplatformprotos. It may only
-// be used by test code that is not shipped on the device.
-cc_library {
- name: "libplatformprotos-test",
- defaults: ["libplatformprotos-defaults"],
- host_supported: false,
-
- target: {
- android: {
- proto: {
- type: "full",
- },
- shared: {
- enabled: false,
- },
- },
- },
-}
-
-filegroup {
- name: "incremental_aidl",
- srcs: [
- "core/java/android/os/incremental/IIncrementalServiceConnector.aidl",
- "core/java/android/os/incremental/IncrementalFileSystemControlParcel.aidl",
- ],
- path: "core/java",
-}
-
-filegroup {
- name: "dataloader_aidl",
- srcs: [
- "core/java/android/content/pm/DataLoaderParamsParcel.aidl",
- "core/java/android/content/pm/DataLoaderType.aidl",
- "core/java/android/content/pm/FileSystemControlParcel.aidl",
- "core/java/android/content/pm/IDataLoader.aidl",
- "core/java/android/content/pm/IDataLoaderManager.aidl",
- "core/java/android/content/pm/InstallationFileParcel.aidl",
- "core/java/android/content/pm/InstallationFileLocation.aidl",
- "core/java/android/content/pm/IDataLoaderStatusListener.aidl",
- "core/java/android/content/pm/IPackageInstallerSessionFileSystemConnector.aidl",
- ],
- path: "core/java",
-}
-
-filegroup {
- name: "incremental_manager_aidl",
- srcs: [
- "core/java/android/os/incremental/IIncrementalService.aidl",
- "core/java/android/os/incremental/IncrementalNewFileParams.aidl",
- "core/java/android/os/incremental/IStorageHealthListener.aidl",
- "core/java/android/os/incremental/StorageHealthCheckParams.aidl",
- ],
- path: "core/java",
-}
-
-filegroup {
- name: "activity_manager_procstate_aidl",
- srcs: [
- // internal only
- ],
- path: "core/java",
-}
-
-aidl_interface {
- name: "libincremental_aidl",
- unstable: true,
- srcs: [
- ":incremental_aidl",
- ],
- backend: {
- java: {
- sdk_version: "28",
- },
- cpp: {
- enabled: true,
- },
- ndk: {
- enabled: true,
- },
- },
-}
-
-aidl_interface {
- name: "libdataloader_aidl",
- unstable: true,
- srcs: [
- ":dataloader_aidl",
- ],
- imports: [
- "libincremental_aidl",
- ],
- backend: {
- java: {
- sdk_version: "28",
- },
- cpp: {
- enabled: true,
- },
- ndk: {
- enabled: false,
- },
- },
-}
-
-aidl_interface {
- name: "libincremental_manager_aidl",
- unstable: true,
- srcs: [
- ":incremental_manager_aidl",
- ],
- imports: [
- "libincremental_aidl",
- "libdataloader_aidl",
- ],
- backend: {
- java: {
- sdk_version: "28",
- },
- cpp: {
- enabled: true,
- },
- ndk: {
- enabled: false,
- },
- },
-}
-
-// Build Rust bindings for PermissionController. Needed by keystore2.
-aidl_interface {
- name: "android.os.permissions_aidl",
- unstable: true,
- local_include_dir: "core/java",
- srcs: [
- "core/java/android/os/IPermissionController.aidl",
- ],
- backend: {
- rust: {
- enabled: true,
- },
- },
-}
-
-python_defaults {
- name: "base_default",
- version: {
- py2: {
- enabled: false,
- embedded_launcher: false,
- },
- py3: {
- enabled: true,
- embedded_launcher: true,
- },
- },
-}
-
-python_binary_host {
- name: "fontchain_linter",
- defaults: ["base_default"],
- main: "tools/fonts/fontchain_linter.py",
- srcs: [
- "tools/fonts/fontchain_linter.py",
- ],
- libs: [
- "fontTools",
- ],
-}
-
-// Avoid including Parcelable classes as we don't want to have two copies of
-// Parcelable cross the libraries. This is used by telephony-common (frameworks/opt/telephony)
-// and TeleService app (packages/services/Telephony).
-filegroup {
- name: "framework-telephony-common-shared-srcs",
- srcs: [
- "core/java/android/os/RegistrantList.java",
- "core/java/android/os/Registrant.java",
- "core/java/android/util/LocalLog.java",
- "core/java/android/util/TimeUtils.java",
- "core/java/com/android/internal/os/SomeArgs.java",
- "core/java/com/android/internal/util/AsyncChannel.java",
- "core/java/com/android/internal/util/AsyncService.java",
- "core/java/com/android/internal/util/BitwiseInputStream.java",
- "core/java/com/android/internal/util/FastXmlSerializer.java",
- "core/java/com/android/internal/util/HexDump.java",
- "core/java/com/android/internal/util/IState.java",
- "core/java/com/android/internal/util/IndentingPrintWriter.java",
- "core/java/com/android/internal/util/Preconditions.java",
- "core/java/com/android/internal/util/State.java",
- "core/java/com/android/internal/util/StateMachine.java",
- "core/java/com/android/internal/util/UserIcons.java",
- ],
-}
-
-// Avoid including Parcelable classes as we don't want to have two copies of
-// Parcelable cross the process.
-filegroup {
- name: "framework-cellbroadcast-shared-srcs",
- srcs: [
- "core/java/android/os/HandlerExecutor.java",
- "core/java/android/util/LocalLog.java",
- "core/java/com/android/internal/util/IState.java",
- "core/java/com/android/internal/util/Preconditions.java",
- "core/java/com/android/internal/util/State.java",
- "core/java/com/android/internal/util/StateMachine.java",
- ],
-}
-
-filegroup {
- name: "framework-ims-common-shared-srcs",
- srcs: [
- "core/java/android/os/RegistrantList.java",
- "core/java/android/os/Registrant.java",
- "core/java/com/android/internal/os/SomeArgs.java",
- "core/java/com/android/internal/util/Preconditions.java",
- ],
-}
-
// utility classes statically linked into framework-wifi and dynamically linked
// into wifi-service
java_library {
@@ -959,33 +461,6 @@
],
}
-filegroup {
- name: "framework-wifi-util-lib-aidls",
- srcs: ["core/java/android/content/pm/ParceledListSlice.aidl"],
- path: "core/java",
-}
-
-// utility classes statically linked into wifi-service
-filegroup {
- name: "framework-wifi-service-shared-srcs",
- srcs: [
- "core/java/android/net/InterfaceConfiguration.java",
- "core/java/android/util/BackupUtils.java",
- "core/java/android/util/Rational.java",
- "core/java/com/android/internal/util/FastXmlSerializer.java",
- "core/java/com/android/internal/util/HexDump.java",
- "core/java/com/android/internal/util/IState.java",
- "core/java/com/android/internal/util/MessageUtils.java",
- "core/java/com/android/internal/util/State.java",
- "core/java/com/android/internal/util/StateMachine.java",
- "core/java/com/android/internal/util/WakeupMessage.java",
- ],
- visibility: [
- "//frameworks/opt/net/wifi/service",
- "//packages/modules/Wifi/service",
- ],
-}
-
// TODO(b/145644363): move this to under StubLibraries.bp or ApiDocs.bp
metalava_framework_docs_args = "--manifest $(location core/res/AndroidManifest.xml) " +
"--hide-package com.android.server " +
@@ -1019,4 +494,5 @@
build = [
"StubLibraries.bp",
"ApiDocs.bp",
+ "ProtoLibraries.bp",
]
diff --git a/OWNERS b/OWNERS
index 710f13e..4970dd1 100644
--- a/OWNERS
+++ b/OWNERS
@@ -30,3 +30,4 @@
per-file Android.mk = file:platform/build/soong:/OWNERS
per-file ApiDocs.bp = file:platform/build/soong:/OWNERS
per-file StubLibraries.bp = file:platform/build/soong:/OWNERS
+per-file ProtoLibraries.bp = file:platform/build/soong:/OWNERS
diff --git a/ProtoLibraries.bp b/ProtoLibraries.bp
new file mode 100644
index 0000000..c127449
--- /dev/null
+++ b/ProtoLibraries.bp
@@ -0,0 +1,238 @@
+// 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.
+
+gensrcs {
+ name: "framework-javastream-protos",
+ depfile: true,
+
+ tools: [
+ "aprotoc",
+ "protoc-gen-javastream",
+ "soong_zip",
+ ],
+
+ cmd: "mkdir -p $(genDir)/$(in) " +
+ "&& $(location aprotoc) " +
+ " --plugin=$(location protoc-gen-javastream) " +
+ " --dependency_out=$(depfile) " +
+ " --javastream_out=$(genDir)/$(in) " +
+ " -Iexternal/protobuf/src " +
+ " -I . " +
+ " $(in) " +
+ "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
+
+ srcs: [
+ ":ipconnectivity-proto-src",
+ ":libstats_atom_enum_protos",
+ ":libtombstone_proto-src",
+ "core/proto/**/*.proto",
+ "libs/incident/**/*.proto",
+ ],
+ output_extension: "srcjar",
+}
+
+gensrcs {
+ name: "framework-cppstream-protos",
+ depfile: true,
+
+ tools: [
+ "aprotoc",
+ "protoc-gen-cppstream",
+ ],
+
+ cmd: "mkdir -p $(genDir) " +
+ "&& $(location aprotoc) " +
+ " --plugin=$(location protoc-gen-cppstream) " +
+ " --dependency_out=$(depfile) " +
+ " --cppstream_out=$(genDir) " +
+ " -Iexternal/protobuf/src " +
+ " -I . " +
+ " $(in)",
+
+ srcs: [
+ ":ipconnectivity-proto-src",
+ ":libstats_atom_enum_protos",
+ "core/proto/**/*.proto",
+ "libs/incident/**/*.proto",
+ ],
+
+ output_extension: "proto.h",
+}
+
+// ==== java proto host library ==============================
+java_library_host {
+ name: "platformprotos",
+ srcs: [
+ ":ipconnectivity-proto-src",
+ ":libstats_atom_enum_protos",
+ ":libstats_internal_protos",
+ ":statsd_internal_protos",
+ "cmds/am/proto/instrumentation_data.proto",
+ "cmds/statsd/src/**/*.proto",
+ "core/proto/**/*.proto",
+ "libs/incident/proto/**/*.proto",
+ ],
+ proto: {
+ include_dirs: [
+ "external/protobuf/src",
+ "frameworks/proto_logging/stats",
+ ],
+ type: "full",
+ },
+ errorprone: {
+ javacflags: ["-Xep:MissingOverride:OFF"], // b/72714520
+ },
+}
+
+// ==== java proto device library (for test only) ==============================
+java_library {
+ name: "platformprotosnano",
+ proto: {
+ type: "nano",
+ output_params: ["store_unknown_fields=true"],
+ include_dirs: ["external/protobuf/src"],
+ },
+ exclude_srcs: [
+ "core/proto/android/privacy.proto",
+ "core/proto/android/section.proto",
+ ],
+ sdk_version: "9",
+ srcs: [
+ ":ipconnectivity-proto-src",
+ ":libstats_atom_enum_protos",
+ "core/proto/**/*.proto",
+ "libs/incident/proto/android/os/**/*.proto",
+ ],
+}
+
+// ==== java proto device library (for test only) ==============================
+java_library {
+ name: "platformprotoslite",
+ proto: {
+ type: "lite",
+ include_dirs: ["external/protobuf/src"],
+ },
+
+ srcs: [
+ ":ipconnectivity-proto-src",
+ ":libstats_atom_enum_protos",
+ "core/proto/**/*.proto",
+ "libs/incident/proto/android/os/**/*.proto",
+ ],
+ exclude_srcs: [
+ "core/proto/android/privacy.proto",
+ "core/proto/android/section.proto",
+ ],
+ sdk_version: "core_current",
+ // Protos have lots of MissingOverride and similar.
+ errorprone: {
+ javacflags: ["-XepDisableAllChecks"],
+ },
+}
+
+// ==== c++ proto device library ==============================
+cc_defaults {
+ name: "libplatformprotos-defaults",
+
+ proto: {
+ export_proto_headers: true,
+ include_dirs: [
+ "external/protobuf/src",
+ ],
+ },
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+
+ srcs: [
+ ":ipconnectivity-proto-src",
+ ":libstats_atom_enum_protos",
+ "core/proto/**/*.proto",
+ ],
+}
+
+cc_library {
+ name: "libplatformprotos",
+ defaults: ["libplatformprotos-defaults"],
+ host_supported: true,
+
+ target: {
+ host: {
+ proto: {
+ type: "full",
+ },
+ },
+ android: {
+ proto: {
+ type: "lite",
+ },
+ shared_libs: [
+ "libprotobuf-cpp-lite",
+ ],
+ shared: {
+ enabled: false,
+ },
+ },
+ },
+}
+
+// This library is meant for vendor code that needs to output protobuf. It links
+// against the static version of libprotobuf-cpp-lite, for which we can not guarantee
+// binary compatibility.
+cc_library {
+ name: "libplatformprotos-static",
+ defaults: ["libplatformprotos-defaults"],
+ host_supported: false,
+
+ // This is okay because this library is only built as a static library. The C++
+ // API is not guaranteed. The proto API is guaranteed to be stable via Metrics Council,
+ // but is not authorized to be used outside of debugging.
+ vendor_available: true,
+
+ target: {
+ android: {
+ proto: {
+ type: "lite",
+ },
+ static_libs: [
+ "libprotobuf-cpp-lite",
+ ],
+ shared: {
+ enabled: false,
+ },
+ },
+ },
+}
+
+// This is the full proto version of libplatformprotos. It may only
+// be used by test code that is not shipped on the device.
+cc_library {
+ name: "libplatformprotos-test",
+ defaults: ["libplatformprotos-defaults"],
+ host_supported: false,
+
+ target: {
+ android: {
+ proto: {
+ type: "full",
+ },
+ shared: {
+ enabled: false,
+ },
+ },
+ },
+}
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 41cbb6a..ae92e79 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -111,7 +111,7 @@
last_released: {
api_file: ":android-non-updatable.api.public.latest",
removed_api_file: ":android-non-updatable-removed.api.public.latest",
- baseline_file: ":android-incompatibilities.api.public.latest",
+ baseline_file: ":android-non-updatable-incompatibilities.api.public.latest",
},
api_lint: {
enabled: true,
@@ -163,7 +163,7 @@
last_released: {
api_file: ":android-non-updatable.api.system.latest",
removed_api_file: ":android-non-updatable-removed.api.system.latest",
- baseline_file: ":android-incompatibilities.api.system.latest"
+ baseline_file: ":android-non-updatable-incompatibilities.api.system.latest"
},
api_lint: {
enabled: true,
@@ -302,11 +302,6 @@
name: "android-non-updatable_defaults_stubs_current",
libs: ["stub-annotations"],
static_libs: ["framework-res-package-jar"], // Export package of framework-res
- errorprone: {
- javacflags: [
- "-XepDisableAllChecks",
- ],
- },
sdk_version: "none",
system_modules: "none",
java_version: "1.8",
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 7828ea5..5edd16a 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -1480,6 +1480,7 @@
method public boolean disableBLE();
method public boolean enableBLE();
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean enableNoAutoConnect();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void generateLocalOobData(int, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OobDataCallback);
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public long getDiscoveryEndMillis();
method public boolean isBleScanAlwaysAvailable();
method public boolean isLeEnabled();
@@ -1491,12 +1492,18 @@
field public static final int ACTIVE_DEVICE_ALL = 2; // 0x2
field public static final int ACTIVE_DEVICE_AUDIO = 0; // 0x0
field public static final int ACTIVE_DEVICE_PHONE_CALL = 1; // 0x1
+ field public static final int OOB_ERROR_ADAPTER_DISABLED = 2; // 0x2
+ field public static final int OOB_ERROR_ANOTHER_ACTIVE_REQUEST = 1; // 0x1
+ field public static final int OOB_ERROR_UNKNOWN = 0; // 0x0
}
public static interface BluetoothAdapter.OnMetadataChangedListener {
method public void onMetadataChanged(@NonNull android.bluetooth.BluetoothDevice, int, @Nullable byte[]);
}
+ public static interface BluetoothAdapter.OobDataCallback {
+ }
+
public final class BluetoothDevice implements android.os.Parcelable {
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelBondProcess();
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean createBondOutOfBand(int, @Nullable android.bluetooth.OobData, @Nullable android.bluetooth.OobData);
diff --git a/core/java/Android.bp b/core/java/Android.bp
index 919f1e2..965665d 100644
--- a/core/java/Android.bp
+++ b/core/java/Android.bp
@@ -127,3 +127,269 @@
],
visibility: ["//frameworks/base/test-mock"],
}
+
+filegroup {
+ name: "libincident_aidl",
+ srcs: [
+ "android/os/IIncidentDumpCallback.aidl",
+ "android/os/IIncidentManager.aidl",
+ "android/os/IIncidentReportStatusListener.aidl",
+ ],
+}
+
+filegroup {
+ name: "libvibrator_aidl",
+ srcs: [
+ "android/os/IExternalVibrationController.aidl",
+ "android/os/IExternalVibratorService.aidl",
+ ],
+}
+
+filegroup {
+ name: "libpowermanager_aidl",
+ srcs: [
+ "android/os/Temperature.aidl",
+ "android/os/CoolingDevice.aidl",
+ "android/os/IThermalEventListener.aidl",
+ "android/os/IThermalStatusListener.aidl",
+ "android/os/IThermalService.aidl",
+ ],
+}
+
+genrule {
+ name: "statslog-framework-java-gen",
+ tools: ["stats-log-api-gen"],
+ cmd: "$(location stats-log-api-gen) --java $(out) --module framework" +
+ " --javaPackage com.android.internal.util --javaClass FrameworkStatsLog --worksource",
+ out: ["com/android/internal/util/FrameworkStatsLog.java"],
+}
+
+java_library {
+ name: "uieventloggerlib",
+ srcs: [
+ "com/android/internal/logging/UiEvent.java",
+ "com/android/internal/logging/UiEventLogger.java",
+ "com/android/internal/logging/UiEventLoggerImpl.java",
+ "com/android/internal/logging/InstanceId.java",
+ "com/android/internal/logging/InstanceIdSequence.java",
+ ":statslog-framework-java-gen",
+ ],
+}
+
+filegroup {
+ name: "framework-services-net-module-wifi-shared-srcs",
+ srcs: [
+ "android/net/DhcpResults.java",
+ "android/util/LocalLog.java",
+ ],
+}
+
+// keep these files in sync with the package/Tethering/jarjar-rules.txt and
+// package/Connectivity/jarjar-rules.txt for the tethering module and connectivity module.
+filegroup {
+ name: "framework-connectivity-shared-srcs",
+ srcs: [
+ "android/util/LocalLog.java",
+ // This should be android.util.IndentingPrintWriter, but it's not available in all branches.
+ "com/android/internal/util/IndentingPrintWriter.java",
+ "com/android/internal/util/IState.java",
+ "com/android/internal/util/MessageUtils.java",
+ "com/android/internal/util/State.java",
+ "com/android/internal/util/StateMachine.java",
+ "com/android/internal/util/WakeupMessage.java",
+ ],
+}
+
+filegroup {
+ name: "incremental_aidl",
+ srcs: [
+ "android/os/incremental/IIncrementalServiceConnector.aidl",
+ "android/os/incremental/IncrementalFileSystemControlParcel.aidl",
+ ],
+}
+
+filegroup {
+ name: "dataloader_aidl",
+ srcs: [
+ "android/content/pm/DataLoaderParamsParcel.aidl",
+ "android/content/pm/DataLoaderType.aidl",
+ "android/content/pm/FileSystemControlParcel.aidl",
+ "android/content/pm/IDataLoader.aidl",
+ "android/content/pm/IDataLoaderManager.aidl",
+ "android/content/pm/InstallationFileParcel.aidl",
+ "android/content/pm/InstallationFileLocation.aidl",
+ "android/content/pm/IDataLoaderStatusListener.aidl",
+ "android/content/pm/IPackageInstallerSessionFileSystemConnector.aidl",
+ ],
+}
+
+filegroup {
+ name: "incremental_manager_aidl",
+ srcs: [
+ "android/os/incremental/IIncrementalService.aidl",
+ "android/os/incremental/IncrementalNewFileParams.aidl",
+ "android/os/incremental/IStorageHealthListener.aidl",
+ "android/os/incremental/StorageHealthCheckParams.aidl",
+ ],
+}
+
+filegroup {
+ name: "activity_manager_procstate_aidl",
+ srcs: [
+ // internal only
+ ],
+}
+
+aidl_interface {
+ name: "libincremental_aidl",
+ unstable: true,
+ srcs: [
+ ":incremental_aidl",
+ ],
+ backend: {
+ java: {
+ sdk_version: "28",
+ },
+ cpp: {
+ enabled: true,
+ },
+ ndk: {
+ enabled: true,
+ },
+ },
+}
+
+aidl_interface {
+ name: "libdataloader_aidl",
+ unstable: true,
+ srcs: [
+ ":dataloader_aidl",
+ ],
+ imports: [
+ "libincremental_aidl",
+ ],
+ backend: {
+ java: {
+ sdk_version: "28",
+ },
+ cpp: {
+ enabled: true,
+ },
+ ndk: {
+ enabled: false,
+ },
+ },
+}
+
+aidl_interface {
+ name: "libincremental_manager_aidl",
+ unstable: true,
+ srcs: [
+ ":incremental_manager_aidl",
+ ],
+ imports: [
+ "libincremental_aidl",
+ "libdataloader_aidl",
+ ],
+ backend: {
+ java: {
+ sdk_version: "28",
+ },
+ cpp: {
+ enabled: true,
+ },
+ ndk: {
+ enabled: false,
+ },
+ },
+}
+
+// Build Rust bindings for PermissionController. Needed by keystore2.
+aidl_interface {
+ name: "android.os.permissions_aidl",
+ unstable: true,
+ local_include_dir: ".",
+ srcs: [
+ "android/os/IPermissionController.aidl",
+ ],
+ backend: {
+ rust: {
+ enabled: true,
+ },
+ },
+}
+
+// Avoid including Parcelable classes as we don't want to have two copies of
+// Parcelable cross the libraries. This is used by telephony-common (frameworks/opt/telephony)
+// and TeleService app (packages/services/Telephony).
+filegroup {
+ name: "framework-telephony-common-shared-srcs",
+ srcs: [
+ "android/os/RegistrantList.java",
+ "android/os/Registrant.java",
+ "android/util/LocalLog.java",
+ "android/util/TimeUtils.java",
+ "com/android/internal/os/SomeArgs.java",
+ "com/android/internal/util/AsyncChannel.java",
+ "com/android/internal/util/AsyncService.java",
+ "com/android/internal/util/BitwiseInputStream.java",
+ "com/android/internal/util/FastXmlSerializer.java",
+ "com/android/internal/util/HexDump.java",
+ "com/android/internal/util/IState.java",
+ "com/android/internal/util/IndentingPrintWriter.java",
+ "com/android/internal/util/Preconditions.java",
+ "com/android/internal/util/State.java",
+ "com/android/internal/util/StateMachine.java",
+ "com/android/internal/util/UserIcons.java",
+ ],
+}
+
+// Avoid including Parcelable classes as we don't want to have two copies of
+// Parcelable cross the process.
+filegroup {
+ name: "framework-cellbroadcast-shared-srcs",
+ srcs: [
+ "android/os/HandlerExecutor.java",
+ "android/util/LocalLog.java",
+ "com/android/internal/util/IState.java",
+ "com/android/internal/util/Preconditions.java",
+ "com/android/internal/util/State.java",
+ "com/android/internal/util/StateMachine.java",
+ ],
+}
+
+filegroup {
+ name: "framework-ims-common-shared-srcs",
+ srcs: [
+ "android/os/RegistrantList.java",
+ "android/os/Registrant.java",
+ "com/android/internal/os/SomeArgs.java",
+ "com/android/internal/util/Preconditions.java",
+ ],
+}
+
+filegroup {
+ name: "framework-wifi-util-lib-aidls",
+ srcs: ["android/content/pm/ParceledListSlice.aidl"],
+}
+
+// utility classes statically linked into wifi-service
+filegroup {
+ name: "framework-wifi-service-shared-srcs",
+ srcs: [
+ "android/net/InterfaceConfiguration.java",
+ "android/util/BackupUtils.java",
+ "android/util/Rational.java",
+ "com/android/internal/util/FastXmlSerializer.java",
+ "com/android/internal/util/HexDump.java",
+ "com/android/internal/util/IState.java",
+ "com/android/internal/util/MessageUtils.java",
+ "com/android/internal/util/State.java",
+ "com/android/internal/util/StateMachine.java",
+ "com/android/internal/util/WakeupMessage.java",
+ ],
+ visibility: [
+ "//frameworks/opt/net/wifi/service",
+ "//packages/modules/Wifi/service",
+ ],
+}
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 38863c2..7d62327 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -28,6 +28,7 @@
import android.annotation.SystemApi;
import android.app.ActivityThread;
import android.app.PropertyInvalidatedCache;
+import android.bluetooth.BluetoothDevice.Transport;
import android.bluetooth.BluetoothProfile.ConnectionPolicy;
import android.bluetooth.le.BluetoothLeAdvertiser;
import android.bluetooth.le.BluetoothLeScanner;
@@ -3013,6 +3014,168 @@
return false;
}
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = { "OOB_ERROR_" }, value = {
+ OOB_ERROR_UNKNOWN,
+ OOB_ERROR_ANOTHER_ACTIVE_REQUEST,
+ OOB_ERROR_ADAPTER_DISABLED
+ })
+ public @interface OobError {}
+
+ /**
+ * An unknown error has occurred in the controller, stack, or callback pipeline.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int OOB_ERROR_UNKNOWN = 0;
+
+ /**
+ * If another application has already requested {@link OobData} then another fetch will be
+ * disallowed until the callback is removed.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int OOB_ERROR_ANOTHER_ACTIVE_REQUEST = 1;
+
+ /**
+ * The adapter is currently disabled, please enable it.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int OOB_ERROR_ADAPTER_DISABLED = 2;
+
+ /**
+ * Provides callback methods for receiving {@link OobData} from the host stack, as well as an
+ * error interface in order to allow the caller to determine next steps based on the {@link
+ * ErrorCode}.
+ *
+ * @hide
+ */
+ @SystemApi
+ public interface OobDataCallback {
+ /**
+ * Handles the {@link OobData} received from the host stack.
+ *
+ * @param transport - whether the {@link OobData} is generated for LE or Classic.
+ * @param oobData - data generated in the host stack(LE) or controller (Classic)
+ *
+ * @hide
+ */
+ void onOobData(@Transport int transport, @Nullable OobData oobData);
+
+ /**
+ * Provides feedback when things don't go as expected.
+ *
+ * @param errorCode - the code descibing the type of error that occurred.
+ *
+ * @hide
+ */
+ void onError(@OobError int errorCode);
+ }
+
+ /**
+ * Wraps an AIDL interface around an {@link OobDataCallback} interface.
+ *
+ * @see {@link IBluetoothOobDataCallback} for interface definition.
+ *
+ * @hide
+ */
+ public class WrappedOobDataCallback extends IBluetoothOobDataCallback.Stub {
+ private final OobDataCallback mCallback;
+ private final Executor mExecutor;
+
+ /**
+ * @param callback - object to receive {@link OobData} must be a non null argument
+ *
+ * @throws NullPointerException if the callback is null.
+ */
+ WrappedOobDataCallback(@NonNull OobDataCallback callback,
+ @NonNull @CallbackExecutor Executor executor) {
+ Preconditions.checkNotNull(callback);
+ Preconditions.checkNotNull(executor);
+ mCallback = callback;
+ mExecutor = executor;
+ }
+ /**
+ * Wrapper function to relay to the {@link OobDataCallback#onOobData}
+ *
+ * @param transport - whether the {@link OobData} is generated for LE or Classic.
+ * @param oobData - data generated in the host stack(LE) or controller (Classic)
+ *
+ * @hide
+ */
+ public void onOobData(@Transport int transport, OobData oobData) {
+ mExecutor.execute(new Runnable() {
+ public void run() {
+ mCallback.onOobData(transport, oobData);
+ }
+ });
+ }
+ /**
+ * Wrapper function to relay to the {@link OobDataCallback#onError}
+ *
+ * @param errorCode - the code descibing the type of error that occurred.
+ *
+ * @hide
+ */
+ public void onError(@OobError int errorCode) {
+ mExecutor.execute(new Runnable() {
+ public void run() {
+ mCallback.onError(errorCode);
+ }
+ });
+ }
+ }
+
+ /**
+ * Fetches a secret data value that can be used for a secure and simple pairing experience.
+ *
+ * <p>This is the Local Out of Band data the comes from the
+ *
+ * <p>This secret is the local Out of Band data. This data is used to securely and quickly
+ * pair two devices with minimal user interaction.
+ *
+ * <p>For example, this secret can be transferred to a remote device out of band (meaning any
+ * other way besides using bluetooth). Once the remote device finds this device using the
+ * information given in the data, such as the PUBLIC ADDRESS, the remote device could then
+ * connect to this device using this secret when the pairing sequenece asks for the secret.
+ * This device will respond by automatically accepting the pairing due to the secret being so
+ * trustworthy.
+ *
+ * @param transport - provide type of transport (e.g. LE or Classic).
+ * @param callback - target object to receive the {@link OobData} value.
+ *
+ * @throws NullPointerException if callback is null.
+ * @throws IllegalArgumentException if the transport is not valid.
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
+ public void generateLocalOobData(@Transport int transport,
+ @NonNull @CallbackExecutor Executor executor, @NonNull OobDataCallback callback) {
+ if (transport != BluetoothDevice.TRANSPORT_BREDR && transport
+ != BluetoothDevice.TRANSPORT_LE) {
+ throw new IllegalArgumentException("Invalid transport '" + transport + "'!");
+ }
+ Preconditions.checkNotNull(callback);
+ if (!isEnabled()) {
+ Log.w(TAG, "generateLocalOobData(): Adapter isn't enabled!");
+ callback.onError(OOB_ERROR_ADAPTER_DISABLED);
+ } else {
+ try {
+ mService.generateLocalOobData(transport, new WrappedOobDataCallback(callback,
+ executor));
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ }
+ }
+ }
+
/**
* Enable control of the Bluetooth Adapter for a single application.
*
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index c30b8af..a40bf34 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -931,6 +931,21 @@
@SystemApi
public static final int ACCESS_REJECTED = 2;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(
+ prefix = { "TRANSPORT_" },
+ value = {
+ /** Allow host to automatically select a transport (dual-mode only) */
+ TRANSPORT_AUTO,
+ /** Use Classic or BR/EDR transport.*/
+ TRANSPORT_BREDR,
+ /** Use Low Energy transport.*/
+ TRANSPORT_LE,
+ }
+ )
+ public @interface Transport {}
+
/**
* No preference of physical transport for GATT connections to remote dual-mode devices
*/
@@ -1063,6 +1078,10 @@
public void onBrEdrDown() {
if (DBG) Log.d(TAG, "onBrEdrDown: reached BLE ON state");
}
+
+ public void onOobData(@Transport int transport, OobData oobData) {
+ if (DBG) Log.d(TAG, "onOobData: got data");
+ }
};
/**
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index bfe7802..58eb93f 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1834,7 +1834,7 @@
<string name="config_systemGallery" translatable="false">com.android.gallery3d</string>
<!-- The name of the package that will be allowed to change its components' label/icon. -->
- <string name="config_overrideComponentUiPackage" translatable="false"></string>
+ <string name="config_overrideComponentUiPackage" translatable="false">com.android.stk</string>
<!-- Enable/disable default bluetooth profiles:
HSP_AG, ObexObjectPush, Audio, NAP -->
diff --git a/services/core/java/com/android/server/hdmi/ArcTerminationActionFromAvr.java b/services/core/java/com/android/server/hdmi/ArcTerminationActionFromAvr.java
index dedf2e2..049a339 100644
--- a/services/core/java/com/android/server/hdmi/ArcTerminationActionFromAvr.java
+++ b/services/core/java/com/android/server/hdmi/ArcTerminationActionFromAvr.java
@@ -49,10 +49,7 @@
switch (cmd.getOpcode()) {
case Constants.MESSAGE_REPORT_ARC_TERMINATED:
mState = STATE_ARC_TERMINATED;
- audioSystem().setArcStatus(false);
- if (audioSystem().getLocalActivePort() == Constants.CEC_SWITCH_ARC) {
- audioSystem().routeToInputFromPortId(audioSystem().getRoutingPort());
- }
+ audioSystem().processArcTermination();
finish();
return true;
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
index 345aa27..39a9119 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
@@ -570,8 +570,7 @@
@ServiceThreadOnly
protected boolean handleReportArcTermination(HdmiCecMessage message) {
assertRunOnServiceThread();
- // TODO(amyjojo): implement report arc terminate handler
- HdmiLogger.debug(TAG + "Stub handleReportArcTermination");
+ processArcTermination();
return true;
}
@@ -916,6 +915,14 @@
mArcEstablished = enabled;
}
+ void processArcTermination() {
+ setArcStatus(false);
+ // Switch away from ARC input when ARC is terminated.
+ if (getLocalActivePort() == Constants.CEC_SWITCH_ARC) {
+ routeToInputFromPortId(getRoutingPort());
+ }
+ }
+
/** Switch hardware ARC circuit in the system. */
@ServiceThreadOnly
private void enableAudioReturnChannel(boolean enabled) {
diff --git a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
index 83ac36f..1d55ba4 100644
--- a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
+++ b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
@@ -23,6 +23,7 @@
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED;
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
+import static android.net.ipsec.ike.exceptions.IkeProtocolException.ERROR_TYPE_AUTHENTICATION_FAILED;
import static android.net.vcn.VcnManager.VCN_ERROR_CODE_CONFIG_ERROR;
import static android.net.vcn.VcnManager.VCN_ERROR_CODE_INTERNAL_ERROR;
import static android.net.vcn.VcnManager.VCN_ERROR_CODE_NETWORK_ERROR;
@@ -57,7 +58,6 @@
import android.net.ipsec.ike.IkeSessionCallback;
import android.net.ipsec.ike.IkeSessionConfiguration;
import android.net.ipsec.ike.IkeSessionParams;
-import android.net.ipsec.ike.exceptions.AuthenticationFailedException;
import android.net.ipsec.ike.exceptions.IkeException;
import android.net.ipsec.ike.exceptions.IkeInternalException;
import android.net.ipsec.ike.exceptions.IkeProtocolException;
@@ -1051,12 +1051,21 @@
sessionLostWithoutCallback(token, exception);
}
+ private static boolean isIkeAuthFailure(@NonNull Exception exception) {
+ if (!(exception instanceof IkeProtocolException)) {
+ return false;
+ }
+
+ return ((IkeProtocolException) exception).getErrorType()
+ == ERROR_TYPE_AUTHENTICATION_FAILED;
+ }
+
private void notifyStatusCallbackForSessionClosed(@NonNull Exception exception) {
final int errorCode;
final String exceptionClass;
final String exceptionMessage;
- if (exception instanceof AuthenticationFailedException) {
+ if (isIkeAuthFailure(exception)) {
errorCode = VCN_ERROR_CODE_CONFIG_ERROR;
exceptionClass = exception.getClass().getName();
exceptionMessage = exception.getMessage();
diff --git a/services/core/java/com/android/server/vcn/util/MtuUtils.java b/services/core/java/com/android/server/vcn/util/MtuUtils.java
index 49c1a02..5d40cca 100644
--- a/services/core/java/com/android/server/vcn/util/MtuUtils.java
+++ b/services/core/java/com/android/server/vcn/util/MtuUtils.java
@@ -113,7 +113,6 @@
return IPV6_MIN_MTU;
}
- boolean hasUnknownAlgorithm = false;
int maxAuthOverhead = 0;
int maxCryptOverhead = 0;
int maxAuthCryptOverhead = 0;
diff --git a/services/tests/servicestests/src/com/android/server/uwb/OWNERS b/services/tests/servicestests/src/com/android/server/uwb/OWNERS
new file mode 100644
index 0000000..c31a2f1
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/uwb/OWNERS
@@ -0,0 +1 @@
+include platform/frameworks/base:/core/java/android/uwb/OWNERS
diff --git a/services/uwb/OWNERS b/services/uwb/OWNERS
new file mode 100644
index 0000000..c31a2f1
--- /dev/null
+++ b/services/uwb/OWNERS
@@ -0,0 +1 @@
+include platform/frameworks/base:/core/java/android/uwb/OWNERS
diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
index bb67593..a2223e8 100644
--- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
+++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
@@ -20,6 +20,8 @@
import static android.net.IpSecManager.DIRECTION_OUT;
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
+import static android.net.ipsec.ike.exceptions.IkeProtocolException.ERROR_TYPE_AUTHENTICATION_FAILED;
+import static android.net.ipsec.ike.exceptions.IkeProtocolException.ERROR_TYPE_TEMPORARY_FAILURE;
import static android.net.vcn.VcnManager.VCN_ERROR_CODE_CONFIG_ERROR;
import static android.net.vcn.VcnManager.VCN_ERROR_CODE_INTERNAL_ERROR;
import static android.net.vcn.VcnManager.VCN_ERROR_CODE_NETWORK_ERROR;
@@ -41,6 +43,7 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
import android.net.ConnectivityManager;
import android.net.LinkAddress;
@@ -48,10 +51,9 @@
import android.net.NetworkAgent;
import android.net.NetworkCapabilities;
import android.net.ipsec.ike.ChildSaProposal;
-import android.net.ipsec.ike.exceptions.AuthenticationFailedException;
import android.net.ipsec.ike.exceptions.IkeException;
import android.net.ipsec.ike.exceptions.IkeInternalException;
-import android.net.ipsec.ike.exceptions.TemporaryFailureException;
+import android.net.ipsec.ike.exceptions.IkeProtocolException;
import android.net.vcn.VcnControlPlaneIkeConfig;
import android.net.vcn.VcnManager.VcnErrorCode;
@@ -470,10 +472,17 @@
any());
}
+ private static IkeProtocolException buildMockIkeProtocolException(int errorCode) {
+ final IkeProtocolException exception = mock(IkeProtocolException.class);
+ when(exception.getErrorType()).thenReturn(errorCode);
+ return exception;
+ }
+
@Test
public void testIkeSessionClosedExceptionallyAuthenticationFailure() throws Exception {
verifyIkeSessionClosedExceptionalltyNotifiesStatusCallback(
- new AuthenticationFailedException("vcn test"), VCN_ERROR_CODE_CONFIG_ERROR);
+ buildMockIkeProtocolException(ERROR_TYPE_AUTHENTICATION_FAILED),
+ VCN_ERROR_CODE_CONFIG_ERROR);
}
@Test
@@ -485,7 +494,8 @@
@Test
public void testIkeSessionClosedExceptionallyInternalFailure() throws Exception {
verifyIkeSessionClosedExceptionalltyNotifiesStatusCallback(
- new TemporaryFailureException("vcn test"), VCN_ERROR_CODE_INTERNAL_ERROR);
+ buildMockIkeProtocolException(ERROR_TYPE_TEMPORARY_FAILURE),
+ VCN_ERROR_CODE_INTERNAL_ERROR);
}
@Test
diff --git a/tools/fonts/Android.bp b/tools/fonts/Android.bp
new file mode 100644
index 0000000..bf50661
--- /dev/null
+++ b/tools/fonts/Android.bp
@@ -0,0 +1,39 @@
+// 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.
+
+python_defaults {
+ name: "fonts_python_defaults",
+ version: {
+ py2: {
+ enabled: false,
+ embedded_launcher: false,
+ },
+ py3: {
+ enabled: true,
+ embedded_launcher: true,
+ },
+ },
+}
+
+python_binary_host {
+ name: "fontchain_linter",
+ defaults: ["fonts_python_defaults"],
+ main: "fontchain_linter.py",
+ srcs: [
+ "fontchain_linter.py",
+ ],
+ libs: [
+ "fontTools",
+ ],
+}