Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cd5f14d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Replace ConnectivityManager hidden symbols on BT"

parents e82af506 41488564
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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;
@@ -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];
@@ -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);
                }
            }