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

Commit 17237203 authored by Chiachang Wang's avatar Chiachang Wang
Browse files

Rename getVpnRequiresValidation and getRequiresInternetValdiation

Update the API naming below to address API review feedback:
1. NetworkAgentConfig.getVpnRequiresValidation to
   NetworkAgentConfig.isVpnValidationRequired
2. PlatformVpnProfile.getRequiresInternetValdiation to
   PlatformVpnProfile.isInternetValidationRequired

Test: atest FrameworksNetTests
Bug: 220129160
Change-Id: I972c38c10f405bcb29f21d764d8480cb93fa68c1
parent 925e19bc
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -25,10 +25,10 @@ import com.android.networkstack.apishim.common.UnsupportedApiLevelException;
 */
 */
public class Ikev2VpnProfileShimImpl<T> implements Ikev2VpnProfileShim<T> {
public class Ikev2VpnProfileShimImpl<T> implements Ikev2VpnProfileShim<T> {
    /**
    /**
     * @see Ikev2VpnProfile#getRequiresInternetValidation(boolean)
     * @see Ikev2VpnProfile#isInternetValidationRequired(boolean)
     */
     */
    @Override
    @Override
    public boolean getRequiresInternetValidation(T profile)
    public boolean isInternetValidationRequired(T profile)
            throws UnsupportedApiLevelException {
            throws UnsupportedApiLevelException {
        throw new UnsupportedApiLevelException("Only supported from API level 33.");
        throw new UnsupportedApiLevelException("Only supported from API level 33.");
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,7 @@ import com.android.networkstack.apishim.common.NetworkAgentConfigShim;
 */
 */
public class NetworkAgentConfigShimImpl implements NetworkAgentConfigShim {
public class NetworkAgentConfigShimImpl implements NetworkAgentConfigShim {
    @Override
    @Override
    public boolean getVpnRequiresValidation() {
    public boolean isVpnValidationRequired() {
        return false;
        return false;
    }
    }
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -44,10 +44,10 @@ public class Ikev2VpnProfileShimImpl
    }
    }


    /**
    /**
     * @see Ikev2VpnProfile#getRequiresInternetValidation()
     * @see Ikev2VpnProfile#isInternetValidationRequired()
     */
     */
    @Override
    @Override
    public boolean getRequiresInternetValidation(@NonNull final Ikev2VpnProfile profile) {
    public boolean isInternetValidationRequired(@NonNull final Ikev2VpnProfile profile) {
        return profile.getRequiresInternetValidation();
        return profile.isInternetValidationRequired();
    }
    }
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -46,11 +46,11 @@ public class NetworkAgentConfigShimImpl
    }
    }


    @Override
    @Override
    public boolean getVpnRequiresValidation() {
    public boolean isVpnValidationRequired() {
        if (null == mNetworkAgentConfig) {
        if (null == mNetworkAgentConfig) {
            return false;
            return false;
        } else {
        } else {
            return mNetworkAgentConfig.getVpnRequiresValidation();
            return mNetworkAgentConfig.isVpnValidationRequired();
        }
        }
    }
    }


+2 −2
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ package com.android.networkstack.apishim.common;
// TODO : when API29 is no longer supported, remove the type argument
// TODO : when API29 is no longer supported, remove the type argument
public interface Ikev2VpnProfileShim<T> {
public interface Ikev2VpnProfileShim<T> {
    /**
    /**
     * @see Ikev2VpnProfile#getRequiresInternetValidation()
     * @see Ikev2VpnProfile#isInternetValidationRequired()
     */
     */
    boolean getRequiresInternetValidation(T profile) throws UnsupportedApiLevelException;
    boolean isInternetValidationRequired(T profile) throws UnsupportedApiLevelException;
}
}
Loading