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

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

Snap for 7080740 from fa840465 to mainline-tethering-release

Change-Id: I8d29683b06924b504d3dca72880290f0c3bc4886
parents b3cb8b3e fa840465
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
// Common defaults to define SDK level
java_defaults {
    name: "NetworkStackDevApiLevel",
    min_sdk_version: "29",
    sdk_version: "system_current",
}

@@ -113,6 +114,7 @@ android_library {
        ":statslog-networkstack-java-gen"
    ],
    manifest: "AndroidManifestBase.xml",
    enabled: false, // Disabled in mainline-prod
}

// For API stable, first build the dependencies using jarjar compat rules, then build the sources
@@ -145,6 +147,7 @@ filegroup {
        "//packages/modules/NetworkStack/tests/unit",
        "//packages/modules/NetworkStack/tests/integration",
        "//frameworks/base/packages/Tethering/tests/integration",
        "//packages/modules/Connectivity/Tethering/tests/integration",
    ]
}

@@ -178,6 +181,7 @@ android_app {
    // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
    // the default CaptivePortalLogin.
    required: ["PlatformNetworkPermissionConfig", "PlatformCaptivePortalLogin"],
    enabled: false, // Disabled in mainline-prod
}

// Pre-merge the AndroidManifest for NetworkStackNext, so that its manifest can be merged on top
@@ -185,7 +189,8 @@ android_library {
    name: "NetworkStackNextManifestBase",
    defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"],
    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
@@ -197,6 +202,7 @@ android_app {
    manifest: "AndroidManifest_Next.xml",
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
    enabled: false, // Disabled in mainline-prod
}

// Updatable network stack for finalized API
@@ -220,6 +226,7 @@ android_library {
    visibility: [
        "//frameworks/base/tests/net/integration",
        "//cts/tests/tests/net",
        "//packages/modules/Connectivity/tests/cts/net",
    ],
}

@@ -234,6 +241,9 @@ cc_library_shared {
        "liblog",
        "libnativehelper_compat_libc++",
    ],
    static_libs: [
        "libnetjniutils",
    ],

    // 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
@@ -278,8 +288,8 @@ genrule {

android_app {
    name: "TestNetworkStack",
    defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"],
    static_libs: ["NetworkStackApiCurrentLib"],
    defaults: ["NetworkStackAppDefaults", "NetworkStackReleaseApiLevel"],
    static_libs: ["NetworkStackApiStableLib"],
    certificate: "networkstack",
    manifest: ":NetworkStackTestAndroidManifest",
    // The permission configuration *must* be included to ensure security of the device
+13 −0
Original line number Diff line number Diff line
@@ -14,5 +14,18 @@
    {
      "name": "NetworkStackIntegrationTests"
    }
  ],
  "mainline-presubmit": [
    // These are unit tests only, so they don't actually require any modules to be installed.
    // We must specify at least one module here or the tests won't run. Use the same set as CTS
    // so in theory the infra would not need to reinstall/reboot devices to run both.
    {
      "name": "NetworkStackTests[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]"
    }
  ],
  "imports": [
    {
      "path": "packages/modules/Connectivity"
    }
  ]
}
+19 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.networkstack.apishim.api29;

import android.net.CaptivePortalData;

import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;

@@ -48,8 +50,25 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim
        throw new UnsupportedApiLevelException("CaptivePortalData not supported on API 29");
    }

    @Override
    public String getVenueFriendlyName() {
        // Not supported in API level 29
        return null;
    }

    @VisibleForTesting
    public static boolean isSupported() {
        return false;
    }

    /**
     * Generate a {@link CaptivePortalData} object with a friendly name set
     *
     * @param friendlyName The friendly name to set
     * @return a {@link CaptivePortalData} object with a friendly name set
     */
    public CaptivePortalData withVenueFriendlyName(String friendlyName) {
        // Not supported in API level 29
        return null;
    }
}
+22 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.networkstack.apishim.api29;

import android.net.CaptivePortalData;
import android.net.IpPrefix;
import android.net.LinkProperties;
import android.net.NetworkCapabilities;
@@ -57,6 +58,14 @@ public class NetworkInformationShimImpl implements NetworkInformationShim {
        return false;
    }

    /**
     * Indicates whether the shim can use APIs above the R SDK.
     */
    @VisibleForTesting
    public static boolean useApiAboveR() {
        return false;
    }

    @Nullable
    @Override
    public Uri getCaptivePortalApiUrl(@Nullable LinkProperties lp) {
@@ -105,4 +114,17 @@ public class NetworkInformationShimImpl implements NetworkInformationShim {
            @NonNull Inet4Address serverAddress) {
        // Not supported on this API level: no-op
    }

    /**
     * Set captive portal data in {@link LinkProperties}
     * @param lp Link properties object to be updated
     * @param captivePortalData Captive portal data to be used
     */
    public void setCaptivePortalData(@NonNull LinkProperties lp,
            @Nullable CaptivePortalData captivePortalData) {
        if (lp == null) {
            return;
        }
        lp.setCaptivePortalData(captivePortalData);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ import org.json.JSONObject;
public class CaptivePortalDataShimImpl
        extends com.android.networkstack.apishim.api29.CaptivePortalDataShimImpl {
    @NonNull
    private final CaptivePortalData mData;
    protected final CaptivePortalData mData;

    protected CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) {
        mData = data;
Loading