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

Commit 5223c5d4 authored by Ravinder Konka's avatar Ravinder Konka Committed by Gerrit - the friendly Code Review server
Browse files

Tethering: Set sys.usb.tethering to true on Tethering

Set the system Property "sys.usb.tethering" to true when
tethering is enabled on UI

Change-Id: I805a38b2d3ed055a562298d71f33fd5030b3a4a0
parent 1fff63c2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
@@ -800,6 +801,14 @@ public class Tethering extends BaseNetworkObserver {
            Log.e(TAG, "Error listing Interfaces", e);
            return;
        }

        final String usbSysctlKey = "sys.usb.tethering";
        SystemProperties.set(usbSysctlKey, "false");

        if (enable) {
           SystemProperties.set(usbSysctlKey, "true");
        }

        for (String iface : ifaces) {
            if (isUsb(iface)) {
                int result = (enable ? tether(iface) : untether(iface));