• 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 the looked-for device is present
27      * under "paired devices"
28      *
29      * @param deviceName - The name of the connected device to disconnect
30      */
pressBluetoothToggleOnDevice(String deviceName)31     void pressBluetoothToggleOnDevice(String deviceName);
32 
33     /**
34      * Opens the device bluetooth view by clicking the device name.
35      *
36      * <p>Setup Expectations: The bluetooth settings view is open. and the looked-for device is
37      * present under "paired devices"
38      *
39      * @param deviceName - The name of the connected device to disconnect
40      */
pressDevice(String deviceName)41     void pressDevice(String deviceName);
42 
43     /**
44      * Setup Expectations: A connected device bluetooth view is open ('level two')
45      *
46      * @return - The exact text displayed as the device's connection status
47      */
getDeviceSummary()48     String getDeviceSummary();
49 
50     /**
51      * Setup Expectations: A connected device bluetooth view is open ('level two')
52      *
53      * @return - Whether the device shows that it is connected.
54      */
isConnected()55     boolean isConnected();
56 
57     /**
58      * Presses the 'forget' button.
59      *
60      * <p>Setup Expectations: A connected device bluetooth view is open ('level two') and the
61      * 'Forget' button is visible.
62      */
pressForget()63     void pressForget();
64 
65     /**
66      * Presses the 'Connect' or 'Disconnect' toggle button
67      *
68      * <p>Setup Expectations: A connected device bluetooth view is open ('level two')
69      */
pressConnectionToggle()70     void pressConnectionToggle();
71 
72     /**
73      * Presses the back button to return from a device's connection page to the Bluetooth settings
74      * page
75      *
76      * <p>Setup Expectations: A connected device bluetooth view is open ('level two')
77      */
goBackToBluetoothSettings()78     void goBackToBluetoothSettings();
79 }
80