blob: 5891a7f705c8b3d8686d72766d0f112a020ce339 [file] [log] [blame]
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -05001/*
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
17package com.android.systemui.controls
18
Matt Pietal53a8bbd2020-03-05 16:10:34 -050019import android.content.ComponentName
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -050020import android.service.controls.Control
Fabian Kozynski8765d352020-04-06 21:16:02 -040021import android.service.controls.DeviceTypes
22
23interface ControlInterface {
24 val favorite: Boolean
25 val component: ComponentName
26 val controlId: String
27 val title: CharSequence
28 val subtitle: CharSequence
29 val removed: Boolean
30 get() = false
31 @DeviceTypes.DeviceType val deviceType: Int
32}
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -050033
Fabian Kozynski7988bd42020-01-30 12:21:52 -050034data class ControlStatus(
35 val control: Control,
Fabian Kozynski8765d352020-04-06 21:16:02 -040036 override val component: ComponentName,
37 override var favorite: Boolean,
38 override val removed: Boolean = false
39) : ControlInterface {
40 override val controlId: String
41 get() = control.controlId
42
43 override val title: CharSequence
44 get() = control.title
45
46 override val subtitle: CharSequence
47 get() = control.subtitle
48
49 @DeviceTypes.DeviceType override val deviceType: Int
50 get() = control.deviceType
51}