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

Commit 5d43721c authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "For some devices (like SEMC 2010 ones), the kernel sends back a...

Merge "For some devices (like SEMC 2010 ones), the kernel sends back a kickback usb disconnect message when usb tethering is enabled. This patch ignores this disconnect message and is configurable by the ro.tethering.kb_disconnect property by the devices needing it." into gingerbread
parents 0c64bc18 43248a41
Loading
Loading
Loading
Loading
+11 −1
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.provider.Settings;
import android.util.Log;

@@ -116,6 +117,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {

    private boolean mLegacy = false;	// whether we need legacy tethering support or not
    private int mProbing = 0;		// track RNDIS enable/disable disconnects
    private int kb_disconnect = 0;	// whether there is a kickback usb disconnection event when rndis is enabled

    public Tethering(Context context, Looper looper) {
        mContext = context;
@@ -505,8 +507,13 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
                if (enable) {
                    interfaceAdded(iface);
                } else {
                    if (kb_disconnect == 0) {
                        interfaceRemoved(iface);
                    }
                    else {
                        kb_disconnect--;
                    }
                }
            }
        }
    }
@@ -1301,6 +1308,9 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
                    sm.sendMessage(TetherInterfaceSM.CMD_TETHER_CONNECTION_CHANGED,
                            ifaceName);
                }
                String kb_disc = SystemProperties.get("ro.tethering.kb_disconnect");
                if("1".equals(kb_disc))
                    kb_disconnect=1;
            }
        }