commit | 7c0fc24620927127420aad0ce696f5c2b245734b | [log] [tgz] |
---|---|---|
author | Chiachang Wang <chiachangwang@google.com> | Wed Apr 13 04:35:12 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Apr 13 04:35:12 2022 +0000 |
tree | 7884a40160c6f1b74423cc2bbea738e2202af07f | |
parent | 9e4b7447e4846c922b2925a4e6d524409ba0e165 [diff] | |
parent | 620ea6f1fc8f825f64a052b9ffa9c998dfc23dcd [diff] |
Merge "Add protection for setLocalRoutesExcludedForVpn" am: 620ea6f1fc Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2019875 Change-Id: I002c5ffac6d149a6f5e61d81b6a868c814f1b15d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/framework/src/android/net/NetworkAgentConfig.java b/framework/src/android/net/NetworkAgentConfig.java index b28c006..0d2b620 100644 --- a/framework/src/android/net/NetworkAgentConfig.java +++ b/framework/src/android/net/NetworkAgentConfig.java
@@ -24,6 +24,8 @@ import android.os.Parcel; import android.os.Parcelable; +import com.android.modules.utils.build.SdkLevel; + import java.util.Objects; /** @@ -473,6 +475,9 @@ @NonNull @SystemApi(client = MODULE_LIBRARIES) public Builder setLocalRoutesExcludedForVpn(boolean excludeLocalRoutes) { + if (!SdkLevel.isAtLeastT()) { + throw new UnsupportedOperationException("Method is not supported"); + } mConfig.excludeLocalRouteVpn = excludeLocalRoutes; return this; }