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

Commit d9937552 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Clean up scan handling"

parents bc340d03 bcc97ca4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public class WifiStressTest
                    ssidAppearInScanResultsCount, i));
            long startTime = System.currentTimeMillis();
            mAct.scanResultAvailable = false;
            assertTrue("start scan failed", mAct.mWifiManager.startScanActive());
            assertTrue("start scan failed", mAct.mWifiManager.startScan());
            while (true) {
                if ((System.currentTimeMillis() - startTime) >
                ConnectivityManagerTestActivity.WIFI_SCAN_TIMEOUT) {
+1 −1
Original line number Diff line number Diff line
@@ -588,7 +588,7 @@ public class ConnectionUtil {
                return true;
            } else {
                // Start an active scan
                mWifiManager.startScanActive();
                mWifiManager.startScan();
                mScanResultIsAvailable = false;
                long startTime = System.currentTimeMillis();
                while (!mScanResultIsAvailable) {
+2 −2
Original line number Diff line number Diff line
@@ -375,9 +375,9 @@ public final class WifiService extends IWifiManager.Stub {
    /**
     * see {@link android.net.wifi.WifiManager#startScan()}
     */
    public void startScan(boolean forceActive) {
    public void startScan() {
        enforceChangePermission();
        mWifiStateMachine.startScan(forceActive);
        mWifiStateMachine.startScan();
        noteScanStart();
    }

+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ interface IWifiManager

    boolean pingSupplicant();

    void startScan(boolean forceActive);
    void startScan();

    List<ScanResult> getScanResults(String callingPackage);

+1 −20
Original line number Diff line number Diff line
@@ -733,26 +733,7 @@ public class WifiManager {
     */
    public boolean startScan() {
        try {
            mService.startScan(false);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    }

    /**
     * Request a scan for access points. Returns immediately. The availability
     * of the results is made known later by means of an asynchronous event sent
     * on completion of the scan.
     * This is a variant of startScan that forces an active scan, even if passive
     * scans are the current default
     * @return {@code true} if the operation succeeded, i.e., the scan was initiated
     *
     * @hide
     */
    public boolean startScanActive() {
        try {
            mService.startScan(true);
            mService.startScan();
            return true;
        } catch (RemoteException e) {
            return false;
Loading