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

Commit b6ec8ed6 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

am: b663a7d6

Change-Id: I64d3251de665cead6b0067728574b367698619d2
parents 5fe979b4 b663a7d6
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) {