blob: f0356d038065fd45d643f1b9a5fb5aee79350adb [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
Matt Pietala2e20852020-06-22 09:36:48 -040020import android.graphics.drawable.Icon
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -050021import android.service.controls.Control
Fabian Kozynski8765d352020-04-06 21:16:02 -040022import android.service.controls.DeviceTypes
23
24interface ControlInterface {
25 val favorite: Boolean
26 val component: ComponentName
27 val controlId: String
28 val title: CharSequence
29 val subtitle: CharSequence
30 val removed: Boolean
31 get() = false
Matt Pietala2e20852020-06-22 09:36:48 -040032 val customIcon: Icon?
Fabian Kozynski8765d352020-04-06 21:16:02 -040033 @DeviceTypes.DeviceType val deviceType: Int
34}
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -050035
Fabian Kozynski7988bd42020-01-30 12:21:52 -050036data class ControlStatus(
37 val control: Control,
Fabian Kozynski8765d352020-04-06 21:16:02 -040038 override val component: ComponentName,
39 override var favorite: Boolean,
40 override val removed: Boolean = false
41) : ControlInterface {
42 override val controlId: String
43 get() = control.controlId
44
45 override val title: CharSequence
46 get() = control.title
47
48 override val subtitle: CharSequence
49 get() = control.subtitle
50
Matt Pietala2e20852020-06-22 09:36:48 -040051 override val customIcon: Icon?
52 get() = control.customIcon
53
Fabian Kozynski8765d352020-04-06 21:16:02 -040054 @DeviceTypes.DeviceType override val deviceType: Int
55 get() = control.deviceType
56}