• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.platform.helpers;
18 
19 /**
20  * Helper class for functional tests that use the Bluetooth settings page (and device-specific
21  * connection pages reached from the Bluetooth settings page)
22  */
23 public interface IAutoBluetoothSettingsHelper extends IAppHelper, Scrollable {
24 
25     /**
26      * Setup Expectations: The bluetooth settings view is open, and at least one device is listed
27      * under "Paired devices"
28      *
29      * @return - Whether the audio preference button is currently checked
30      */
isMediaPreferenceChecked()31     boolean isMediaPreferenceChecked();
32 
33     /**
34      * Setup Expectations: The bluetooth settings view is open, and at least one device is listed
35      * under "Paired devices"
36      *
37      * @return - Whether the bluetooth preference button is currently checked
38      */
isBluetoothPreferenceChecked()39     boolean isBluetoothPreferenceChecked();
40 
41     /**
42      * Setup Expectations: The bluetooth settings view is open, and at least one device is listed
43      * under "Paired devices"
44      *
45      * @return - Whether the phone preference button is currently checked
46      */
isPhonePreferenceChecked()47     boolean isPhonePreferenceChecked();
48 
49     /**
50      * Setup Expectations: The bluetooth settings view is open
51      *
52      * @return - Whether the use bluetooth toggle is currently checked
53      */
isUseBluetoothToggleChecked()54     boolean isUseBluetoothToggleChecked();
55 
56     /**
57      * Setup Expectations: The bluetooth settings view is open, and at least one device is listed
58      * under "Paired devices"
59      *
60      * @return - Whether the audio preference button is currently checked
61      */
isMediaPreferenceEnabled()62     boolean isMediaPreferenceEnabled();
63 
64     /**
65      * Setup Expectations: The bluetooth settings view is open, and at least one device is listed
66      * under "Paired devices"
67      *
68      * @return - Whether the phone preference button is currently checked
69      */
isPhonePreferenceEnabled()70     boolean isPhonePreferenceEnabled();
71 
72     /**
73      * Setup Expectations: The bluetooth settings view is open, and the looked-for device is present
74      * under "paired devices"
75      *
76      * @param deviceName - The name of the connected device to disconnect
77      */
pressBluetoothToggleOnDevice(String deviceName)78     void pressBluetoothToggleOnDevice(String deviceName);
79 
80     /**
81      * Setup Expectations: The bluetooth settings view is open, and the looked-for device is present
82      * under "paired devices"
83      *
84      * @param deviceName - The name of the connected device to disconnect
85      */
pressMediaToggleOnDevice(String deviceName)86     void pressMediaToggleOnDevice(String deviceName);
87 
88     /**
89      * Setup Expectations: The bluetooth settings view is open, and the looked-for device is present
90      * under "paired devices"
91      *
92      * @param deviceName - The name of the connected device whose phone connection should be
93      *     disabled
94      */
pressPhoneToggleOnDevice(String deviceName)95     void pressPhoneToggleOnDevice(String deviceName);
96 
97     /**
98      * Opens the device bluetooth view by clicking the device name.
99      *
100      * <p>Setup Expectations: The bluetooth settings view is open. and the looked-for device is
101      * present under "paired devices"
102      *
103      * @param deviceName - The name of the connected device to disconnect
104      */
pressDevice(String deviceName)105     void pressDevice(String deviceName);
106 
107     /**
108      * Waits until device connection status is changed
109      *
110      * <p>Setup Expectations: The bluetooth settings view is open.
111      *
112      * @param status - expected statuts to be displayed
113      */
waitUntilConnectionStatus(String status)114     void waitUntilConnectionStatus(String status);
115 
116     /**
117      * Setup Expectations: A connected device bluetooth view is open ('level two')
118      *
119      * @return - The exact text displayed as the device's connection status
120      */
getDeviceSummary()121     String getDeviceSummary();
122 
123     /**
124      * Setup Expectations: A connected device bluetooth view is open ('level two')
125      *
126      * @return - Whether the device shows that it is connected.
127      */
isConnected()128     boolean isConnected();
129 
130     /**
131      * Presses the 'forget' button.
132      *
133      * <p>Setup Expectations: A connected device bluetooth view is open ('level two') and the
134      * 'Forget' button is visible.
135      */
pressForget()136     void pressForget();
137 
138     /**
139      * Presses the 'Connect' or 'Disconnect' toggle button
140      *
141      * <p>Setup Expectations: A connected device bluetooth view is open ('level two')
142      */
pressConnectionToggle()143     void pressConnectionToggle();
144 
145     /**
146      * Presses the back button to return from a device's connection page to the Bluetooth settings
147      * page
148      *
149      * <p>Setup Expectations: A connected device bluetooth view is open ('level two')
150      */
goBackToBluetoothSettings()151     void goBackToBluetoothSettings();
152 
153     /**
154      * Setup Expectations: A connected device bluetooth summary page is open ('level two')
155      *
156      * @return - Whether the phone profile is enabled
157      */
isPhoneProfileEnabled()158     boolean isPhoneProfileEnabled();
159 }
160