1#!/usr/bin/env python3.4 2# 3# Copyright 2016 - Google 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17# Defines utilities that can be used for making calls indenpendent of 18# subscription IDs. This can be useful when making calls over mediums not SIM 19# based. 20 21# Make a phone call to the specified URI. It is assumed that we are making the 22# call to the user selected default account. 23# 24# We usually want to make sure that the call has ended up in a good state. 25# 26# NOTE: This util is applicable to only non-conference type calls. It is best 27# suited to test cases where only one call is in action at any point of time. 28 29import queue 30import time 31 32from acts import logger 33from acts.test_utils.bt import bt_test_utils 34from acts.test_utils.bt.BtEnum import * 35 36 37def set_car_profile_priorities_off(car_droid, ph_droid): 38 """Sets priority of car related profiles to OFF. This avoids 39 autoconnect being triggered randomly. The use of this function 40 is encouraged when you're testing individual profiles in isolation 41 42 Args: 43 log: log object 44 car_droid: Car droid 45 ph_droid: Phone droid 46 47 Returns: 48 True if success, False if fail. 49 """ 50 # TODO investigate MCE 51 car_profiles = [BluetoothProfile.A2DP_SINK, 52 BluetoothProfile.HEADSET_CLIENT, 53 BluetoothProfile.PBAP_CLIENT, BluetoothProfile.MAP_MCE] 54 bt_test_utils.set_profile_priority(car_droid, ph_droid, car_profiles, 55 BluetoothPriorityLevel.PRIORITY_OFF) 56