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

Delta Between Two Patch Sets: src/org/adblockplus/android/AdblockPlus.java

Issue 9437197: ABP/Android Proxy switch (Closed)
Left Patch Set: Created Feb. 28, 2013, 1:20 p.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « res/xml/preferences_advanced.xml ('k') | src/org/adblockplus/android/AdvancedPreferences.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 * Checks if ProxyService is running. 221 * Checks if ProxyService is running.
222 * 222 *
223 * @return true if service is running 223 * @return true if service is running
224 */ 224 */
225 public boolean isServiceRunning() 225 public boolean isServiceRunning()
226 { 226 {
227 ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVIC E); 227 ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVIC E);
228 // Actually it returns not only running services, so extra check is required 228 // Actually it returns not only running services, so extra check is required
229 for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VAL UE)) 229 for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VAL UE))
230 { 230 {
231 if ("org.adblockplus.android.ProxyService".equals(service.service.getClass Name()) && service.pid > 0) 231 if (ProxyService.class.getCanonicalName().equals(service.service.getClassN ame()) && service.pid > 0)
Felix Dahlke 2013/03/11 06:57:38 How about ProxyService.getClass().getCanonicalName
Andrey Novikov 2013/03/11 07:32:55 ProxyService.class.getCanonicalName(), done
232 return true; 232 return true;
233 } 233 }
234 return false; 234 return false;
235 } 235 }
236 236
237 /** 237 /**
238 * Checks if application can write to external storage. 238 * Checks if application can write to external storage.
239 */ 239 */
240 public boolean checkWriteExternalPermission() 240 public boolean checkWriteExternalPermission()
241 { 241 {
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 jsEngine.callback(callback, params); 910 jsEngine.callback(callback, params);
911 } 911 }
912 912
913 public final void stopEngine() 913 public final void stopEngine()
914 { 914 {
915 run = false; 915 run = false;
916 synchronized (queue) 916 synchronized (queue)
917 { 917 {
918 queue.notify(); 918 queue.notify();
919 } 919 }
920 System.gc();
Felix Dahlke 2013/03/11 06:57:38 I think we shouldn't do this, won't help us work a
Andrey Novikov 2013/03/11 07:32:55 Done.
921 } 920 }
922 921
923 public void execute(Runnable r) 922 public void execute(Runnable r)
924 { 923 {
925 synchronized (queue) 924 synchronized (queue)
926 { 925 {
927 queue.addLast(r); 926 queue.addLast(r);
928 queue.notify(); 927 queue.notify();
929 } 928 }
930 } 929 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 } 1142 }
1144 return result; 1143 return result;
1145 } 1144 }
1146 1145
1147 protected void onProgressUpdate(Integer... progress) 1146 protected void onProgressUpdate(Integer... progress)
1148 { 1147 {
1149 Log.d("HTTP", "Progress: " + progress[0].intValue()); 1148 Log.d("HTTP", "Progress: " + progress[0].intValue());
1150 } 1149 }
1151 } 1150 }
1152 } 1151 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld