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

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

Issue 11172036: ABP/Android libadblockplus integration (Closed)
Patch Set: Created July 22, 2013, 8:52 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
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 { 374 {
375 clearConnectionProxy(); 375 clearConnectionProxy();
376 } 376 }
377 377
378 sendBroadcast(new Intent(BROADCAST_STATE_CHANGED).putExtra("enabled", false) ); 378 sendBroadcast(new Intent(BROADCAST_STATE_CHANGED).putExtra("enabled", false) );
379 379
380 // Stop proxy server 380 // Stop proxy server
381 if (proxy != null) 381 if (proxy != null)
382 proxy.close(); 382 proxy.close();
383 383
384 // TODO Do we have to check current state?
385 // Stop engine if not in interactive mode
386 AdblockPlus.getApplication().stopEngine(false);
387
388 // Release service lock 384 // Release service lock
389 stopForeground(true); 385 stopForeground(true);
390 386
391 Log.i(TAG, "Service stopped"); 387 Log.i(TAG, "Service stopped");
392 } 388 }
393 389
394 /** 390 /**
395 * Restores system proxy settings via native call on Android 3.1+ devices 391 * Restores system proxy settings via native call on Android 3.1+ devices
396 * using Java reflection. 392 * using Java reflection.
397 */ 393 */
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 @Override 924 @Override
929 public void log(int level, Object obj, String message) 925 public void log(int level, Object obj, String message)
930 { 926 {
931 if (level <= logLevel) 927 if (level <= logLevel)
932 { 928 {
933 Log.println(7 - level, obj != null ? obj.toString() : TAG, message); 929 Log.println(7 - level, obj != null ? obj.toString() : TAG, message);
934 } 930 }
935 } 931 }
936 } 932 }
937 } 933 }
OLDNEW

Powered by Google App Engine
This is Rietveld