OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 21 matching lines...) Expand all Loading... |
32 }, | 32 }, |
33 | 33 |
34 // Non-metered WiFi networks | 34 // Non-metered WiFi networks |
35 WIFI_NON_METERED("wifi_non_metered") | 35 WIFI_NON_METERED("wifi_non_metered") |
36 { | 36 { |
37 @Override | 37 @Override |
38 public boolean isRequiredConnection(ConnectivityManager manager) | 38 public boolean isRequiredConnection(ConnectivityManager manager) |
39 { | 39 { |
40 return | 40 return |
41 manager.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIF
I && | 41 manager.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIF
I && |
42 !manager.isActiveNetworkMetered(); | 42 !manager.isActiveNetworkMetered(); // make minSdkVersion 16 |
43 } | 43 } |
44 }, | 44 }, |
45 | 45 |
46 // Any connection | 46 // Any connection |
47 ANY("any") | 47 ANY("any") |
48 { | 48 { |
49 @Override | 49 @Override |
50 public boolean isRequiredConnection(ConnectivityManager manager) | 50 public boolean isRequiredConnection(ConnectivityManager manager) |
51 { | 51 { |
52 return true; | 52 return true; |
(...skipping 27 matching lines...) Expand all Loading... |
80 if (eachConnectionType.getValue().equals(value)) | 80 if (eachConnectionType.getValue().equals(value)) |
81 { | 81 { |
82 return eachConnectionType; | 82 return eachConnectionType; |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 // not found | 86 // not found |
87 return null; | 87 return null; |
88 } | 88 } |
89 } | 89 } |
OLD | NEW |