Merge "[MS14] Move isPersistable to NetworkPolicy" am: b6d02f2cc0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925762 Change-Id: Ib1e0c171a514ec3b87a4e24b6def418df394bc97
This commit is contained in:
@@ -559,30 +559,6 @@ public final class NetworkTemplate implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the template can be persisted into disk.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
// TODO: Move to the NetworkPolicy.
|
|
||||||
public boolean isPersistable() {
|
|
||||||
switch (mMatchRule) {
|
|
||||||
case MATCH_MOBILE_WILDCARD:
|
|
||||||
case MATCH_WIFI_WILDCARD:
|
|
||||||
return false;
|
|
||||||
case MATCH_CARRIER:
|
|
||||||
return mSubscriberId != null;
|
|
||||||
case MATCH_WIFI:
|
|
||||||
if (Objects.equals(mNetworkId, WIFI_NETWORK_KEY_ALL)
|
|
||||||
&& mSubscriberIdMatchRule == SUBSCRIBER_ID_MATCH_RULE_ALL) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get match rule of the template. See {@code MATCH_*}.
|
* Get match rule of the template. See {@code MATCH_*}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user