Loading android/app/src/com/android/bluetooth/pan/PanService.java +5 −5 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.net.ConnectivityManager; import android.net.InetAddresses; import android.net.InterfaceConfiguration; import android.net.LinkAddress; import android.net.TetheringManager; import android.os.Handler; import android.os.IBinder; import android.os.INetworkManagementService; Loading Loading @@ -641,9 +642,8 @@ public class PanService extends ProfileService { IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); INetworkManagementService service = INetworkManagementService.Stub.asInterface(b); ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); String[] bluetoothRegexs = cm.getTetherableBluetoothRegexs(); TetheringManager tm = getBaseContext().getSystemService(TetheringManager.class); String[] bluetoothRegexs = tm.getTetherableBluetoothRegexs(); // bring toggle the interfaces String[] currentIfaces = new String[0]; Loading Loading @@ -689,13 +689,13 @@ public class PanService extends ProfileService { service.setInterfaceConfig(iface, ifcg); if (enable) { int tetherStatus = cm.tether(iface); int tetherStatus = tm.tether(iface); if (tetherStatus != ConnectivityManager.TETHER_ERROR_NO_ERROR) { Log.e(TAG, "Error tethering " + iface + " tetherStatus: " + tetherStatus); return null; } } else { int untetherStatus = cm.untether(iface); int untetherStatus = tm.untether(iface); Log.i(TAG, "Untethered: " + iface + " untetherStatus: " + untetherStatus); } } Loading Loading
android/app/src/com/android/bluetooth/pan/PanService.java +5 −5 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.net.ConnectivityManager; import android.net.InetAddresses; import android.net.InterfaceConfiguration; import android.net.LinkAddress; import android.net.TetheringManager; import android.os.Handler; import android.os.IBinder; import android.os.INetworkManagementService; Loading Loading @@ -641,9 +642,8 @@ public class PanService extends ProfileService { IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); INetworkManagementService service = INetworkManagementService.Stub.asInterface(b); ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); String[] bluetoothRegexs = cm.getTetherableBluetoothRegexs(); TetheringManager tm = getBaseContext().getSystemService(TetheringManager.class); String[] bluetoothRegexs = tm.getTetherableBluetoothRegexs(); // bring toggle the interfaces String[] currentIfaces = new String[0]; Loading Loading @@ -689,13 +689,13 @@ public class PanService extends ProfileService { service.setInterfaceConfig(iface, ifcg); if (enable) { int tetherStatus = cm.tether(iface); int tetherStatus = tm.tether(iface); if (tetherStatus != ConnectivityManager.TETHER_ERROR_NO_ERROR) { Log.e(TAG, "Error tethering " + iface + " tetherStatus: " + tetherStatus); return null; } } else { int untetherStatus = cm.untether(iface); int untetherStatus = tm.untether(iface); Log.i(TAG, "Untethered: " + iface + " untetherStatus: " + untetherStatus); } } Loading