[MS14] Move isPersistable to NetworkPolicy
Since the NetworkTemplate serialization is done in the platform
code. To decide whether the template is persistable should be
also inside the platform along with the serialization logic.
Test: atest NetworkPolicyTest
Bug: 204830222
Change-Id: I15d17dda77e6a3e1ae11275915e3d2f6e2888639
diff --git a/framework-t/src/android/net/NetworkTemplate.java b/framework-t/src/android/net/NetworkTemplate.java
index 7dd04c5..d852913 100644
--- a/framework-t/src/android/net/NetworkTemplate.java
+++ b/framework-t/src/android/net/NetworkTemplate.java
@@ -560,30 +560,6 @@
}
/**
- * 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_*}.
*/
@UnsupportedAppUsage