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

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

Snap for 7483611 from fc6b434a to mainline-neuralnetworks-release

Change-Id: Ib27679254a4b7435b816eee60394f92bc08f7d59
parents 1dbe88b3 fc6b434a
Loading
Loading
Loading
Loading

.gitignore

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

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


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

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


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


// Filegroups for the API shims
// Libraries for the API shims
filegroup {
java_defaults {
    name: "NetworkStackApiCurrentShims",
    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: [
    srcs: [
        "apishim/common/**/*.java",
        "apishim/29/**/*.java",
        "apishim/30/**/*.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",
        "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
// Shims for APIs being added to the current development version of Android. These APIs are not
filegroup {
// stable and have no defined version number. These could be called 10000, but they use the next
    name: "NetworkStackApiStableShims",
// 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: [
    srcs: [
        "apishim/common/**/*.java",
        "apishim/32/**/*.java",
        "apishim/29/**/*.java",
    ],
        "apishim/30/**/*.java",
    libs: [
        ":networkstack-module-utils-srcs",
        "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,12 @@ java_defaults {
    name: "NetworkStackAndroidLibraryDefaults",
    name: "NetworkStackAndroidLibraryDefaults",
    srcs: [
    srcs: [
        ":framework-networkstack-shared-srcs",
        ":framework-networkstack-shared-srcs",
        ":networkstack-module-utils-srcs",
    ],
    ],
    libs: ["unsupportedappusage"],
    libs: ["unsupportedappusage"],
    static_libs: [
    static_libs: [
        "androidx.annotation_annotation",
        "androidx.annotation_annotation",
        "netd_aidl_interface-java",
        "netd_aidl_interface-lateststable-java",
        "netlink-client",
        "netlink-client",
        "networkstack-client",
        "networkstack-client",
        "net-utils-framework-common",
        "net-utils-framework-common",
@@ -101,43 +227,49 @@ java_defaults {
    plugins: ["java_api_finder"],
    plugins: ["java_api_finder"],
}
}


// The versions of the android library containing network stack code compiled for each SDK variant
// 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 {
android_library {
    name: "NetworkStackApiCurrentLib",
    name: "NetworkStackApiCurrentLib",
    defaults: ["NetworkStackDevApiLevel", "NetworkStackAndroidLibraryDefaults"],
    defaults: ["NetworkStackDevApiLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [
    srcs: [
        ":NetworkStackApiCurrentShims",
        "src/**/*.java",
        "src/**/*.java",
        ":statslog-networkstack-java-gen-current"
        ":statslog-networkstack-java-gen-current"
    ],
    ],
    static_libs: ["NetworkStackApiCurrentShims"],
    manifest: "AndroidManifestBase.xml",
    manifest: "AndroidManifestBase.xml",
    enabled: false, // Disabled in mainline-prod
    visibility: [
}
        "//frameworks/base/tests/net/integration",

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


android_library {
android_library {
    name: "NetworkStackApiStableLib",
    name: "NetworkStackApiStableLib",
    defaults: ["NetworkStackReleaseApiLevel"],
    defaults: ["NetworkStackReleaseApiLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [
    srcs: [
        "src/**/*.java",
        "src/**/*.java",
        ":statslog-networkstack-java-gen-stable",
        ":statslog-networkstack-java-gen-stable",
    ],
    ],
    // API stable uses a jarjared version of the shims
    static_libs: ["NetworkStackApiStableShims"],
    static_libs: [
        "NetworkStackApiStableDependencies",
    ],
    manifest: "AndroidManifestBase.xml",
    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 {
filegroup {
@@ -146,7 +278,6 @@ filegroup {
    visibility: [
    visibility: [
        "//packages/modules/NetworkStack/tests/unit",
        "//packages/modules/NetworkStack/tests/unit",
        "//packages/modules/NetworkStack/tests/integration",
        "//packages/modules/NetworkStack/tests/integration",
        "//frameworks/base/packages/Tethering/tests/integration",
        "//packages/modules/Connectivity/Tethering/tests/integration",
        "//packages/modules/Connectivity/Tethering/tests/integration",
    ]
    ]
}
}
@@ -180,8 +311,10 @@ android_app {
    // The permission configuration *must* be included to ensure security of the device
    // The permission configuration *must* be included to ensure security of the device
    // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
    // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
    // the default CaptivePortalLogin.
    // the default CaptivePortalLogin.
    required: ["PlatformNetworkPermissionConfig", "PlatformCaptivePortalLogin"],
    required: [
    enabled: false, // Disabled in mainline-prod
        "PlatformNetworkPermissionConfig",
        "PlatformCaptivePortalLogin",
    ],
}
}


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


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


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

// 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",
    ],
    ],
    updatable: true,
}
}


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