Fabian Kozynski | f10b6ab | 2019-12-27 09:31:04 -0500 | [diff] [blame] | 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 |
| 18 | |
Matt Pietal | 53a8bbd | 2020-03-05 16:10:34 -0500 | [diff] [blame] | 19 | import android.content.ComponentName |
Fabian Kozynski | f10b6ab | 2019-12-27 09:31:04 -0500 | [diff] [blame] | 20 | import android.service.controls.Control |
Fabian Kozynski | 8765d35 | 2020-04-06 21:16:02 -0400 | [diff] [blame] | 21 | import android.service.controls.DeviceTypes |
| 22 | |
| 23 | interface 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 Kozynski | f10b6ab | 2019-12-27 09:31:04 -0500 | [diff] [blame] | 33 | |
Fabian Kozynski | 7988bd4 | 2020-01-30 12:21:52 -0500 | [diff] [blame] | 34 | data class ControlStatus( |
| 35 | val control: Control, |
Fabian Kozynski | 8765d35 | 2020-04-06 21:16:02 -0400 | [diff] [blame] | 36 | 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 | } |