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

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

Issue 9375072: ABP/Android solved deprecation issue (Closed)
Patch Set: Created Feb. 14, 2013, 8:32 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 | « no previous file | no next file » | 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 * settings accordingly. 670 * settings accordingly.
671 */ 671 */
672 private BroadcastReceiver connectionReceiver = new BroadcastReceiver() { 672 private BroadcastReceiver connectionReceiver = new BroadcastReceiver() {
673 @Override 673 @Override
674 public void onReceive(Context ctx, Intent intent) 674 public void onReceive(Context ctx, Intent intent)
675 { 675 {
676 String action = intent.getAction(); 676 String action = intent.getAction();
677 Log.i(TAG, "Action: " + action); 677 Log.i(TAG, "Action: " + action);
678 if (ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) 678 if (ConnectivityManager.CONNECTIVITY_ACTION.equals(action))
679 { 679 {
680 NetworkInfo info = intent.getParcelableExtra(ConnectivityManager.EXTRA_N ETWORK_INFO); 680 ConnectivityManager connectivityManager = (ConnectivityManager) getSyste mService(Context.CONNECTIVITY_SERVICE);
681 NetworkInfo info = connectivityManager.getActiveNetworkInfo();
681 if (info == null) 682 if (info == null)
682 return; 683 return;
683 String typeName = info.getTypeName(); 684 String typeName = info.getTypeName();
684 String subtypeName = info.getSubtypeName(); 685 String subtypeName = info.getSubtypeName();
685 boolean available = info.isAvailable(); 686 boolean available = info.isAvailable();
686 Log.i(TAG, "Network Type: " + typeName + ", subtype: " + subtypeName + " , available: " + available); 687 Log.i(TAG, "Network Type: " + typeName + ", subtype: " + subtypeName + " , available: " + available);
687 if (info.getType() == ConnectivityManager.TYPE_WIFI) 688 if (info.getType() == ConnectivityManager.TYPE_WIFI)
688 ProxySettings.setConnectionProxy(getApplicationContext(), LOCALHOST, p ort, ""); 689 ProxySettings.setConnectionProxy(getApplicationContext(), LOCALHOST, p ort, "");
689 } 690 }
690 else if ("android.net.wifi.LINK_CONFIGURATION_CHANGED".equals(action)) 691 else if ("android.net.wifi.LINK_CONFIGURATION_CHANGED".equals(action))
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 @Override 742 @Override
742 public void log(int level, Object obj, String message) 743 public void log(int level, Object obj, String message)
743 { 744 {
744 if (level <= logLevel) 745 if (level <= logLevel)
745 { 746 {
746 Log.println(7 - level, obj != null ? obj.toString() : TAG, message); 747 Log.println(7 - level, obj != null ? obj.toString() : TAG, message);
747 } 748 }
748 } 749 }
749 } 750 }
750 } 751 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld