Move WiFi Precondition from device to host side
This enables the option to synchronously connect to a Wifi network if
not already connected.
bug:23939594
Change-Id: I2c808fc95acba324ee72564d08983a2b6e00db95
diff --git a/tests/cts/net/AndroidTest.xml b/tests/cts/net/AndroidTest.xml
index 5d38c64..1509256 100644
--- a/tests/cts/net/AndroidTest.xml
+++ b/tests/cts/net/AndroidTest.xml
@@ -13,10 +13,7 @@
limitations under the License.
-->
<configuration description="Config for CTS Net test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkPreconditionCheck">
- <option name="apk" value="CtsNetPreconditions.apk"/>
- <option name="package" value="android.net.preconditions"/>
- </target_preparer>
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.WifiCheck" />
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="CtsNetTestCases.apk" />
diff --git a/tests/cts/net/preconditions/Android.mk b/tests/cts/net/preconditions/Android.mk
deleted file mode 100644
index d689e96..0000000
--- a/tests/cts/net/preconditions/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test compatibility-device-preconditions
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsNetPreconditions
-
-# Tag this module as a cts_v2 test artifact
-LOCAL_COMPATIBILITY_SUITE := cts_v2
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/tests/cts/net/preconditions/AndroidManifest.xml b/tests/cts/net/preconditions/AndroidManifest.xml
deleted file mode 100644
index 59db7a7..0000000
--- a/tests/cts/net/preconditions/AndroidManifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="android.net.preconditions">
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
- <application>
- <uses-library android:name="android.test.runner" />
- </application>
-
- <!-- self-instrumenting test package. -->
- <instrumentation
- android:name="android.support.test.runner.AndroidJUnitRunner"
- android:label="CTS preconditions test for 'net' module"
- android:targetPackage="android.net.preconditions" >
- </instrumentation>
-</manifest>
diff --git a/tests/cts/net/preconditions/src/android/net/preconditions/PreconditionsTest.java b/tests/cts/net/preconditions/src/android/net/preconditions/PreconditionsTest.java
deleted file mode 100644
index 4e132cb..0000000
--- a/tests/cts/net/preconditions/src/android/net/preconditions/PreconditionsTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.net.preconditions;
-
-import android.test.AndroidTestCase;
-
-import com.android.compatibility.common.preconditions.WifiHelper;
-
-/**
- * A test to verify that device-side preconditions are met for the net module of CTS
- */
-public class PreconditionsTest extends AndroidTestCase {
-
- /**
- * Test if device is connected to WiFi
- * @throws Exception
- */
- public void testWifiConnected() throws Exception {
- assertTrue("Device must have active network connection",
- WifiHelper.isWifiConnected(this.getContext()));
- }
-
-}