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

Commit a805bfc4 authored by Erik Kline's avatar Erik Kline Committed by android-build-merger
Browse files

Merge "Use ConnectivityService's NETWORK_STACK permission for SoftAp...

Merge "Use ConnectivityService's NETWORK_STACK permission for SoftAp operations" am: 169681db am: b663a7d6
am: b6ec8ed6

Change-Id: If6c7225e853e1969022d9b9d6cee127c477e0df7
parents 4cd2bae1 b6ec8ed6
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -416,15 +416,21 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
    }

    private int setWifiTethering(final boolean enable) {
        int rval = ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
        final long ident = Binder.clearCallingIdentity();
        try {
            synchronized (mPublicSync) {
                mWifiTetherRequested = enable;
            final WifiManager wifiManager = getWifiManager();
            if ((enable && wifiManager.startSoftAp(null /* use existing wifi config */)) ||
                (!enable && wifiManager.stopSoftAp())) {
                return ConnectivityManager.TETHER_ERROR_NO_ERROR;
                final WifiManager mgr = getWifiManager();
                if ((enable && mgr.startSoftAp(null /* use existing wifi config */)) ||
                    (!enable && mgr.stopSoftAp())) {
                    rval = ConnectivityManager.TETHER_ERROR_NO_ERROR;
                }
            return ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
            }
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
        return rval;
    }

    private void setBluetoothTethering(final boolean enable, final ResultReceiver receiver) {