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

Commit e1ba791c authored by Naga Venkata Durga Ashok Mutyala's avatar Naga Venkata Durga Ashok Mutyala Committed by android-build-merger
Browse files

Merge "Using WifiCommand to toggle the Wi-Fi state"

am: bec5dc83

Change-Id: I68c100893d634af80a9d14552cdf0255a8ebee16
parents 39458f16 bec5dc83
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -33,14 +33,15 @@ import android.os.ParcelFileDescriptor.AutoCloseInputStream;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
import android.support.test.uiautomator.UiDevice;
import android.test.InstrumentationTestCase;
import android.util.Log;

import libcore.io.Streams;

import com.google.mockwebserver.MockResponse;
import com.google.mockwebserver.MockWebServer;

import libcore.io.Streams;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
@@ -63,6 +64,7 @@ public class DownloadManagerBaseTest extends InstrumentationTestCase {
    private static final String TAG = "DownloadManagerBaseTest";
    protected DownloadManager mDownloadManager = null;
    private MockWebServer mServer = null;
    private UiDevice mUiDevice = null;
    protected String mFileType = "text/plain";
    protected Context mContext = null;
    protected MultipleDownloadsCompletedReceiver mReceiver = null;
@@ -234,6 +236,7 @@ public class DownloadManagerBaseTest extends InstrumentationTestCase {
    @Override
    public void setUp() throws Exception {
        mContext = getInstrumentation().getContext();
        mUiDevice = UiDevice.getInstance(getInstrumentation());
        mDownloadManager = (DownloadManager)mContext.getSystemService(Context.DOWNLOAD_SERVICE);
        mServer = new MockWebServer();
        mServer.play();
@@ -512,7 +515,7 @@ public class DownloadManagerBaseTest extends InstrumentationTestCase {
        Log.i(LOG_TAG, "Setting WiFi State to: " + enable);
        WifiManager manager = (WifiManager)mContext.getSystemService(Context.WIFI_SERVICE);

        manager.setWifiEnabled(enable);
        mUiDevice.executeShellCommand("svc wifi " + (enable ? "enable" : "disable"));

        String timeoutMessage = "Timed out waiting for Wifi to be "
            + (enable ? "enabled!" : "disabled!");