Loading apishim/29/com/android/networkstack/apishim/api29/CaptivePortalDataShimImpl.java +2 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.networkstack.apishim.api29; import android.net.CaptivePortalData; import android.net.Uri; import androidx.annotation.NonNull; Loading Loading @@ -75,7 +74,7 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim * @return a {@link CaptivePortalData} object with a friendly name set */ @Override public CaptivePortalData withVenueFriendlyName(String friendlyName) public CaptivePortalDataShim withVenueFriendlyName(String friendlyName) throws UnsupportedApiLevelException { // Not supported in API level 29 throw new UnsupportedApiLevelException("CaptivePortalData not supported on API 29"); Loading @@ -93,7 +92,7 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim * and conditions URL set */ @Override public CaptivePortalData withPasspointInfo(@NonNull String friendlyName, public CaptivePortalDataShim withPasspointInfo(@NonNull String friendlyName, @NonNull Uri venueInfoUrl, @NonNull Uri termsAndConditionsUrl) throws UnsupportedApiLevelException { // Not supported in API level 29 Loading apishim/29/com/android/networkstack/apishim/api29/NetworkInformationShimImpl.java +2 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.networkstack.apishim.api29; import android.net.CaptivePortalData; import android.net.IpPrefix; import android.net.LinkProperties; import android.net.NetworkCapabilities; Loading Loading @@ -121,10 +120,7 @@ public class NetworkInformationShimImpl implements NetworkInformationShim { * @param captivePortalData Captive portal data to be used */ public void setCaptivePortalData(@NonNull LinkProperties lp, @Nullable CaptivePortalData captivePortalData) { if (lp == null) { return; } lp.setCaptivePortalData(captivePortalData); @Nullable CaptivePortalDataShim captivePortalData) { // Not supported on this API level: no-op } } apishim/30/com/android/networkstack/apishim/api30/CaptivePortalDataShimImpl.java +12 −8 Original line number Diff line number Diff line Loading @@ -39,10 +39,14 @@ public class CaptivePortalDataShimImpl @NonNull protected final CaptivePortalData mData; protected CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { public CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { mData = data; } public CaptivePortalData getData() { return mData; } /** * Parse a {@link CaptivePortalDataShim} from a JSON object. * @throws JSONException The JSON is not a representation of correct captive portal data. Loading Loading @@ -118,31 +122,31 @@ public class CaptivePortalDataShimImpl } /** * 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 * @return a {@link CaptivePortalDataShim} object with a friendly name set */ @Override public CaptivePortalData withVenueFriendlyName(String friendlyName) public CaptivePortalDataShim withVenueFriendlyName(String friendlyName) throws UnsupportedApiLevelException { // Not supported in API level 29 throw new UnsupportedApiLevelException("FriendlyName not supported on API 30"); } /** * 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 public CaptivePortalData withPasspointInfo(@NonNull String friendlyName, public CaptivePortalDataShim withPasspointInfo(@NonNull String friendlyName, @NonNull Uri venueInfoUrl, @NonNull Uri termsAndConditionsUrl) throws UnsupportedApiLevelException { // Not supported in API level 29 Loading apishim/30/com/android/networkstack/apishim/api30/NetworkInformationShimImpl.java +9 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,13 @@ public class NetworkInformationShimImpl extends @NonNull Inet4Address serverAddress) { lp.setDhcpServerAddress(serverAddress); } @Override public void setCaptivePortalData(@NonNull LinkProperties lp, @Nullable CaptivePortalDataShim captivePortalData) { if (lp == null) { return; } lp.setCaptivePortalData(((CaptivePortalDataShimImpl) captivePortalData).getData()); } } apishim/31/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java +11 −11 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import com.android.networkstack.apishim.common.CaptivePortalDataShim; */ public class CaptivePortalDataShimImpl extends com.android.networkstack.apishim.api30.CaptivePortalDataShimImpl { protected CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { public CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { super(data); } Loading @@ -47,37 +47,37 @@ public class CaptivePortalDataShimImpl } /** * 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 * @return a {@link CaptivePortalDataShim} object with a friendly name set */ @Override public CaptivePortalData withVenueFriendlyName(String friendlyName) { return new CaptivePortalData.Builder(mData) public CaptivePortalDataShim withVenueFriendlyName(String friendlyName) { return new CaptivePortalDataShimImpl(new CaptivePortalData.Builder(mData) .setVenueFriendlyName(friendlyName) .build(); .build()); } /** * Generate a {@link CaptivePortalData} object with a friendly name and Passpoint external * 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 public CaptivePortalData withPasspointInfo(@NonNull String friendlyName, public CaptivePortalDataShim withPasspointInfo(@NonNull String friendlyName, @NonNull Uri venueInfoUrl, @NonNull Uri termsAndConditionsUrl) { return new CaptivePortalData.Builder(mData) return new CaptivePortalDataShimImpl(new CaptivePortalData.Builder(mData) .setVenueFriendlyName(friendlyName) .setVenueInfoUrl(venueInfoUrl, ConstantsShim.CAPTIVE_PORTAL_DATA_SOURCE_PASSPOINT) .setUserPortalUrl(termsAndConditionsUrl, ConstantsShim.CAPTIVE_PORTAL_DATA_SOURCE_PASSPOINT) .build(); .build()); } } Loading
apishim/29/com/android/networkstack/apishim/api29/CaptivePortalDataShimImpl.java +2 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.networkstack.apishim.api29; import android.net.CaptivePortalData; import android.net.Uri; import androidx.annotation.NonNull; Loading Loading @@ -75,7 +74,7 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim * @return a {@link CaptivePortalData} object with a friendly name set */ @Override public CaptivePortalData withVenueFriendlyName(String friendlyName) public CaptivePortalDataShim withVenueFriendlyName(String friendlyName) throws UnsupportedApiLevelException { // Not supported in API level 29 throw new UnsupportedApiLevelException("CaptivePortalData not supported on API 29"); Loading @@ -93,7 +92,7 @@ public abstract class CaptivePortalDataShimImpl implements CaptivePortalDataShim * and conditions URL set */ @Override public CaptivePortalData withPasspointInfo(@NonNull String friendlyName, public CaptivePortalDataShim withPasspointInfo(@NonNull String friendlyName, @NonNull Uri venueInfoUrl, @NonNull Uri termsAndConditionsUrl) throws UnsupportedApiLevelException { // Not supported in API level 29 Loading
apishim/29/com/android/networkstack/apishim/api29/NetworkInformationShimImpl.java +2 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.networkstack.apishim.api29; import android.net.CaptivePortalData; import android.net.IpPrefix; import android.net.LinkProperties; import android.net.NetworkCapabilities; Loading Loading @@ -121,10 +120,7 @@ public class NetworkInformationShimImpl implements NetworkInformationShim { * @param captivePortalData Captive portal data to be used */ public void setCaptivePortalData(@NonNull LinkProperties lp, @Nullable CaptivePortalData captivePortalData) { if (lp == null) { return; } lp.setCaptivePortalData(captivePortalData); @Nullable CaptivePortalDataShim captivePortalData) { // Not supported on this API level: no-op } }
apishim/30/com/android/networkstack/apishim/api30/CaptivePortalDataShimImpl.java +12 −8 Original line number Diff line number Diff line Loading @@ -39,10 +39,14 @@ public class CaptivePortalDataShimImpl @NonNull protected final CaptivePortalData mData; protected CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { public CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { mData = data; } public CaptivePortalData getData() { return mData; } /** * Parse a {@link CaptivePortalDataShim} from a JSON object. * @throws JSONException The JSON is not a representation of correct captive portal data. Loading Loading @@ -118,31 +122,31 @@ public class CaptivePortalDataShimImpl } /** * 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 * @return a {@link CaptivePortalDataShim} object with a friendly name set */ @Override public CaptivePortalData withVenueFriendlyName(String friendlyName) public CaptivePortalDataShim withVenueFriendlyName(String friendlyName) throws UnsupportedApiLevelException { // Not supported in API level 29 throw new UnsupportedApiLevelException("FriendlyName not supported on API 30"); } /** * 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 public CaptivePortalData withPasspointInfo(@NonNull String friendlyName, public CaptivePortalDataShim withPasspointInfo(@NonNull String friendlyName, @NonNull Uri venueInfoUrl, @NonNull Uri termsAndConditionsUrl) throws UnsupportedApiLevelException { // Not supported in API level 29 Loading
apishim/30/com/android/networkstack/apishim/api30/NetworkInformationShimImpl.java +9 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,13 @@ public class NetworkInformationShimImpl extends @NonNull Inet4Address serverAddress) { lp.setDhcpServerAddress(serverAddress); } @Override public void setCaptivePortalData(@NonNull LinkProperties lp, @Nullable CaptivePortalDataShim captivePortalData) { if (lp == null) { return; } lp.setCaptivePortalData(((CaptivePortalDataShimImpl) captivePortalData).getData()); } }
apishim/31/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java +11 −11 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import com.android.networkstack.apishim.common.CaptivePortalDataShim; */ public class CaptivePortalDataShimImpl extends com.android.networkstack.apishim.api30.CaptivePortalDataShimImpl { protected CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { public CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) { super(data); } Loading @@ -47,37 +47,37 @@ public class CaptivePortalDataShimImpl } /** * 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 * @return a {@link CaptivePortalDataShim} object with a friendly name set */ @Override public CaptivePortalData withVenueFriendlyName(String friendlyName) { return new CaptivePortalData.Builder(mData) public CaptivePortalDataShim withVenueFriendlyName(String friendlyName) { return new CaptivePortalDataShimImpl(new CaptivePortalData.Builder(mData) .setVenueFriendlyName(friendlyName) .build(); .build()); } /** * Generate a {@link CaptivePortalData} object with a friendly name and Passpoint external * 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 public CaptivePortalData withPasspointInfo(@NonNull String friendlyName, public CaptivePortalDataShim withPasspointInfo(@NonNull String friendlyName, @NonNull Uri venueInfoUrl, @NonNull Uri termsAndConditionsUrl) { return new CaptivePortalData.Builder(mData) return new CaptivePortalDataShimImpl(new CaptivePortalData.Builder(mData) .setVenueFriendlyName(friendlyName) .setVenueInfoUrl(venueInfoUrl, ConstantsShim.CAPTIVE_PORTAL_DATA_SOURCE_PASSPOINT) .setUserPortalUrl(termsAndConditionsUrl, ConstantsShim.CAPTIVE_PORTAL_DATA_SOURCE_PASSPOINT) .build(); .build()); } }