Mark De Ruyter | 1a7ae57 | 2018-03-02 15:35:36 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Sanket Agarwal | c96b9cc | 2016-08-18 12:01:04 -0700 | [diff] [blame] | 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 | |
| 29 | import queue |
| 30 | import time |
| 31 | |
| 32 | from acts import logger |
Xianyuan Jia | 63751fb | 2020-11-17 00:07:40 +0000 | [diff] [blame^] | 33 | from acts_contrib.test_utils.bt import bt_test_utils |
| 34 | from acts_contrib.test_utils.bt.BtEnum import * |
Sanket Agarwal | c96b9cc | 2016-08-18 12:01:04 -0700 | [diff] [blame] | 35 | |
tturney | e3934a2 | 2016-10-20 15:47:34 -0700 | [diff] [blame] | 36 | |
Sanket Agarwal | c96b9cc | 2016-08-18 12:01:04 -0700 | [diff] [blame] | 37 | def 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 | """ |
tturney | e3934a2 | 2016-10-20 15:47:34 -0700 | [diff] [blame] | 50 | # TODO investigate MCE |
| 51 | car_profiles = [BluetoothProfile.A2DP_SINK, |
| 52 | BluetoothProfile.HEADSET_CLIENT, |
| 53 | BluetoothProfile.PBAP_CLIENT, BluetoothProfile.MAP_MCE] |
Sanket Agarwal | c96b9cc | 2016-08-18 12:01:04 -0700 | [diff] [blame] | 54 | bt_test_utils.set_profile_priority(car_droid, ph_droid, car_profiles, |
| 55 | BluetoothPriorityLevel.PRIORITY_OFF) |