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

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

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

am: 169681db

Change-Id: Ifd9e1c3645c2fa7c6671991edf52d1deb63d9d1c
parents e0bf06dd 169681db
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -413,15 +413,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) {