1 /*
2  * Copyright (C) 2020 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 com.android.systemui.controls.ui
18 
19 import android.content.ComponentName
20 import android.service.controls.Control
21 import android.service.controls.actions.ControlAction
22 import android.view.ViewGroup
23 
24 interface ControlsUiController {
25     val available: Boolean
26 
27     companion object {
28         public const val TAG = "ControlsUiController"
29         public const val EXTRA_ANIMATE = "extra_animate"
30     }
31 
shownull32     fun show(parent: ViewGroup, dismissGlobalActions: Runnable)
33     fun hide()
34 
35     /**
36      * Request all open dialogs be closed. Set [immediately] to true to dismiss without
37      * animations.
38      */
39     fun closeDialogs(immediately: Boolean)
40 
41     fun onRefreshState(componentName: ComponentName, controls: List<Control>)
42     fun onActionResponse(
43         componentName: ComponentName,
44         controlId: String,
45         @ControlAction.ResponseResult response: Int
46     )
47 }
48