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

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

Snap for 6001391 from 8ee5b288 to qt-aml-tzdata-release

Change-Id: I8e168451e7d3390cf2f3adc7db87783ff48f5809
parents 43377c31 8ee5b288
Loading
Loading
Loading
Loading
+54 −29
Original line number Diff line number Diff line
@@ -22,16 +22,22 @@
//                                            /    \
//           +NetworkStackApiStableShims --> /      \ <-- +NetworkStackApiCurrentShims
//           +NetworkStackApiStableLevel    /        \    +NetworkStackApiCurrentLevel
//           +jarjar apistub.api[latest].* /          \   +module src/
//            to apistub.*                /            \
//                                       /              \
//           NetworkStackApiStableLib         NetworkStackApiCurrentLib <-- android libs w/ all code
//                     |                                     |             (also used in unit tests)
//         NetworkStackApiStableDependencies             \
//                                     /                  \               android libs w/ all code
//                   +module src/ --> /                    \              (also used in unit tests)
//                                   /                      \                        |
//               NetworkStackApiStableLib               NetworkStackApiCurrentLib <--*
//                          |                                     |
//                          | <--   +NetworkStackAppDefaults  --> |
//                          |          (APK build params)         |
//                          |                                     |
//                          | <-- +NetworkStackApiStableLevel     | <-- +NetworkStackApiCurrentLevel
//                          |                                     |
//                          |                                     |
//           NetworkStackApiStable          NetworkStack, InProcessNetworkStack, <-- output APKs
//                NetworkStackApiStable          NetworkStack, InProcessNetworkStack, <-- APKs
//                                                         TestNetworkStack

// Common defaults to define SDK level
@@ -43,22 +49,29 @@ java_defaults {

java_defaults {
    name: "NetworkStackApiStableLevel",
    sdk_version: "system_current", // TODO: change to system_29
    sdk_version: "system_29",
    min_sdk_version: "28",
}

// Java libraries for the API shims
// Filegroups for the API shims
filegroup {
    name: "NetworkStackApiCurrentShims",
    srcs: [
        "apishim/current/**/*.java"
        "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/29/**/*.java"
        "apishim/common/**/*.java",
        "apishim/29/**/*.java",
        ":net-module-utils-srcs",
    ],
}

@@ -67,7 +80,6 @@ filegroup {
java_defaults {
    name: "NetworkStackAndroidLibraryDefaults",
    srcs: [
        "src/**/*.java",
        ":framework-networkstack-shared-srcs",
        ":services-networkstack-shared-srcs",
        ":statslog-networkstack-java-gen",
@@ -80,25 +92,38 @@ java_defaults {
        "networkstackprotosnano",
        "captiveportal-lib",
    ],
    manifest: "AndroidManifestBase.xml",
    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",
    ],
    srcs: [":NetworkStackApiCurrentShims", "src/**/*.java"],
    manifest: "AndroidManifestBase.xml",
}

// 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",
}

android_library {
    name: "NetworkStackApiStableLib",
    defaults: ["NetworkStackApiStableLevel", "NetworkStackAndroidLibraryDefaults"],
    srcs: [
        ":NetworkStackApiStableShims",
    defaults: ["NetworkStackApiStableLevel"],
    srcs: ["src/**/*.java"],
    // API stable uses a jarjared version of the shims
    static_libs: [
        "NetworkStackApiStableDependencies",
    ],
    manifest: "AndroidManifestBase.xml",
}

// Common defaults for compiling the actual APK, based on the NetworkStackApiXBase android libraries
@@ -126,7 +151,7 @@ android_app {
    certificate: "platform",
    manifest: "AndroidManifest_InProcess.xml",
    // InProcessNetworkStack is a replacement for NetworkStack
    overrides: ["NetworkStack"],
    overrides: ["NetworkStack", "NetworkStackNext"],
    // The permission configuration *must* be included to ensure security of the device
    // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
    // the default CaptivePortalLogin.
@@ -135,7 +160,7 @@ android_app {

// Updatable network stack packaged as an application
android_app {
    name: "NetworkStack",
    name: "NetworkStackNext",
    defaults: ["NetworkStackAppDefaults", "NetworkStackApiCurrentLevel"],
    static_libs: ["NetworkStackApiCurrentLib"],
    certificate: "networkstack",
@@ -146,7 +171,7 @@ android_app {

// Updatable network stack for finalized API
android_app {
    name: "NetworkStackApiStable",
    name: "NetworkStack",
    defaults: ["NetworkStackAppDefaults", "NetworkStackApiStableLevel"],
    static_libs: ["NetworkStackApiStableLib"],
    certificate: "networkstack",
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.android.networkstack"
  android:sharedUserId="android.uid.networkstack"
  android:versionCode="290000000"
  android:versionCode="299900000"
  android:versionName="2019-09"
>

+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@
#$(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
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
  "presubmit": [
    {
      "name": "NetworkStackTests"
    },
    {
      "name": "NetworkStackNextTests"
    }
  ],
  "postsubmit": [
+15 −1
Original line number Diff line number Diff line
@@ -14,18 +14,32 @@
 * limitations under the License.
 */

package com.android.networkstack.apishim;
package com.android.networkstack.apishim.api29;

import android.net.util.SocketUtils;

import androidx.annotation.NonNull;

import com.android.networkstack.apishim.SocketUtilsShim;

import java.net.SocketAddress;

/**
 * Implementation of SocketUtilsShim for API 29.
 */
public class SocketUtilsShimImpl implements SocketUtilsShim {
    protected SocketUtilsShimImpl() {}

    /**
     * Get a new instance of {@link SocketUtilsShim}.
     *
     * Use com.android.networkstack.apishim.SocketUtilsShim#newInstance()
     * (non-API29 version) instead, to use the correct shims depending on build SDK.
     */
    public static SocketUtilsShim newInstance() {
        return new SocketUtilsShimImpl();
    }

    @NonNull
    @Override
    public SocketAddress makePacketSocketAddress(
Loading