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

Commit 5f220760 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Automerger Merge Worker
Browse files

Address comments on shim library changes. am: 52f7eb12

Original change: https://android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/1605016

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib77e867717c5f2a6faabb04b7f5ee45445c27e8d
parents 38950ebc 52f7eb12
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -109,8 +109,8 @@ java_library {
}

// Shims for APIs being added to the current development version of Android. These APIs are not
// stable and have no defined version number. We could call these 10000, but we just pick the next
// integer, so if the next SDK release happens to use that integer, we don't need to rename them.
// 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"],
+6 −6
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import org.json.JSONException;
import org.json.JSONObject;

/**
 * Compatibility implementation of {@link CaptivePortalDataShim}.
 * Compatibility implementation of {@link CaptivePortalData}.
 *
 * <p>Use {@link com.android.networkstack.apishim.CaptivePortalDataShimImpl} instead of this
 * fallback implementation.
@@ -37,7 +37,7 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim
    protected CaptivePortalDataShimImpl() {}

    /**
     * Parse a {@link android.net.CaptivePortalData} from JSON.
     * Parse a {@link android.net.CaptivePortalDataShim} from JSON.
     *
     * <p>Use
     * {@link com.android.networkstack.apishim.CaptivePortalDataShimImpl#fromJson(JSONObject)}
@@ -68,7 +68,7 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim
    }

    /**
     * Generate a {@link CaptivePortalData} object with a friendly name set
     * Generate a {@link CaptivePortalDataShim} object with a friendly name set
     *
     * @param friendlyName The friendly name to set
     * @return a {@link CaptivePortalData} object with a friendly name set
@@ -81,14 +81,14 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim
    }

    /**
     * Generate a {@link CaptivePortalData} object with a friendly name and Passpoint external URLs
     * set
     * Generate a {@link CaptivePortalDataShim} object with a friendly name and Passpoint external
     * URLs set
     *
     * @param friendlyName The friendly name to set
     * @param venueInfoUrl Venue information URL
     * @param termsAndConditionsUrl Terms and conditions URL
     *
     * @return a {@link CaptivePortalData} object with friendly name, venue info URL and terms
     * @return a {@link CaptivePortalDataShim} object with friendly name, venue info URL and terms
     * and conditions URL set
     */
    @Override
+10 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.net.LinkProperties;
import android.net.NetworkCapabilities;
import android.net.Uri;
import android.os.Build;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -37,6 +38,8 @@ import java.net.Inet4Address;
 */
public class NetworkInformationShimImpl extends
        com.android.networkstack.apishim.api29.NetworkInformationShimImpl {
    private static final String TAG = "api30.NetworkInformationShimImpl";

    protected NetworkInformationShimImpl() {}

    /**
@@ -112,6 +115,13 @@ public class NetworkInformationShimImpl extends
        if (lp == null) {
            return;
        }
        if (!(captivePortalData instanceof CaptivePortalDataShimImpl)) {
            // The caller passed in a subclass that is not a CaptivePortalDataShimImpl.
            // This is a programming error, but don't crash with ClassCastException.
            Log.wtf(TAG, "Expected CaptivePortalDataShimImpl, but got "
                    + captivePortalData.getClass().getName());
            return;
        }
        lp.setCaptivePortalData(((CaptivePortalDataShimImpl) captivePortalData).getData());
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.networkstack.apishim.common;

import android.net.CaptivePortalData;
import android.net.INetworkMonitorCallbacks;
import android.net.Uri;
import android.os.RemoteException;