Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/org/adblockplus/android/ProxySettings.java

Issue 9437197: ABP/Android Proxy switch (Closed)
Patch Set: ABP/Android Proxy switch Created March 11, 2013, 7:29 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/org/adblockplus/android/ProxyService.java ('k') | src/org/adblockplus/android/Starter.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 catch (Exception e) 171 catch (Exception e)
172 { 172 {
173 // This should not happen 173 // This should not happen
174 Log.e(TAG, "setHttpProxy failure", e); 174 Log.e(TAG, "setHttpProxy failure", e);
175 return false; 175 return false;
176 } 176 }
177 try 177 try
178 { 178 {
179 ConnectivityManager connectivityManager = (ConnectivityManager) context.ge tSystemService(Context.CONNECTIVITY_SERVICE); 179 ConnectivityManager connectivityManager = (ConnectivityManager) context.ge tSystemService(Context.CONNECTIVITY_SERVICE);
180 Object lp = method.invoke(connectivityManager); 180 Object lp = method.invoke(connectivityManager);
181 if (lp == null) // There is no active link now, but device has native 181 // There is no active link now, but device has native proxy support
182 // proxy support 182 if (lp == null)
183 return true; 183 return true;
184 184
185 String className = "android.net.ProxyProperties"; 185 String className = "android.net.ProxyProperties";
186 Class<?> c = Class.forName(className); 186 Class<?> c = Class.forName(className);
187 method = lp.getClass().getMethod("setHttpProxy", c); 187 method = lp.getClass().getMethod("setHttpProxy", c);
188 if (host != null) 188 if (host != null)
189 { 189 {
190 /* 190 /*
191 * ProxyProperties pp = new ProxyProperties(host, port, excl); 191 * ProxyProperties pp = new ProxyProperties(host, port, excl);
192 */ 192 */
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return false; 239 return false;
240 } 240 }
241 catch (Exception e) 241 catch (Exception e)
242 { 242 {
243 // This should not happen 243 // This should not happen
244 Log.e(TAG, "setHttpProxy failure", e); 244 Log.e(TAG, "setHttpProxy failure", e);
245 return false; 245 return false;
246 } 246 }
247 } 247 }
248 } 248 }
OLDNEW
« no previous file with comments | « src/org/adblockplus/android/ProxyService.java ('k') | src/org/adblockplus/android/Starter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld