Migrate test_utils from acts to acts_contrib
This change will allow the ACTS framework to be packaged independently
of its test_utils. This facilitates the usage of ACTS within test suites
outside of tools/test/connectivity.
Re-submission of ag/13029169.
This reverts commit a4913cd4087bb09bf192de6ef819657aa6e082bd.
Reason for revert: Submit once references in acts_power are fixed.
Change-Id: I2d60f8ccaf936a80820a7b4387c23bbce1293dcf
diff --git a/acts_tests/acts_contrib/test_utils/car/car_bt_utils.py b/acts_tests/acts_contrib/test_utils/car/car_bt_utils.py
new file mode 100644
index 0000000..a428528
--- /dev/null
+++ b/acts_tests/acts_contrib/test_utils/car/car_bt_utils.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python3
+#
+# Copyright 2016 - Google
+#
+# 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.
+
+# Defines utilities that can be used for making calls indenpendent of
+# subscription IDs. This can be useful when making calls over mediums not SIM
+# based.
+
+# Make a phone call to the specified URI. It is assumed that we are making the
+# call to the user selected default account.
+#
+# We usually want to make sure that the call has ended up in a good state.
+#
+# NOTE: This util is applicable to only non-conference type calls. It is best
+# suited to test cases where only one call is in action at any point of time.
+
+import queue
+import time
+
+from acts import logger
+from acts_contrib.test_utils.bt import bt_test_utils
+from acts_contrib.test_utils.bt.BtEnum import *
+
+
+def set_car_profile_priorities_off(car_droid, ph_droid):
+ """Sets priority of car related profiles to OFF. This avoids
+ autoconnect being triggered randomly. The use of this function
+ is encouraged when you're testing individual profiles in isolation
+
+ Args:
+ log: log object
+ car_droid: Car droid
+ ph_droid: Phone droid
+
+ Returns:
+ True if success, False if fail.
+ """
+ # TODO investigate MCE
+ car_profiles = [BluetoothProfile.A2DP_SINK,
+ BluetoothProfile.HEADSET_CLIENT,
+ BluetoothProfile.PBAP_CLIENT, BluetoothProfile.MAP_MCE]
+ bt_test_utils.set_profile_priority(car_droid, ph_droid, car_profiles,
+ BluetoothPriorityLevel.PRIORITY_OFF)