Loading services/java/com/android/server/net/NetworkPolicyManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -524,6 +524,11 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { case MATCH_MOBILE_3G_LOWER: case MATCH_MOBILE_4G: case MATCH_MOBILE_ALL: // mobile templates aren't relevant in airplane mode if (isAirplaneModeOn(mContext)) { return false; } // mobile templates are relevant when subscriberid is active return Objects.equal(getActiveSubscriberId(), template.getSubscriberId()); } Loading Loading @@ -1723,6 +1728,11 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { mHandler.getLooper().getQueue().addIdleHandler(handler); } public static boolean isAirplaneModeOn(Context context) { return Settings.System.getInt( context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0) != 0; } private static void collectKeys(SparseIntArray source, SparseBooleanArray target) { final int size = source.size(); for (int i = 0; i < size; i++) { Loading Loading
services/java/com/android/server/net/NetworkPolicyManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -524,6 +524,11 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { case MATCH_MOBILE_3G_LOWER: case MATCH_MOBILE_4G: case MATCH_MOBILE_ALL: // mobile templates aren't relevant in airplane mode if (isAirplaneModeOn(mContext)) { return false; } // mobile templates are relevant when subscriberid is active return Objects.equal(getActiveSubscriberId(), template.getSubscriberId()); } Loading Loading @@ -1723,6 +1728,11 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { mHandler.getLooper().getQueue().addIdleHandler(handler); } public static boolean isAirplaneModeOn(Context context) { return Settings.System.getInt( context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0) != 0; } private static void collectKeys(SparseIntArray source, SparseBooleanArray target) { final int size = source.size(); for (int i = 0; i < size; i++) { Loading