Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bcb2f94 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6439596 from 268b5fa0 to qt-aml-tzdata-release

Change-Id: I6f532acbc05bdd74c75644f5f4fc76a1ce88a62d
parents dee50612 268b5fa0
Loading
Loading
Loading
Loading
+51 −160
Original line number Diff line number Diff line
@@ -14,122 +14,81 @@
// limitations under the License.
//

// The network stack can be compiled using system_current (non-finalized) SDK, or finalized system_X
// SDK. There is also a variant that uses system_current SDK and runs in the system process
// (InProcessNetworkStack). The following structure is used to create the build rules:
//
//                          NetworkStackAndroidLibraryDefaults <-- common defaults for android libs
//                                            /    \
//           +NetworkStackApiStableShims --> /      \ <-- +NetworkStackApiCurrentShims
//           +NetworkStackApiStableLevel    /        \    +NetworkStackApiCurrentLevel
//           +jarjar apistub.api[latest].* /          \   +module src/
//            to apistub.*                /            \
//                                       /              \
//         NetworkStackApiStableDependencies             \
//                                     /                  \               android libs w/ all code
//                   +module src/ --> /                    \              (also used in unit tests)
//                                   /                      \                        |
//               NetworkStackApiStableLib               NetworkStackApiCurrentLib <--*
//                          |                                     |
//                          | <--   +NetworkStackAppDefaults  --> |
//                          |          (APK build params)         |
//                          |                                     |
//                          | <-- +NetworkStackApiStableLevel     | <-- +NetworkStackApiCurrentLevel
//                          |                                     |
//                          |                                     |
//                NetworkStackApiStable          NetworkStack, InProcessNetworkStack, <-- APKs
//                                                         TestNetworkStack

// Common defaults to define SDK level
java_defaults {
    name: "NetworkStackApiCurrentLevel",
java_library {
    name: "captiveportal-lib",
    srcs: ["common/**/*.java"],
    libs: [
        "androidx.annotation_annotation",
    ],
    sdk_version: "system_current",
    min_sdk_version: "28",
}

java_defaults {
    name: "NetworkStackApiStableLevel",
    sdk_version: "system_29",
    name: "NetworkStackCommon",
    sdk_version: "system_current",
    min_sdk_version: "28",
}

// Filegroups for the API shims
filegroup {
    name: "NetworkStackApiCurrentShims",
    srcs: [
        "apishim/common/**/*.java",
        "apishim/29/**/*.java",
        "apishim/current/**/*.java",
        ":net-module-utils-srcs",
    ],
}

// API stable shims only include the compat package, but it is jarjared to replace the non-compat
// package
filegroup {
    name: "NetworkStackApiStableShims",
    srcs: [
        "apishim/common/**/*.java",
        "apishim/29/**/*.java",
        ":net-module-utils-srcs",
    ],
}

// Common defaults for android libraries containing network stack code, used to compile variants of
// the network stack in the system process and in the network_stack process
java_defaults {
    name: "NetworkStackAndroidLibraryDefaults",
// Library including the network stack, used to compile both variants of the network stack
android_library {
    name: "NetworkStackBase",
    defaults: ["NetworkStackCommon"],
    srcs: [
        "src/**/*.java",
        ":framework-networkstack-shared-srcs",
        ":services-networkstack-shared-srcs",
        ":statslog-networkstack-java-gen",
    ],
    static_libs: [
        "androidx.annotation_annotation",
        "ipmemorystore-client",
        "netd_aidl_interface-V2-java",
        "networkstack-client",
        "networkstack-aidl-interfaces-V3-java",
        "datastallprotosnano",
        "networkstackprotosnano",
        "captiveportal-lib",
    ],
    plugins: ["java_api_finder"],
}

// The versions of the android library containing network stack code compiled for each SDK variant
// API current uses the sources of the API current shims directly.
// This allows API current code to be treated identically to code in src/ (it will be moved
// there eventually), and to use the compat shim as fallback on older devices.
android_library {
    name: "NetworkStackApiCurrentLib",
    defaults: ["NetworkStackApiCurrentLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [":NetworkStackApiCurrentShims", "src/**/*.java"],
    manifest: "AndroidManifestBase.xml",
    plugins: ["java_api_finder"],
}

// For API stable, first build the dependencies using jarjar compat rules, then build the sources
// linking with the dependencies.
java_library {
    name: "NetworkStackApiStableDependencies",
    defaults: ["NetworkStackApiStableLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [":NetworkStackApiStableShims"],
    jarjar_rules: "apishim/jarjar-rules-compat.txt",
}
cc_library_shared {
    name: "libnetworkstackutilsjni",
    srcs: [
        "jni/network_stack_utils_jni.cpp"
    ],
    sdk_version: "current",
    shared_libs: [
        "liblog",
        "libnativehelper_compat_libc++",
    ],

android_library {
    name: "NetworkStackApiStableLib",
    defaults: ["NetworkStackApiStableLevel"],
    srcs: ["src/**/*.java"],
    // API stable uses a jarjared version of the shims
    static_libs: [
        "NetworkStackApiStableDependencies",
    // We cannot use plain "libc++" here to link libc++ dynamically because it results in:
    //   java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
    // even if "libc++" is added into jni_libs below. Adding "libc++_shared" into jni_libs doesn't
    // build because soong complains of:
    //   module NetworkStack missing dependencies: libc++_shared
    //
    // So, link libc++ statically. This means that we also need to ensure that all the C++ libraries
    // we depend on do not dynamically link libc++. This is currently the case, because liblog is
    // C-only and libnativehelper_compat_libc also uses stl: "c++_static".
    //
    // TODO: find a better solution for this in R.
    stl: "c++_static",
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-unused-parameter",
    ],
    manifest: "AndroidManifestBase.xml",
}

// Common defaults for compiling the actual APK, based on the NetworkStackApiXBase android libraries
java_defaults {
    name: "NetworkStackAppDefaults",
    name: "NetworkStackAppCommon",
    defaults: ["NetworkStackCommon"],
    privileged: true,
    static_libs: [
        "NetworkStackBase",
    ],
    jni_libs: [
        "libnativehelper_compat_libc++",
        "libnetworkstackutilsjni",
@@ -137,7 +96,6 @@ java_defaults {
    // Resources already included in NetworkStackBase
    resource_dirs: [],
    jarjar_rules: "jarjar-rules-shared.txt",
    use_embedded_native_libs: true,
    optimize: {
        proguard_flags_files: ["proguard.flags"],
    },
@@ -146,12 +104,11 @@ java_defaults {
// Non-updatable network stack running in the system server process for devices not using the module
android_app {
    name: "InProcessNetworkStack",
    defaults: [ "NetworkStackAppDefaults", "NetworkStackApiCurrentLevel"],
    static_libs: ["NetworkStackApiCurrentLib"],
    defaults: ["NetworkStackAppCommon"],
    certificate: "platform",
    manifest: "AndroidManifest_InProcess.xml",
    // InProcessNetworkStack is a replacement for NetworkStack
    overrides: ["NetworkStack", "NetworkStackNext"],
    overrides: ["NetworkStack"],
    // The permission configuration *must* be included to ensure security of the device
    // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
    // the default CaptivePortalLogin.
@@ -159,65 +116,16 @@ android_app {
}

// Updatable network stack packaged as an application
android_app {
    name: "NetworkStackNext",
    defaults: ["NetworkStackAppDefaults", "NetworkStackApiCurrentLevel"],
    static_libs: ["NetworkStackApiCurrentLib"],
    certificate: "networkstack",
    manifest: "AndroidManifest.xml",
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
}

// Updatable network stack for finalized API
android_app {
    name: "NetworkStack",
    defaults: ["NetworkStackAppDefaults", "NetworkStackApiStableLevel"],
    static_libs: ["NetworkStackApiStableLib"],
    defaults: ["NetworkStackAppCommon"],
    certificate: "networkstack",
    manifest: "AndroidManifest.xml",
    use_embedded_native_libs: true,
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
}

// Android library to derive test APKs for integration tests
android_library {
    name: "TestNetworkStackLib",
    defaults: ["NetworkStackAppDefaults", "NetworkStackApiCurrentLevel"],
    static_libs: ["NetworkStackApiCurrentLib"],
    manifest: "AndroidManifest.xml",
}

cc_library_shared {
    name: "libnetworkstackutilsjni",
    srcs: [
        "jni/network_stack_utils_jni.cpp"
    ],
    sdk_version: "current",
    shared_libs: [
        "liblog",
        "libnativehelper_compat_libc++",
    ],

    // We cannot use plain "libc++" here to link libc++ dynamically because it results in:
    //   java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
    // even if "libc++" is added into jni_libs below. Adding "libc++_shared" into jni_libs doesn't
    // build because soong complains of:
    //   module NetworkStack missing dependencies: libc++_shared
    //
    // So, link libc++ statically. This means that we also need to ensure that all the C++ libraries
    // we depend on do not dynamically link libc++. This is currently the case, because liblog is
    // C-only and libnativehelper_compat_libc also uses stl: "c++_static".
    //
    // TODO: find a better solution for this in R.
    stl: "c++_static",
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-unused-parameter",
    ],
}

genrule {
    name: "statslog-networkstack-java-gen",
    tools: ["stats-log-api-gen"],
@@ -225,20 +133,3 @@ genrule {
         " --javaPackage com.android.networkstack.metrics --javaClass NetworkStackStatsLog",
    out: ["com/android/networkstack/metrics/NetworkStackStatsLog.java"],
}

genrule {
    name: "NetworkStackTestAndroidManifest",
    srcs: ["AndroidManifest.xml"],
    out: ["TestAndroidManifest.xml"],
    cmd: "sed 's/versionCode=\".*\"/versionCode=\"300000000\"/' $(in) > $(out)",
}

android_app {
    name: "TestNetworkStack",
    defaults: ["NetworkStackAppDefaults", "NetworkStackApiCurrentLevel"],
    static_libs: ["NetworkStackApiCurrentLib"],
    certificate: "networkstack",
    manifest: ":NetworkStackTestAndroidManifest",
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
}
+2 −4
Original line number Diff line number Diff line
@@ -43,10 +43,8 @@
    <uses-permission android:name="android.permission.MAINLINE_NETWORK_STACK" />
    <application
        android:extractNativeLibs="false"
        android:persistent="true"
        android:process="com.android.networkstack.process">
        <service android:name="com.android.server.NetworkStackService"
                 android:permission="android.permission.MAINLINE_NETWORK_STACK">
        android:persistent="true">
        <service android:name="com.android.server.NetworkStackService">
            <intent-filter>
                <action android:name="android.net.INetworkStackConnector"/>
            </intent-filter>
+1 −3
Original line number Diff line number Diff line
@@ -22,9 +22,7 @@
          android:process="system">
    <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28" />
    <application>
        <service android:name="com.android.server.NetworkStackService"
                 android:process="system"
                 android:permission="android.permission.MAINLINE_NETWORK_STACK">
        <service android:name="com.android.server.NetworkStackService" android:process="system">
            <intent-filter>
                <action android:name="android.net.INetworkStackConnector.InProcess"/>
            </intent-filter>

CleanSpec.mk

deleted100644 → 0
+0 −53
Original line number Diff line number Diff line
# Copyright (C) 2019 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.
#

# If you don't need to do a full clean build but would like to touch
# a file or delete some intermediate files, add a clean step to the end
# of the list.  These steps will only be run once, if they haven't been
# run before.
#
# E.g.:
#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
#
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
# files that are missing or have been moved.
#
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
# Use $(OUT_DIR) to refer to the "out" directory.
#
# If you need to re-do something that's already mentioned, just copy
# the command and add it to the bottom of the list.  E.g., if a change
# that you made last week required touching a file and a change you
# made today requires touching the same file, just copy the old
# touch step and add it to the end of the list.
#
# *****************************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THE BANNER
# *****************************************************************

# For example:
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)

$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/CaptivePortalLogin)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/NetworkStack)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/NetworkStackApiStable)

# ******************************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THIS BANNER
# ******************************************************************
+4 −5
Original line number Diff line number Diff line
codewiz@google.com
jchalard@google.com
junyulai@google.com
set noparent

lorenzo@google.com
reminv@google.com
satk@google.com
baligh@google.com
delphij@google.com
Loading