blob: a4285289ffc4ae747907f386d8c6707e31a654c1 [file] [log] [blame]
Mark De Ruyter1a7ae572018-03-02 15:35:36 -08001#!/usr/bin/env python3
Sanket Agarwalc96b9cc2016-08-18 12:01:04 -07002#
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
Xianyuan Jia63751fb2020-11-17 00:07:40 +000033from acts_contrib.test_utils.bt import bt_test_utils
34from acts_contrib.test_utils.bt.BtEnum import *
Sanket Agarwalc96b9cc2016-08-18 12:01:04 -070035
tturneye3934a22016-10-20 15:47:34 -070036
Sanket Agarwalc96b9cc2016-08-18 12:01:04 -070037def 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 """
tturneye3934a22016-10-20 15:47:34 -070050 # TODO investigate MCE
51 car_profiles = [BluetoothProfile.A2DP_SINK,
52 BluetoothProfile.HEADSET_CLIENT,
53 BluetoothProfile.PBAP_CLIENT, BluetoothProfile.MAP_MCE]
Sanket Agarwalc96b9cc2016-08-18 12:01:04 -070054 bt_test_utils.set_profile_priority(car_droid, ph_droid, car_profiles,
55 BluetoothPriorityLevel.PRIORITY_OFF)