• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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  * An App Helper interface for the Quick Settings bar.
21  *
22  * @deprecated use {@link android.system.helpers.QuickSettingsHelper} instead.
23  */
24 @Deprecated
25 public interface IQuickSettingsHelper extends IAppHelper {
26     /**
27      * Represents the state of a Quick Setting. Currently this is limited to ON and OFF states;
28      * however, other states will be added in the future, for example to differentiate between
29      * paired and un-paired, active bluetooth states.
30      *
31      * @deprecated use {@link android.system.helpers.QuickSettingsHelper} instead.
32      */
33     @Deprecated
34     public enum State {
35         ON,
36         OFF,
37         UNAVAILABLE,
38     }
39 
40     /**
41      * Represents a Quick Setting switch that can be toggled ON and OFF during a test.
42      *
43      * @deprecated use {@link android.system.helpers.QuickSettingsHelper} instead.
44      */
45     @Deprecated
46     public enum Setting {
47         AIRPLANE("Airplane", "airplane", 2000),
48         AUTO_ROTATE("Auto-rotate", "rotation", 2000),
49         BLUETOOTH("Bluetooth", "bt", 15000),
50         DO_NOT_DISTURB("Do Not Disturb", "dnd", 2000),
51         FLASHLIGHT("Flashlight", "flashlight", 5000),
52         NIGHT_LIGHT("Night Light", "night", 2000);
53 
54         private final String mContentDescSubstring;
55         private final String mTileName;
56         private final long mExpectedWait;
57 
Setting(String substring, String tileName, long wait)58         Setting(String substring, String tileName, long wait) {
59             mContentDescSubstring = substring;
60             mTileName = tileName;
61             mExpectedWait = wait;
62         }
63 
64         /** Returns a substring to identify the {@code Setting} by content description. */
getContentDescSubstring()65         public String getContentDescSubstring() {
66             return mContentDescSubstring;
67         }
68 
69         /** Returns a substring to identify the {@code Setting} by content description. */
getTileName()70         public String getTileName() {
71             return mTileName;
72         }
73 
74         /** Returns the longest expected wait time for this option to be toggled ON or OFF. */
getExpectedWait()75         public long getExpectedWait() {
76             return mExpectedWait;
77         }
78     }
79 
80     /**
81      * Toggles a {@link Setting} either {@link State.ON} or {@link State.OFF}. If {@code setting} is
82      * already found to be in {@code state}, then no operation is performed. There are no setup
83      * requirements to call this method, except that {@code setting} is available from the test and
84      * in the Quick Settings menu.
85      *
86      * @param setting The setting defined in enum {@link Setting}
87      * @param tileName The name of tile spec which recognized by quick settings host
88      * @param state The state of specific setting
89      * @deprecated use {@link android.system.helpers.QuickSettingsHelper} instead.
90      */
91     @Deprecated
toggleSetting(Setting setting, String tileName, State state)92     public void toggleSetting(Setting setting, String tileName, State state);
93 }
94