Carkit test refactors

Created a base test class for common code
regarding HFP tests.
* Test class calls BluetoothBaseTest setup
functions where necessary.
* Sets phone attributes based off a sim config
file to accomodate all types of carriers. This
also makes it easier to use regularly tested
tel_test_utils.
* Pre-pairs the phone and carkit.
* Sets up hf, ag, re, and re2 depending on
how many andorid devices are connected.
* Establishes common setup, teardown, and
onfail routines.

Fix BluetoothProfile.PBAP enum to be named
appropriately to PBAP_SERVER.

Fixed logging in bt_contact_utils to use
the built in logging.

Used built in adb functions for android devices
instead of command line python executions in
bt_contacts_utils.

Added BluetoothProfile.Map_MCE to be blocked when
setting car profile priorities for more stable
test results.

Fixed infinite while loop in car_telecom_utils.

Fixed SL4A api change of telecomGetGalls to
telecomCallGetCallIds in car_telecom_utils.

Removed un-needed cmdr function from utils.py.

Since connetion broadcasts are flacky, added
profile connected devices checks after
connection broadcast checks in order to stabalize
tests.

Added needed timeouts throught HFP tests in order
for the stack to update to avoid test race conditions.
Not all carriers update the stack fast enough in areas
like waiting for a ringing call or accepting calls.

Used tel_test_util fincutions instead of telecom
utils where it was applicable.

Made tests more readible by changing var names.

Added bt_test_wrap to all code for logging consistency.

Added media path check. BtCarMediaPassthroughTest now
requires "local_media_path" added to the config file
that corresponds to the path of where the music dir
is where you want to push code.

Added mandatory "sim_conf_file" to HFP related tests
since not all carriers will update phone numbers that
Java apis expect.

Removed passing the logger to connect_pri_to_sec and
disconnect_pri_to_sec to be consistent with the
rest of bt_test_utils.

Ran YAPF on all code so it is formatted cosistently.

Test: Running automation against all tests modified
Change-Id: I8fe44d033980cff70bbd7aa4250c6a40be7c9418
diff --git a/acts/tests/google/bt/car_bt/BtCarBasicFunctionalityTest.py b/acts/tests/google/bt/car_bt/BtCarBasicFunctionalityTest.py
index 6aaed89..5eff405 100644
--- a/acts/tests/google/bt/car_bt/BtCarBasicFunctionalityTest.py
+++ b/acts/tests/google/bt/car_bt/BtCarBasicFunctionalityTest.py
@@ -13,7 +13,6 @@
 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 # License for the specific language governing permissions and limitations under
 # the License.
-
 """
 Test script to execute Bluetooth basic functionality test cases relevant to car.
 """
@@ -30,7 +29,6 @@
 from acts.test_utils.bt.bt_test_utils import set_bt_scan_mode
 from acts.test_utils.bt.bt_test_utils import setup_multiple_devices_for_bt_test
 from acts.test_utils.bt.bt_test_utils import take_btsnoop_logs
-from acts.test_utils.bt.bt_test_utils import take_bugreport_logs
 
 
 class BtCarBasicFunctionalityTest(BluetoothBaseTest):
@@ -39,26 +37,11 @@
 
     def __init__(self, controllers):
         BluetoothBaseTest.__init__(self, controllers)
-        self.droid_ad = self.android_devices[0]
+        self.car_ad = self.android_devices[0]
 
     def setup_class(self):
         return setup_multiple_devices_for_bt_test(self.android_devices)
 
-    def setup_test(self):
-        self.log.debug(log_energy_info(self.android_devices, "Start"))
-        for a in self.android_devices:
-            a.ed.clear_all_events()
-        return True
-
-    def teardown_test(self):
-        self.log.debug(log_energy_info(self.android_devices, "End"))
-        return True
-
-    def on_fail(self, test_name, begin_time):
-        take_btsnoop_logs(self.android_devices, self, test_name, begin_time)
-        take_bugreport_logs(self.android_devices, self, test_name, begin_time)
-        reset_bluetooth(self.android_devices)
-
     #@BluetoothTest(UUID=b52a032a-3438-4b84-863f-c46a969882a4)
     @BluetoothBaseTest.bt_test_wrap
     def test_if_support_a2dp_sink_profile(self):
@@ -69,7 +52,7 @@
         3. Check the value of key 'a2dp_sink'
         :return: test_result: bool
         """
-        profiles = check_device_supported_profiles(self.droid_ad.droid)
+        profiles = check_device_supported_profiles(self.car_ad.droid)
         if not profiles['a2dp_sink']:
             self.log.debug("Android device do not support A2DP SNK profile.")
             return False
@@ -85,7 +68,7 @@
         3. Check the value of key 'hfp_client'
         :return: test_result: bool
         """
-        profiles = check_device_supported_profiles(self.droid_ad.droid)
+        profiles = check_device_supported_profiles(self.car_ad.droid)
         if not profiles['hfp_client']:
             self.log.debug("Android device do not support HFP Client profile.")
             return False
@@ -101,8 +84,9 @@
         3. Check the value of key 'pbap_client'
         :return: test_result: bool
         """
-        profiles = check_device_supported_profiles(self.droid_ad.droid)
+        profiles = check_device_supported_profiles(self.car_ad.droid)
         if not profiles['pbap_client']:
-            self.log.debug("Android device do not support PBAP Client profile.")
+            self.log.debug(
+                "Android device do not support PBAP Client profile.")
             return False
         return True