Add isMatchRuleMobile back
There's a user still call this method which causes the app
crash and it might be the app was built against hidden API.
The bug was observed after updating the mainline module so
adding this method back to the module to avoid apps crash
due to the method is not found in NetworkTemplate.
Bug: 269178029
Test: build
Change-Id: I06dc694b1ce060488135f5d34138f14abd50ad32
diff --git a/framework-t/src/android/net/NetworkTemplate.java b/framework-t/src/android/net/NetworkTemplate.java
index 748b1ba..c0e0449 100644
--- a/framework-t/src/android/net/NetworkTemplate.java
+++ b/framework-t/src/android/net/NetworkTemplate.java
@@ -404,6 +404,19 @@
return false;
}
+ // TODO(b/270089918): Remove this method after no callers.
+ /** @hide */
+ public boolean isMatchRuleMobile() {
+ switch (mMatchRule) {
+ case MATCH_MOBILE:
+ // Old MATCH_MOBILE_WILDCARD
+ case 6:
+ return true;
+ default:
+ return false;
+ }
+ }
+
/**
* Get match rule of the template. See {@code MATCH_*}.
*/