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

Commit 2dad469c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7550844 from cd8c8638 to mainline-conscrypt-release

Change-Id: Ifaf629ccbc464be9e7a407730fde52ccc1cf41be
parents 70cb5e85 cd8c8638
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+7 −0
Original line number Diff line number Diff line
# Generated build files
gen/com/android/networkstack/**

# IntelliJ project files
**/.idea
**/*.iml
**/*.ipr
+191 −63
Original line number Diff line number Diff line
@@ -22,12 +22,12 @@
//                                            /    \
//           +NetworkStackApiStableShims --> /      \ <-- +NetworkStackApiCurrentShims
//           +NetworkStackReleaseApiLevel   /        \    +NetworkStackDevApiLevel
//           +jarjar apistub.api[latest].* /          \   +module src/
//            to apistub.*                /            \
//           +jarjar apishim.api[latest].* /          \
//            to apishim.*                /            \
//                                       /              \
//                                      /                \
//         NetworkStackApiStableDependencies             \
//                                     /                  \               android libs w/ all code
//                   +module src/ --> /                    \              (also used in unit tests)
//                                    / <- +module src/ -> \              (also used in unit tests)
//                                   /                      \                        |
//               NetworkStackApiStableLib               NetworkStackApiCurrentLib <--*
//                          |                                     |
@@ -41,6 +41,10 @@
//                                                         TestNetworkStack

// Common defaults to define SDK level
package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

java_defaults {
    name: "NetworkStackDevApiLevel",
    min_sdk_version: "29",
@@ -49,32 +53,153 @@ java_defaults {

java_defaults {
    name: "NetworkStackReleaseApiLevel",
    sdk_version: "system_30",
    sdk_version: "module_31",
    min_sdk_version: "29",
    target_sdk_version: "30",
    target_sdk_version: "31",
    libs: [
        "framework-connectivity",
        "framework-statsd",
        "framework-wifi",
    ]
}

// Filegroups for the API shims
filegroup {
    name: "NetworkStackApiCurrentShims",
// Libraries for the API shims
java_defaults {
    name: "NetworkStackShimsDefaults",
    libs: [
        "androidx.annotation_annotation",
        "networkstack-client",
    ],
    static_libs : [
        "modules-utils-build_system"
    ],
    apex_available: [
        "com.android.tethering",
        "//apex_available:platform",  // For InProcessNetworkStack and InProcessTethering
    ],
    min_sdk_version: "29",
}

// Common shim code. This includes the shim interface definitions themselves, and things like
// ShimUtils and UnsupportedApiLevelException. Compiles against system_current because ShimUtils
// needs access to all Build.VERSION_CODES.*, which by definition are only in the newest SDK.
// TODO: consider moving ShimUtils into a library (or removing it in favour of SdkLevel) and compile
// this target against the lowest-supported SDK (currently 29).
java_library {
    name: "NetworkStackShimsCommon",
    defaults: ["NetworkStackShimsDefaults"],
    srcs: ["apishim/common/**/*.java"],
    sdk_version: "system_current",
    visibility: ["//visibility:private"],
}

// Each level of the shims (29, 30, ...) is its own java_library compiled against the corresponding
// system_X SDK. this ensures that each shim can only use SDK classes that exist in its SDK level.
java_library {
    name: "NetworkStackApi29Shims",
    defaults: ["NetworkStackShimsDefaults"],
    srcs: ["apishim/29/**/*.java"],
    libs: [
        "NetworkStackShimsCommon",
    ],
    sdk_version: "system_29",
    visibility: ["//visibility:private"],
}

java_library {
    name: "NetworkStackApi30Shims",
    defaults: ["NetworkStackShimsDefaults"],
    srcs: [
        "apishim/common/**/*.java",
        "apishim/29/**/*.java",
        "apishim/30/**/*.java",
    ],
    libs: [
        "NetworkStackShimsCommon",
        "NetworkStackApi29Shims",
    ],
    sdk_version: "system_30",
    visibility: ["//visibility:private"],
    lint: {
        baseline_filename: "lint-baseline-api-30-shims.xml",
    },
}

// Shims for APIs being added to the current development version of Android. These APIs are not
// stable and have no defined version number. These could be called 10000, but they use the next
// integer so if the next SDK release happens to use that integer, we don't need to rename them.
java_library {
    name: "NetworkStackApi31Shims",
    defaults: ["NetworkStackShimsDefaults"],
    srcs: [
        "apishim/31/**/*.java",
        ":networkstack-module-utils-srcs",
    ],
    libs: [
        "NetworkStackShimsCommon",
        "NetworkStackApi29Shims",
        "NetworkStackApi30Shims",
        "framework-connectivity",
    ],
    sdk_version: "module_31",
    visibility: ["//visibility:private"],
}

// API stable shims only include the compat package, but it is jarjared to replace the non-compat
// package
filegroup {
    name: "NetworkStackApiStableShims",

// Shims for APIs being added to the current development version of Android. These APIs are not
// stable and have no defined version number. These could be called 10000, but they use the next
// integer so if the next SDK release happens to use that integer, we don't need to rename them.
java_library {
    name: "NetworkStackApi32Shims",
    defaults: ["NetworkStackShimsDefaults"],
    srcs: [
        "apishim/common/**/*.java",
        "apishim/29/**/*.java",
        "apishim/30/**/*.java",
        ":networkstack-module-utils-srcs",
        "apishim/32/**/*.java",
    ],
    libs: [
        "NetworkStackShimsCommon",
        "NetworkStackApi29Shims",
        "NetworkStackApi30Shims",
        "NetworkStackApi31Shims",
        "framework-connectivity",
    ],
    sdk_version: "module_current",
    visibility: ["//visibility:private"],
}

// API current uses the API current shims directly.
// The current (in-progress) shims are in the com.android.networkstack.apishim package and are
// called directly by the networkstack code.
java_library {
    name: "NetworkStackApiCurrentShims",
    defaults: ["NetworkStackShimsDefaults"],
    static_libs: [
        "NetworkStackShimsCommon",
        "NetworkStackApi29Shims",
        "NetworkStackApi30Shims",
        "NetworkStackApi31Shims",
        "NetworkStackApi32Shims",
    ],
    sdk_version: "module_current",
    visibility: [
        "//packages/modules/Connectivity/Tethering",
        "//packages/modules/Connectivity/tests/cts/net",
    ],
}

// API stable uses jarjar to rename the latest stable apishim package from
// com.android.networkstack.apishim.apiXX to com.android.networkstack.apishim, which is called by
// the networkstack code.
java_library {
    name: "NetworkStackApiStableShims",
    defaults: ["NetworkStackShimsDefaults"],
    static_libs: [
        "NetworkStackShimsCommon",
        "NetworkStackApi29Shims",
        "NetworkStackApi30Shims",
        "NetworkStackApi31Shims",
    ],
    jarjar_rules: "apishim/jarjar-rules-compat.txt",
    sdk_version: "module_31",
    visibility: [
        "//packages/modules/Connectivity/Tethering",
        "//packages/modules/Connectivity/tests/cts/net",
    ],
}

@@ -84,11 +209,13 @@ java_defaults {
    name: "NetworkStackAndroidLibraryDefaults",
    srcs: [
        ":framework-networkstack-shared-srcs",
        ":networkstack-module-utils-srcs",
    ],
    libs: ["unsupportedappusage"],
    static_libs: [
        "androidx.annotation_annotation",
        "netd_aidl_interface-java",
        "modules-utils-build_system",
        "netd_aidl_interface-lateststable-java",
        "netlink-client",
        "networkstack-client",
        "net-utils-framework-common",
@@ -101,43 +228,49 @@ java_defaults {
    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.
// The versions of the android library containing network stack code compiled for each SDK variant.
android_library {
    name: "NetworkStackApiCurrentLib",
    defaults: ["NetworkStackDevApiLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [
        ":NetworkStackApiCurrentShims",
        "src/**/*.java",
        ":statslog-networkstack-java-gen-current"
    ],
    static_libs: ["NetworkStackApiCurrentShims"],
    manifest: "AndroidManifestBase.xml",
    enabled: false, // Disabled in mainline-prod
}

// For API stable, first build the dependencies using jarjar compat rules, then build the sources
// linking with the dependencies.
java_library {
    name: "NetworkStackApiStableDependencies",
    defaults: ["NetworkStackReleaseApiLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [":NetworkStackApiStableShims"],
    jarjar_rules: "apishim/jarjar-rules-compat.txt",
    visibility: [
        "//frameworks/base/tests/net/integration",
        "//packages/modules/Connectivity/Tethering/tests/integration",
        "//packages/modules/Connectivity/tests/cts/net",
        "//packages/modules/NetworkStack/tests/unit",
        "//packages/modules/NetworkStack/tests/integration",
    ],
    lint: {
        baseline_filename: "lint-baseline-current-lib.xml",
    },
}

android_library {
    name: "NetworkStackApiStableLib",
    defaults: ["NetworkStackReleaseApiLevel"],
    defaults: ["NetworkStackReleaseApiLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [
        "src/**/*.java",
        ":statslog-networkstack-java-gen-stable",
    ],
    // API stable uses a jarjared version of the shims
    static_libs: [
        "NetworkStackApiStableDependencies",
    ],
    static_libs: ["NetworkStackApiStableShims"],
    manifest: "AndroidManifestBase.xml",
    visibility: [
        "//frameworks/base/packages/Connectivity/tests/integration",
        "//frameworks/base/tests/net/integration",
        "//packages/modules/Connectivity/Tethering/tests/integration",
        "//packages/modules/Connectivity/tests/cts/net",
        "//packages/modules/Connectivity/tests/integration",
        "//packages/modules/NetworkStack/tests/unit",
        "//packages/modules/NetworkStack/tests/integration",
    ],
    lint: {
        baseline_filename: "lint-baseline-stable-lib.xml",
    },
}

filegroup {
@@ -146,7 +279,6 @@ filegroup {
    visibility: [
        "//packages/modules/NetworkStack/tests/unit",
        "//packages/modules/NetworkStack/tests/integration",
        "//frameworks/base/packages/Tethering/tests/integration",
        "//packages/modules/Connectivity/Tethering/tests/integration",
    ]
}
@@ -180,8 +312,10 @@ android_app {
    // The permission configuration *must* be included to ensure security of the device
    // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
    // the default CaptivePortalLogin.
    required: ["PlatformNetworkPermissionConfig", "PlatformCaptivePortalLogin"],
    enabled: false, // Disabled in mainline-prod
    required: [
        "PlatformNetworkPermissionConfig",
        "PlatformCaptivePortalLogin",
    ],
}

// Pre-merge the AndroidManifest for NetworkStackNext, so that its manifest can be merged on top
@@ -189,8 +323,7 @@ android_library {
    name: "NetworkStackNextManifestBase",
    defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"],
    static_libs: ["NetworkStackApiCurrentLib"],
    manifest: "AndroidManifest.xml",
    enabled: false, // Disabled in mainline-prod
    manifest: "AndroidManifest.xml"
}

// NetworkStack build targeting the current API release, for testing on in-development SDK
@@ -201,8 +334,10 @@ android_app {
    certificate: "networkstack",
    manifest: "AndroidManifest_Next.xml",
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
    enabled: false, // Disabled in mainline-prod
    required: [
        "NetworkPermissionConfig",
        "privapp_whitelist_com.android.networkstack",
    ],
}

// Updatable network stack for finalized API
@@ -213,21 +348,11 @@ android_app {
    certificate: "networkstack",
    manifest: "AndroidManifest.xml",
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
    updatable: true,
}

// Android library to derive test APKs for integration tests
android_library {
    name: "TestNetworkStackLib",
    defaults: ["NetworkStackAppDefaults", "NetworkStackReleaseApiLevel"],
    static_libs: ["NetworkStackApiStableLib"],
    manifest: "AndroidManifestBase.xml",
    visibility: [
        "//frameworks/base/tests/net/integration",
        "//cts/tests/tests/net",
        "//packages/modules/Connectivity/tests/cts/net",
    required: [
        "NetworkPermissionConfig",
        "privapp_whitelist_com.android.networkstack",
    ],
    updatable: true,
}

cc_library_shared {
@@ -303,7 +428,10 @@ android_app {
    certificate: "networkstack",
    manifest: ":NetworkStackTestAndroidManifest",
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
    required: [
        "NetworkPermissionConfig",
        "privapp_whitelist_com.android.networkstack",
    ],
}

// When adding or modifying protos, the jarjar rules and possibly proguard rules need
+2 −2
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.android.networkstack"
  android:sharedUserId="android.uid.networkstack"
  android:versionCode="309999900"
  android:versionName="r_aml_309999900"
  android:versionCode="319999900"
  android:versionName="s_aml_319999900"
>
    <!-- Permissions must be defined here, and not in the base manifest, as the network stack
         running in the system server process does not need any permission, and having privileged
+2 −2
Original line number Diff line number Diff line
@@ -17,6 +17,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.networkstack"
          android:sharedUserId="android.uid.networkstack"
          android:versionCode="300000000"
          android:versionName="R-next">
          android:versionCode="320000000"
          android:versionName="T-next">
</manifest>
+2 −0
Original line number Diff line number Diff line
@@ -2,5 +2,7 @@ codewiz@google.com
jchalard@google.com
junyulai@google.com
lorenzo@google.com
maze@google.com
reminv@google.com
satk@google.com
xiaom@google.com
Loading