From fcdd15eeec93a1d35377df20eb0412dbb3e66da4 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Mon, 15 Feb 2021 20:16:28 +0900 Subject: [PATCH] Split parcelable .aidl files to aidl-export The one-line "parcelable X" files need to be imported by targets that do not build against SDK (the SDK has prebuilt definitions), so prepare a dedicated directory for them. This avoids having users of the classes include the whole src/ directory, which could contain definitions for classes that are not part of the public API, so should not be imported. Also move back to frameworks/base/core some .aidl definitions that were separated from their associated class. Bug: 171540887 Test: m Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549 Change-Id: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549 --- framework/Android.bp | 27 +++++++++++++++++-- .../android/net/CaptivePortalData.aidl | 0 .../net/ConnectivityDiagnosticsManager.aidl | 0 .../android/net/DhcpInfo.aidl | 0 .../android/net/IpConfiguration.aidl | 0 .../android/net/IpPrefix.aidl | 0 .../android/net/KeepalivePacketData.aidl | 0 .../android/net/LinkAddress.aidl | 0 .../android/net/LinkProperties.aidl | 0 .../android/net/MacAddress.aidl | 0 .../android/net/Network.aidl | 0 .../android/net/NetworkAgentConfig.aidl | 0 .../android/net/NetworkCapabilities.aidl | 0 .../android/net/NetworkInfo.aidl | 0 .../android/net/NetworkRequest.aidl | 0 .../android/net/ProxyInfo.aidl | 0 .../android/net/RouteInfo.aidl | 0 .../android/net/StaticIpConfiguration.aidl | 0 .../android/net/TestNetworkInterface.aidl | 0 .../android/net/apf/ApfCapabilities.aidl | 0 .../android/net/ConnectivityMetricsEvent.aidl | 20 -------------- .../android/net/InterfaceConfiguration.aidl | 19 ------------- framework/src/android/net/UidRange.aidl | 24 ----------------- 23 files changed, 25 insertions(+), 65 deletions(-) rename framework/{src => aidl-export}/android/net/CaptivePortalData.aidl (100%) rename framework/{src => aidl-export}/android/net/ConnectivityDiagnosticsManager.aidl (100%) rename framework/{src => aidl-export}/android/net/DhcpInfo.aidl (100%) rename framework/{src => aidl-export}/android/net/IpConfiguration.aidl (100%) rename framework/{src => aidl-export}/android/net/IpPrefix.aidl (100%) rename framework/{src => aidl-export}/android/net/KeepalivePacketData.aidl (100%) rename framework/{src => aidl-export}/android/net/LinkAddress.aidl (100%) rename framework/{src => aidl-export}/android/net/LinkProperties.aidl (100%) rename framework/{src => aidl-export}/android/net/MacAddress.aidl (100%) rename framework/{src => aidl-export}/android/net/Network.aidl (100%) rename framework/{src => aidl-export}/android/net/NetworkAgentConfig.aidl (100%) rename framework/{src => aidl-export}/android/net/NetworkCapabilities.aidl (100%) rename framework/{src => aidl-export}/android/net/NetworkInfo.aidl (100%) rename framework/{src => aidl-export}/android/net/NetworkRequest.aidl (100%) rename framework/{src => aidl-export}/android/net/ProxyInfo.aidl (100%) rename framework/{src => aidl-export}/android/net/RouteInfo.aidl (100%) rename framework/{src => aidl-export}/android/net/StaticIpConfiguration.aidl (100%) rename framework/{src => aidl-export}/android/net/TestNetworkInterface.aidl (100%) rename framework/{src => aidl-export}/android/net/apf/ApfCapabilities.aidl (100%) delete mode 100644 framework/src/android/net/ConnectivityMetricsEvent.aidl delete mode 100644 framework/src/android/net/InterfaceConfiguration.aidl delete mode 100644 framework/src/android/net/UidRange.aidl diff --git a/framework/Android.bp b/framework/Android.bp index 3326ea9edd..ffca971430 100644 --- a/framework/Android.bp +++ b/framework/Android.bp @@ -14,7 +14,6 @@ // limitations under the License. // -// TODO: use a java_library in the bootclasspath instead package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import @@ -24,13 +23,37 @@ package { default_applicable_licenses: ["frameworks_base_license"], } +// TODO: use a java_library in the bootclasspath instead filegroup { - name: "framework-connectivity-sources", + name: "framework-connectivity-internal-sources", srcs: [ "src/**/*.java", "src/**/*.aidl", ], path: "src", + visibility: [ + "//visibility:private", + ], +} + +filegroup { + name: "framework-connectivity-aidl-export-sources", + srcs: [ + "aidl-export/**/*.aidl", + ], + path: "aidl-export", + visibility: [ + "//visibility:private", + ], +} + +// TODO: use a java_library in the bootclasspath instead +filegroup { + name: "framework-connectivity-sources", + srcs: [ + ":framework-connectivity-internal-sources", + ":framework-connectivity-aidl-export-sources", + ], visibility: [ "//frameworks/base", "//packages/modules/Connectivity:__subpackages__", diff --git a/framework/src/android/net/CaptivePortalData.aidl b/framework/aidl-export/android/net/CaptivePortalData.aidl similarity index 100% rename from framework/src/android/net/CaptivePortalData.aidl rename to framework/aidl-export/android/net/CaptivePortalData.aidl diff --git a/framework/src/android/net/ConnectivityDiagnosticsManager.aidl b/framework/aidl-export/android/net/ConnectivityDiagnosticsManager.aidl similarity index 100% rename from framework/src/android/net/ConnectivityDiagnosticsManager.aidl rename to framework/aidl-export/android/net/ConnectivityDiagnosticsManager.aidl diff --git a/framework/src/android/net/DhcpInfo.aidl b/framework/aidl-export/android/net/DhcpInfo.aidl similarity index 100% rename from framework/src/android/net/DhcpInfo.aidl rename to framework/aidl-export/android/net/DhcpInfo.aidl diff --git a/framework/src/android/net/IpConfiguration.aidl b/framework/aidl-export/android/net/IpConfiguration.aidl similarity index 100% rename from framework/src/android/net/IpConfiguration.aidl rename to framework/aidl-export/android/net/IpConfiguration.aidl diff --git a/framework/src/android/net/IpPrefix.aidl b/framework/aidl-export/android/net/IpPrefix.aidl similarity index 100% rename from framework/src/android/net/IpPrefix.aidl rename to framework/aidl-export/android/net/IpPrefix.aidl diff --git a/framework/src/android/net/KeepalivePacketData.aidl b/framework/aidl-export/android/net/KeepalivePacketData.aidl similarity index 100% rename from framework/src/android/net/KeepalivePacketData.aidl rename to framework/aidl-export/android/net/KeepalivePacketData.aidl diff --git a/framework/src/android/net/LinkAddress.aidl b/framework/aidl-export/android/net/LinkAddress.aidl similarity index 100% rename from framework/src/android/net/LinkAddress.aidl rename to framework/aidl-export/android/net/LinkAddress.aidl diff --git a/framework/src/android/net/LinkProperties.aidl b/framework/aidl-export/android/net/LinkProperties.aidl similarity index 100% rename from framework/src/android/net/LinkProperties.aidl rename to framework/aidl-export/android/net/LinkProperties.aidl diff --git a/framework/src/android/net/MacAddress.aidl b/framework/aidl-export/android/net/MacAddress.aidl similarity index 100% rename from framework/src/android/net/MacAddress.aidl rename to framework/aidl-export/android/net/MacAddress.aidl diff --git a/framework/src/android/net/Network.aidl b/framework/aidl-export/android/net/Network.aidl similarity index 100% rename from framework/src/android/net/Network.aidl rename to framework/aidl-export/android/net/Network.aidl diff --git a/framework/src/android/net/NetworkAgentConfig.aidl b/framework/aidl-export/android/net/NetworkAgentConfig.aidl similarity index 100% rename from framework/src/android/net/NetworkAgentConfig.aidl rename to framework/aidl-export/android/net/NetworkAgentConfig.aidl diff --git a/framework/src/android/net/NetworkCapabilities.aidl b/framework/aidl-export/android/net/NetworkCapabilities.aidl similarity index 100% rename from framework/src/android/net/NetworkCapabilities.aidl rename to framework/aidl-export/android/net/NetworkCapabilities.aidl diff --git a/framework/src/android/net/NetworkInfo.aidl b/framework/aidl-export/android/net/NetworkInfo.aidl similarity index 100% rename from framework/src/android/net/NetworkInfo.aidl rename to framework/aidl-export/android/net/NetworkInfo.aidl diff --git a/framework/src/android/net/NetworkRequest.aidl b/framework/aidl-export/android/net/NetworkRequest.aidl similarity index 100% rename from framework/src/android/net/NetworkRequest.aidl rename to framework/aidl-export/android/net/NetworkRequest.aidl diff --git a/framework/src/android/net/ProxyInfo.aidl b/framework/aidl-export/android/net/ProxyInfo.aidl similarity index 100% rename from framework/src/android/net/ProxyInfo.aidl rename to framework/aidl-export/android/net/ProxyInfo.aidl diff --git a/framework/src/android/net/RouteInfo.aidl b/framework/aidl-export/android/net/RouteInfo.aidl similarity index 100% rename from framework/src/android/net/RouteInfo.aidl rename to framework/aidl-export/android/net/RouteInfo.aidl diff --git a/framework/src/android/net/StaticIpConfiguration.aidl b/framework/aidl-export/android/net/StaticIpConfiguration.aidl similarity index 100% rename from framework/src/android/net/StaticIpConfiguration.aidl rename to framework/aidl-export/android/net/StaticIpConfiguration.aidl diff --git a/framework/src/android/net/TestNetworkInterface.aidl b/framework/aidl-export/android/net/TestNetworkInterface.aidl similarity index 100% rename from framework/src/android/net/TestNetworkInterface.aidl rename to framework/aidl-export/android/net/TestNetworkInterface.aidl diff --git a/framework/src/android/net/apf/ApfCapabilities.aidl b/framework/aidl-export/android/net/apf/ApfCapabilities.aidl similarity index 100% rename from framework/src/android/net/apf/ApfCapabilities.aidl rename to framework/aidl-export/android/net/apf/ApfCapabilities.aidl diff --git a/framework/src/android/net/ConnectivityMetricsEvent.aidl b/framework/src/android/net/ConnectivityMetricsEvent.aidl deleted file mode 100644 index 1c541dc4c8..0000000000 --- a/framework/src/android/net/ConnectivityMetricsEvent.aidl +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2016 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 android.net; - -/** {@hide} */ -parcelable ConnectivityMetricsEvent; diff --git a/framework/src/android/net/InterfaceConfiguration.aidl b/framework/src/android/net/InterfaceConfiguration.aidl deleted file mode 100644 index 8aa5e34528..0000000000 --- a/framework/src/android/net/InterfaceConfiguration.aidl +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2008, 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 android.net; - -parcelable InterfaceConfiguration; diff --git a/framework/src/android/net/UidRange.aidl b/framework/src/android/net/UidRange.aidl deleted file mode 100644 index f70fc8e2fe..0000000000 --- a/framework/src/android/net/UidRange.aidl +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2018 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 android.net; - -/** - * An inclusive range of UIDs. - * - * {@hide} - */ -parcelable UidRange; \ No newline at end of file