diff options
| author | 2022-01-26 01:11:08 +0800 | |
|---|---|---|
| committer | 2022-01-26 01:38:44 +0800 | |
| commit | 2e57bf87bc6f2c8c218c6091ae03254ca8ee730d (patch) | |
| tree | 6880f6d77ef7bd95afdce026bbe66a065c935679 | |
| parent | 67c2aafe12c0e2bd2658df00b22d2d5607aebdee (diff) | |
[MS74] Expose NetworkTemplate#matches
This is used by NetworkPolicyManagerService to find
relevant networks of a given NetworkPolicy.
Test: TH
Bug: 204830222
Change-Id: I7176ab727bf208e0fd05ecb9c2bcb00cd3438031
| -rw-r--r-- | core/api/module-lib-current.txt | 1 | ||||
| -rw-r--r-- | packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index 8fd3e6ec4446..74ec189514c5 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -345,6 +345,7 @@ package android.net { method public int getRoaming(); method @NonNull public java.util.Set<java.lang.String> getSubscriberIds(); method @NonNull public java.util.Set<java.lang.String> getWifiNetworkKeys(); + method public boolean matches(@NonNull android.net.NetworkIdentity); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkTemplate> CREATOR; field public static final int MATCH_BLUETOOTH = 8; // 0x8 diff --git a/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java b/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java index cad80752b8e7..dba39913300c 100644 --- a/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java +++ b/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java @@ -652,7 +652,9 @@ public final class NetworkTemplate implements Parcelable { * * @hide */ - public boolean matches(NetworkIdentity ident) { + @SystemApi(client = MODULE_LIBRARIES) + public boolean matches(@NonNull NetworkIdentity ident) { + Objects.requireNonNull(ident); if (!matchesMetered(ident)) return false; if (!matchesRoaming(ident)) return false; if (!matchesDefaultNetwork(ident)) return false; |