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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 final Intent intent = new Intent(ACTION_OPEN_SETTINGS); | 129 final Intent intent = new Intent(ACTION_OPEN_SETTINGS); |
130 final List<ResolveInfo> list = activityContext.getPackageManager() | 130 final List<ResolveInfo> list = activityContext.getPackageManager() |
131 .queryIntentActivities(intent, 0); | 131 .queryIntentActivities(intent, 0); |
132 if (list.size() > 0) | 132 if (list.size() > 0) |
133 { | 133 { |
134 activityContext.startActivity(intent); | 134 activityContext.startActivity(intent); |
135 } | 135 } |
136 return list.size() > 0; | 136 return list.size() > 0; |
137 } | 137 } |
138 | 138 |
| 139 public static boolean hasCompatibleSBrowserInstalled(final Context activityCon
text) |
| 140 { |
| 141 try |
| 142 { |
| 143 return activityContext.getPackageManager() |
| 144 .queryIntentActivities(new Intent(ACTION_OPEN_SETTINGS), 0).size() > 0
; |
| 145 } |
| 146 catch (final Throwable t) |
| 147 { |
| 148 return false; |
| 149 } |
| 150 } |
| 151 |
139 void requestUpdateBroadcast() | 152 void requestUpdateBroadcast() |
140 { | 153 { |
141 this.lock(); | 154 this.lock(); |
142 try | 155 try |
143 { | 156 { |
144 this.nextUpdateBroadcast = System.currentTimeMillis() + BROADCAST_COMBINAT
ION_DELAY_MILLIS; | 157 this.nextUpdateBroadcast = System.currentTimeMillis() + BROADCAST_COMBINAT
ION_DELAY_MILLIS; |
145 } | 158 } |
146 finally | 159 finally |
147 { | 160 { |
148 this.unlock(); | 161 this.unlock(); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 Log.d(TAG, headers.toString()); | 627 Log.d(TAG, headers.toString()); |
615 this.downloader.enqueueDownload(this.createDownloadURL(sub), sub.getId(),
headers); | 628 this.downloader.enqueueDownload(this.createDownloadURL(sub), sub.getId(),
headers); |
616 } | 629 } |
617 } | 630 } |
618 | 631 |
619 public void connectivityChanged() | 632 public void connectivityChanged() |
620 { | 633 { |
621 this.downloader.connectivityChanged(); | 634 this.downloader.connectivityChanged(); |
622 } | 635 } |
623 } | 636 } |
OLD | NEW |