Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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.server.hdmi; |
| 18 | |
Amy | 743f866 | 2018-06-25 11:51:12 -0700 | [diff] [blame] | 19 | import android.annotation.IntDef; |
Amy | dbed4e5 | 2018-11-28 17:22:20 -0800 | [diff] [blame] | 20 | import android.annotation.StringDef; |
Jungshik Jang | 61f4fbd | 2014-08-06 19:21:12 +0900 | [diff] [blame] | 21 | import android.hardware.hdmi.HdmiDeviceInfo; |
Shubang Lu | 00b976a | 2018-08-01 18:11:46 -0700 | [diff] [blame] | 22 | |
Nick Chalko | 5ce97f8 | 2018-07-20 13:48:21 -0700 | [diff] [blame] | 23 | import java.lang.annotation.Retention; |
| 24 | import java.lang.annotation.RetentionPolicy; |
Jinsuk Kim | 29a5d26 | 2014-07-21 17:25:32 +0900 | [diff] [blame] | 25 | |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 26 | /** |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 27 | * Defines constants related to HDMI-CEC protocol internal implementation. If a constant will be |
| 28 | * used in the public api, it should be located in {@link android.hardware.hdmi.HdmiControlManager}. |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 29 | */ |
| 30 | final class Constants { |
| 31 | |
| 32 | /** Logical address for TV */ |
| 33 | public static final int ADDR_TV = 0; |
| 34 | |
| 35 | /** Logical address for recorder 1 */ |
| 36 | public static final int ADDR_RECORDER_1 = 1; |
| 37 | |
| 38 | /** Logical address for recorder 2 */ |
| 39 | public static final int ADDR_RECORDER_2 = 2; |
| 40 | |
| 41 | /** Logical address for tuner 1 */ |
| 42 | public static final int ADDR_TUNER_1 = 3; |
| 43 | |
| 44 | /** Logical address for playback 1 */ |
| 45 | public static final int ADDR_PLAYBACK_1 = 4; |
| 46 | |
| 47 | /** Logical address for audio system */ |
| 48 | public static final int ADDR_AUDIO_SYSTEM = 5; |
| 49 | |
| 50 | /** Logical address for tuner 2 */ |
| 51 | public static final int ADDR_TUNER_2 = 6; |
| 52 | |
| 53 | /** Logical address for tuner 3 */ |
| 54 | public static final int ADDR_TUNER_3 = 7; |
| 55 | |
| 56 | /** Logical address for playback 2 */ |
| 57 | public static final int ADDR_PLAYBACK_2 = 8; |
| 58 | |
| 59 | /** Logical address for recorder 3 */ |
| 60 | public static final int ADDR_RECORDER_3 = 9; |
| 61 | |
| 62 | /** Logical address for tuner 4 */ |
| 63 | public static final int ADDR_TUNER_4 = 10; |
| 64 | |
| 65 | /** Logical address for playback 3 */ |
| 66 | public static final int ADDR_PLAYBACK_3 = 11; |
| 67 | |
| 68 | /** Logical address reserved for future usage */ |
| 69 | public static final int ADDR_RESERVED_1 = 12; |
| 70 | |
| 71 | /** Logical address reserved for future usage */ |
| 72 | public static final int ADDR_RESERVED_2 = 13; |
| 73 | |
| 74 | /** Logical address for TV other than the one assigned with {@link #ADDR_TV} */ |
| 75 | public static final int ADDR_SPECIFIC_USE = 14; |
| 76 | |
| 77 | /** Logical address for devices to which address cannot be allocated */ |
| 78 | public static final int ADDR_UNREGISTERED = 15; |
| 79 | |
| 80 | /** Logical address used in the destination address field for broadcast messages */ |
| 81 | public static final int ADDR_BROADCAST = 15; |
| 82 | |
| 83 | /** Logical address used to indicate it is not initialized or invalid. */ |
| 84 | public static final int ADDR_INVALID = -1; |
| 85 | |
| 86 | /** Logical address used to indicate the source comes from internal device. */ |
Jungshik Jang | 61f4fbd | 2014-08-06 19:21:12 +0900 | [diff] [blame] | 87 | public static final int ADDR_INTERNAL = HdmiDeviceInfo.ADDR_INTERNAL; |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 88 | |
| 89 | static final int MESSAGE_FEATURE_ABORT = 0x00; |
| 90 | static final int MESSAGE_IMAGE_VIEW_ON = 0x04; |
| 91 | static final int MESSAGE_TUNER_STEP_INCREMENT = 0x05; |
| 92 | static final int MESSAGE_TUNER_STEP_DECREMENT = 0x06; |
| 93 | static final int MESSAGE_TUNER_DEVICE_STATUS = 0x07; |
| 94 | static final int MESSAGE_GIVE_TUNER_DEVICE_STATUS = 0x08; |
| 95 | static final int MESSAGE_RECORD_ON = 0x09; |
| 96 | static final int MESSAGE_RECORD_STATUS = 0x0A; |
| 97 | static final int MESSAGE_RECORD_OFF = 0x0B; |
| 98 | static final int MESSAGE_TEXT_VIEW_ON = 0x0D; |
| 99 | static final int MESSAGE_RECORD_TV_SCREEN = 0x0F; |
| 100 | static final int MESSAGE_GIVE_DECK_STATUS = 0x1A; |
| 101 | static final int MESSAGE_DECK_STATUS = 0x1B; |
| 102 | static final int MESSAGE_SET_MENU_LANGUAGE = 0x32; |
| 103 | static final int MESSAGE_CLEAR_ANALOG_TIMER = 0x33; |
| 104 | static final int MESSAGE_SET_ANALOG_TIMER = 0x34; |
| 105 | static final int MESSAGE_TIMER_STATUS = 0x35; |
| 106 | static final int MESSAGE_STANDBY = 0x36; |
| 107 | static final int MESSAGE_PLAY = 0x41; |
| 108 | static final int MESSAGE_DECK_CONTROL = 0x42; |
| 109 | static final int MESSAGE_TIMER_CLEARED_STATUS = 0x043; |
| 110 | static final int MESSAGE_USER_CONTROL_PRESSED = 0x44; |
| 111 | static final int MESSAGE_USER_CONTROL_RELEASED = 0x45; |
| 112 | static final int MESSAGE_GIVE_OSD_NAME = 0x46; |
| 113 | static final int MESSAGE_SET_OSD_NAME = 0x47; |
| 114 | static final int MESSAGE_SET_OSD_STRING = 0x64; |
| 115 | static final int MESSAGE_SET_TIMER_PROGRAM_TITLE = 0x67; |
| 116 | static final int MESSAGE_SYSTEM_AUDIO_MODE_REQUEST = 0x70; |
| 117 | static final int MESSAGE_GIVE_AUDIO_STATUS = 0x71; |
| 118 | static final int MESSAGE_SET_SYSTEM_AUDIO_MODE = 0x72; |
| 119 | static final int MESSAGE_REPORT_AUDIO_STATUS = 0x7A; |
| 120 | static final int MESSAGE_GIVE_SYSTEM_AUDIO_MODE_STATUS = 0x7D; |
| 121 | static final int MESSAGE_SYSTEM_AUDIO_MODE_STATUS = 0x7E; |
| 122 | static final int MESSAGE_ROUTING_CHANGE = 0x80; |
| 123 | static final int MESSAGE_ROUTING_INFORMATION = 0x81; |
| 124 | static final int MESSAGE_ACTIVE_SOURCE = 0x82; |
| 125 | static final int MESSAGE_GIVE_PHYSICAL_ADDRESS = 0x83; |
| 126 | static final int MESSAGE_REPORT_PHYSICAL_ADDRESS = 0x84; |
| 127 | static final int MESSAGE_REQUEST_ACTIVE_SOURCE = 0x85; |
| 128 | static final int MESSAGE_SET_STREAM_PATH = 0x86; |
| 129 | static final int MESSAGE_DEVICE_VENDOR_ID = 0x87; |
| 130 | static final int MESSAGE_VENDOR_COMMAND = 0x89; |
| 131 | static final int MESSAGE_VENDOR_REMOTE_BUTTON_DOWN = 0x8A; |
| 132 | static final int MESSAGE_VENDOR_REMOTE_BUTTON_UP = 0x8B; |
| 133 | static final int MESSAGE_GIVE_DEVICE_VENDOR_ID = 0x8C; |
| 134 | static final int MESSAGE_MENU_REQUEST = 0x8D; |
| 135 | static final int MESSAGE_MENU_STATUS = 0x8E; |
| 136 | static final int MESSAGE_GIVE_DEVICE_POWER_STATUS = 0x8F; |
| 137 | static final int MESSAGE_REPORT_POWER_STATUS = 0x90; |
| 138 | static final int MESSAGE_GET_MENU_LANGUAGE = 0x91; |
| 139 | static final int MESSAGE_SELECT_ANALOG_SERVICE = 0x92; |
| 140 | static final int MESSAGE_SELECT_DIGITAL_SERVICE = 0x93; |
| 141 | static final int MESSAGE_SET_DIGITAL_TIMER = 0x97; |
| 142 | static final int MESSAGE_CLEAR_DIGITAL_TIMER = 0x99; |
| 143 | static final int MESSAGE_SET_AUDIO_RATE = 0x9A; |
| 144 | static final int MESSAGE_INACTIVE_SOURCE = 0x9D; |
| 145 | static final int MESSAGE_CEC_VERSION = 0x9E; |
| 146 | static final int MESSAGE_GET_CEC_VERSION = 0x9F; |
| 147 | static final int MESSAGE_VENDOR_COMMAND_WITH_ID = 0xA0; |
| 148 | static final int MESSAGE_CLEAR_EXTERNAL_TIMER = 0xA1; |
| 149 | static final int MESSAGE_SET_EXTERNAL_TIMER = 0xA2; |
Yuncheol Heo | 75a77e7 | 2014-07-09 18:27:53 +0900 | [diff] [blame] | 150 | static final int MESSAGE_REPORT_SHORT_AUDIO_DESCRIPTOR = 0xA3; |
| 151 | static final int MESSAGE_REQUEST_SHORT_AUDIO_DESCRIPTOR = 0xA4; |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 152 | static final int MESSAGE_INITIATE_ARC = 0xC0; |
| 153 | static final int MESSAGE_REPORT_ARC_INITIATED = 0xC1; |
| 154 | static final int MESSAGE_REPORT_ARC_TERMINATED = 0xC2; |
| 155 | static final int MESSAGE_REQUEST_ARC_INITIATION = 0xC3; |
| 156 | static final int MESSAGE_REQUEST_ARC_TERMINATION = 0xC4; |
| 157 | static final int MESSAGE_TERMINATE_ARC = 0xC5; |
Yuncheol Heo | 75a77e7 | 2014-07-09 18:27:53 +0900 | [diff] [blame] | 158 | static final int MESSAGE_CDC_MESSAGE = 0xF8; |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 159 | static final int MESSAGE_ABORT = 0xFF; |
| 160 | |
| 161 | static final int UNKNOWN_VENDOR_ID = 0xFFFFFF; |
| 162 | |
Jinsuk Kim | 7ecfbae | 2014-07-11 14:16:29 +0900 | [diff] [blame] | 163 | static final int TRUE = 1; |
| 164 | static final int FALSE = 0; |
| 165 | |
Jungshik Jang | 4480efa | 2014-09-04 17:08:34 +0900 | [diff] [blame] | 166 | // Internal abort error code. It's the same as success. |
| 167 | static final int ABORT_NO_ERROR = -1; |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 168 | // Constants related to operands of HDMI CEC commands. |
| 169 | // Refer to CEC Table 29 in HDMI Spec v1.4b. |
| 170 | // [Abort Reason] |
Yuncheol Heo | 25c2029 | 2014-07-31 17:59:39 +0900 | [diff] [blame] | 171 | static final int ABORT_UNRECOGNIZED_OPCODE = 0; |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 172 | static final int ABORT_NOT_IN_CORRECT_MODE = 1; |
| 173 | static final int ABORT_CANNOT_PROVIDE_SOURCE = 2; |
| 174 | static final int ABORT_INVALID_OPERAND = 3; |
| 175 | static final int ABORT_REFUSED = 4; |
| 176 | static final int ABORT_UNABLE_TO_DETERMINE = 5; |
| 177 | |
| 178 | // [Audio Status] |
| 179 | static final int SYSTEM_AUDIO_STATUS_OFF = 0; |
| 180 | static final int SYSTEM_AUDIO_STATUS_ON = 1; |
| 181 | |
Terry Heo | 3e1564e | 2014-08-12 14:41:00 +0900 | [diff] [blame] | 182 | // [Menu State] |
| 183 | static final int MENU_STATE_ACTIVATED = 0; |
| 184 | static final int MENU_STATE_DEACTIVATED = 1; |
| 185 | |
Nick Chalko | 5ce97f8 | 2018-07-20 13:48:21 -0700 | [diff] [blame] | 186 | // Audio Format Codes |
| 187 | // Refer to CEA Standard (CEA-861-D), Table 37 Audio Format Codes. |
| 188 | @Retention(RetentionPolicy.SOURCE) |
| 189 | @IntDef({ |
| 190 | AUDIO_CODEC_NONE, |
| 191 | AUDIO_CODEC_LPCM, |
| 192 | AUDIO_CODEC_DD, |
| 193 | AUDIO_CODEC_MPEG1, |
| 194 | AUDIO_CODEC_MP3, |
| 195 | AUDIO_CODEC_MPEG2, |
| 196 | AUDIO_CODEC_AAC, |
| 197 | AUDIO_CODEC_DTS, |
| 198 | AUDIO_CODEC_ATRAC, |
| 199 | AUDIO_CODEC_ONEBITAUDIO, |
| 200 | AUDIO_CODEC_DDP, |
| 201 | AUDIO_CODEC_DTSHD, |
| 202 | AUDIO_CODEC_TRUEHD, |
| 203 | AUDIO_CODEC_DST, |
| 204 | AUDIO_CODEC_WMAPRO, |
| 205 | AUDIO_CODEC_MAX, |
| 206 | }) |
| 207 | public @interface AudioCodec {} |
| 208 | |
| 209 | static final int AUDIO_CODEC_NONE = 0x0; |
| 210 | static final int AUDIO_CODEC_LPCM = 0x1; // Support LPCMs |
| 211 | static final int AUDIO_CODEC_DD = 0x2; // Support DD |
| 212 | static final int AUDIO_CODEC_MPEG1 = 0x3; // Support MPEG1 |
| 213 | static final int AUDIO_CODEC_MP3 = 0x4; // Support MP3 |
| 214 | static final int AUDIO_CODEC_MPEG2 = 0x5; // Support MPEG2 |
| 215 | static final int AUDIO_CODEC_AAC = 0x6; // Support AAC |
| 216 | static final int AUDIO_CODEC_DTS = 0x7; // Support DTS |
| 217 | static final int AUDIO_CODEC_ATRAC = 0x8; // Support ATRAC |
| 218 | static final int AUDIO_CODEC_ONEBITAUDIO = 0x9; // Support One-Bit Audio |
| 219 | static final int AUDIO_CODEC_DDP = 0xA; // Support DDP |
| 220 | static final int AUDIO_CODEC_DTSHD = 0xB; // Support DTSHD |
| 221 | static final int AUDIO_CODEC_TRUEHD = 0xC; // Support MLP/TRUE-HD |
| 222 | static final int AUDIO_CODEC_DST = 0xD; // Support DST |
| 223 | static final int AUDIO_CODEC_WMAPRO = 0xE; // Support WMA-Pro |
| 224 | static final int AUDIO_CODEC_MAX = 0xF; |
| 225 | |
Amy | dbed4e5 | 2018-11-28 17:22:20 -0800 | [diff] [blame] | 226 | @StringDef({ |
| 227 | AUDIO_DEVICE_ARC_IN, |
| 228 | AUDIO_DEVICE_SPDIF, |
| 229 | }) |
| 230 | public @interface AudioDevice {} |
| 231 | |
| 232 | static final String AUDIO_DEVICE_ARC_IN = "ARC_IN"; |
| 233 | static final String AUDIO_DEVICE_SPDIF = "SPDIF"; |
| 234 | |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 235 | // Bit mask used to get the routing path of the top level device. |
| 236 | // When &'d with the path 1.2.2.0 (0x1220), for instance, gives 1.0.0.0. |
| 237 | static final int ROUTING_PATH_TOP_MASK = 0xF000; |
Yuncheol Heo | 75a77e7 | 2014-07-09 18:27:53 +0900 | [diff] [blame] | 238 | static final int ROUTING_PATH_TOP_SHIFT = 12; |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 239 | |
Jungshik Jang | 61f4fbd | 2014-08-06 19:21:12 +0900 | [diff] [blame] | 240 | static final int INVALID_PORT_ID = HdmiDeviceInfo.PORT_INVALID; |
| 241 | static final int INVALID_PHYSICAL_ADDRESS = HdmiDeviceInfo.PATH_INVALID; |
Jinsuk Kim | e653602 | 2014-12-02 13:40:02 +0900 | [diff] [blame] | 242 | static final int PATH_INTERNAL = HdmiDeviceInfo.PATH_INTERNAL; |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 243 | |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 244 | // Strategy for device polling. |
| 245 | // Should use "OR(|) operation of POLL_STRATEGY_XXX and POLL_ITERATION_XXX. |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 246 | static final int POLL_STRATEGY_MASK = 0x3; // first and second bit. |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 247 | static final int POLL_STRATEGY_REMOTES_DEVICES = 0x1; |
| 248 | static final int POLL_STRATEGY_SYSTEM_AUDIO = 0x2; |
| 249 | |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 250 | static final int POLL_ITERATION_STRATEGY_MASK = 0x30000; // first and second bit. |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 251 | static final int POLL_ITERATION_IN_ORDER = 0x10000; |
| 252 | static final int POLL_ITERATION_REVERSE_ORDER = 0x20000; |
| 253 | |
| 254 | static final int UNKNOWN_VOLUME = -1; |
| 255 | |
Amy | 743f866 | 2018-06-25 11:51:12 -0700 | [diff] [blame] | 256 | // States of property PROPERTY_SYSTEM_AUDIO_CONTROL_ON_POWER_ON |
| 257 | // to decide if turn on the system audio control when power on the device |
| 258 | @IntDef({ |
| 259 | ALWAYS_SYSTEM_AUDIO_CONTROL_ON_POWER_ON, |
| 260 | USE_LAST_STATE_SYSTEM_AUDIO_CONTROL_ON_POWER_ON, |
| 261 | NEVER_SYSTEM_AUDIO_CONTROL_ON_POWER_ON |
| 262 | }) |
| 263 | @interface SystemAudioControlOnPowerOn {} |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 264 | |
Amy | 743f866 | 2018-06-25 11:51:12 -0700 | [diff] [blame] | 265 | static final int ALWAYS_SYSTEM_AUDIO_CONTROL_ON_POWER_ON = 0; |
| 266 | static final int USE_LAST_STATE_SYSTEM_AUDIO_CONTROL_ON_POWER_ON = 1; |
| 267 | static final int NEVER_SYSTEM_AUDIO_CONTROL_ON_POWER_ON = 2; |
| 268 | |
Amy | 225d55a | 2018-09-06 11:03:51 -0700 | [diff] [blame] | 269 | // Port id to record local active port for Routing Control features |
| 270 | // They are used to map to corresponding Inputs |
| 271 | // Current interface is only implemented for specific device. |
| 272 | // Developers can add more port number and map them to corresponding inputs on demand. |
| 273 | @IntDef({ |
| 274 | CEC_SWITCH_HOME, |
| 275 | CEC_SWITCH_HDMI1, |
| 276 | CEC_SWITCH_HDMI2, |
| 277 | CEC_SWITCH_HDMI3, |
| 278 | CEC_SWITCH_HDMI4, |
| 279 | CEC_SWITCH_HDMI5, |
| 280 | CEC_SWITCH_HDMI6, |
| 281 | CEC_SWITCH_HDMI7, |
| 282 | CEC_SWITCH_HDMI8, |
| 283 | CEC_SWITCH_ARC, |
| 284 | CEC_SWITCH_BLUETOOTH, |
| 285 | CEC_SWITCH_OPTICAL, |
| 286 | CEC_SWITCH_AUX |
| 287 | }) |
| 288 | @interface LocalActivePort {} |
| 289 | static final int CEC_SWITCH_HOME = 0; |
| 290 | static final int CEC_SWITCH_HDMI1 = 1; |
| 291 | static final int CEC_SWITCH_HDMI2 = 2; |
| 292 | static final int CEC_SWITCH_HDMI3 = 3; |
| 293 | static final int CEC_SWITCH_HDMI4 = 4; |
| 294 | static final int CEC_SWITCH_HDMI5 = 5; |
| 295 | static final int CEC_SWITCH_HDMI6 = 6; |
| 296 | static final int CEC_SWITCH_HDMI7 = 7; |
| 297 | static final int CEC_SWITCH_HDMI8 = 8; |
| 298 | static final int CEC_SWITCH_ARC = 17; |
| 299 | static final int CEC_SWITCH_BLUETOOTH = 18; |
| 300 | static final int CEC_SWITCH_OPTICAL = 19; |
| 301 | static final int CEC_SWITCH_AUX = 20; |
| 302 | static final int CEC_SWITCH_PORT_MAX = 21; |
| 303 | |
Nick Chalko | b89d6ff | 2018-05-25 10:29:01 -0700 | [diff] [blame] | 304 | static final String PROPERTY_PREFERRED_ADDRESS_AUDIO_SYSTEM = |
| 305 | "persist.sys.hdmi.addr.audiosystem"; |
Yuncheol Heo | 4b5c2d3 | 2014-09-13 11:21:46 +0900 | [diff] [blame] | 306 | static final String PROPERTY_PREFERRED_ADDRESS_PLAYBACK = "persist.sys.hdmi.addr.playback"; |
| 307 | static final String PROPERTY_PREFERRED_ADDRESS_TV = "persist.sys.hdmi.addr.tv"; |
| 308 | |
| 309 | // Property name for the local device configurations. |
| 310 | // TODO(OEM): OEM should provide this property, and the value is the comma separated integer |
| 311 | // values which denotes the device type in HDMI Spec 1.4. |
| 312 | static final String PROPERTY_DEVICE_TYPE = "ro.hdmi.device_type"; |
Jinsuk Kim | af2acf0 | 2014-07-11 18:43:04 +0900 | [diff] [blame] | 313 | |
Jinsuk Kim | 659c486 | 2015-05-07 12:12:55 +0900 | [diff] [blame] | 314 | // TODO(OEM): Set this to false to keep the playback device in sleep upon hotplug event. |
| 315 | // True by default. |
| 316 | static final String PROPERTY_WAKE_ON_HOTPLUG = "ro.hdmi.wake_on_hotplug"; |
| 317 | |
Donghyun Cho | a09256c | 2016-03-11 17:35:37 +0900 | [diff] [blame] | 318 | // TODO(OEM): Set this to true to enable 'Set Menu Language' feature. False by default. |
| 319 | static final String PROPERTY_SET_MENU_LANGUAGE = "ro.hdmi.set_menu_language"; |
| 320 | |
Amy | cce55e0 | 2018-08-20 15:42:25 -0700 | [diff] [blame] | 321 | /** |
Amy | 225d55a | 2018-09-06 11:03:51 -0700 | [diff] [blame] | 322 | * Property to save the ARC port id on system audio device. |
| 323 | * <p>When ARC is initiated, this port will be used to turn on ARC. |
| 324 | */ |
| 325 | static final String PROPERTY_SYSTEM_AUDIO_DEVICE_ARC_PORT = |
| 326 | "ro.hdmi.property_sytem_audio_device_arc_port"; |
| 327 | |
| 328 | /** |
Amy | cce55e0 | 2018-08-20 15:42:25 -0700 | [diff] [blame] | 329 | * Property to disable muting logic in System Audio Control handling. Default is true. |
| 330 | * |
| 331 | * <p>True means enabling muting logic. |
| 332 | * <p>False means never mute device. |
| 333 | */ |
Amy | cce55e0 | 2018-08-20 15:42:25 -0700 | [diff] [blame] | 334 | static final String PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE = |
Amy | 437bfb3 | 2018-09-05 14:26:56 -0700 | [diff] [blame] | 335 | "ro.hdmi.property_system_audio_mode_muting_enable"; |
Amy | cce55e0 | 2018-08-20 15:42:25 -0700 | [diff] [blame] | 336 | |
Amy | 02f3115 | 2018-08-28 15:05:42 -0700 | [diff] [blame] | 337 | /** |
| 338 | * When set to true the HdmiControlService will never request a Logical Address for the |
| 339 | * playback device type. Default is false. |
| 340 | * |
| 341 | * <p> This is useful when HDMI CEC multiple device types is not supported by the cec driver |
| 342 | */ |
| 343 | static final String PROPERTY_HDMI_CEC_NEVER_CLAIM_PLAYBACK_LOGICAL_ADDRESS = |
| 344 | "ro.hdmi.property_hdmi_cec_never_claim_playback_logical_address"; |
| 345 | |
Amy | 3403742 | 2018-09-06 13:21:08 -0700 | [diff] [blame] | 346 | /** |
Amy | 8027c94 | 2018-09-18 10:23:20 -0700 | [diff] [blame] | 347 | * A comma separated list of logical addresses that HdmiControlService |
| 348 | * will never assign local CEC devices to. |
| 349 | * |
| 350 | * <p> This is useful when HDMI CEC hardware module can't assign multiple logical addresses |
| 351 | * in the range same range of 0-7 or 8-15. |
| 352 | */ |
| 353 | static final String PROPERTY_HDMI_CEC_NEVER_ASSIGN_LOGICAL_ADDRESSES = |
| 354 | "ro.hdmi.property_hdmi_cec_never_assign_logical_addresses"; |
| 355 | |
Jinsuk Kim | bad8393 | 2015-02-10 07:10:40 +0900 | [diff] [blame] | 356 | // Set to false to allow playback device to go to suspend mode even |
| 357 | // when it's an active source. True by default. |
| 358 | static final String PROPERTY_KEEP_AWAKE = "persist.sys.hdmi.keep_awake"; |
| 359 | |
Amy | 743f866 | 2018-06-25 11:51:12 -0700 | [diff] [blame] | 360 | // TODO(UI): Set this from UI to decide if turn on System Audio Mode when power on the device |
Amy | 6506bd6 | 2018-07-02 17:29:36 -0700 | [diff] [blame] | 361 | /** |
| 362 | * Property to decide if turn on the system audio control when power on the device. |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 363 | * |
| 364 | * <p>Default is always turn on. State must be a valid {@link SystemAudioControlOnPowerOn} int. |
Amy | 743f866 | 2018-06-25 11:51:12 -0700 | [diff] [blame] | 365 | */ |
| 366 | static final String PROPERTY_SYSTEM_AUDIO_CONTROL_ON_POWER_ON = |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 367 | "persist.sys.hdmi.system_audio_control_on_power_on"; |
Amy | 743f866 | 2018-06-25 11:51:12 -0700 | [diff] [blame] | 368 | |
Amy | 6506bd6 | 2018-07-02 17:29:36 -0700 | [diff] [blame] | 369 | /** |
| 370 | * Property to record last state of system audio control before device powered off. |
Amy | cc49082 | 2018-07-13 16:57:04 -0700 | [diff] [blame] | 371 | * <p>When {@link #PROPERTY_SYSTEM_AUDIO_CONTROL_ON_POWER_ON} is set to |
Amy | 6506bd6 | 2018-07-02 17:29:36 -0700 | [diff] [blame] | 372 | * {@link #USE_LAST_STATE_SYSTEM_AUDIO_CONTROL_ON_POWER_ON}, restoring this state on power on. |
Amy | cc49082 | 2018-07-13 16:57:04 -0700 | [diff] [blame] | 373 | * <p>State must be true or false. Default true. |
Amy | 6506bd6 | 2018-07-02 17:29:36 -0700 | [diff] [blame] | 374 | */ |
| 375 | static final String PROPERTY_LAST_SYSTEM_AUDIO_CONTROL = |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 376 | "persist.sys.hdmi.last_system_audio_control"; |
Amy | 6506bd6 | 2018-07-02 17:29:36 -0700 | [diff] [blame] | 377 | |
Amy | cc49082 | 2018-07-13 16:57:04 -0700 | [diff] [blame] | 378 | /** |
Amy | 77c7c98 | 2018-07-23 18:27:36 -0700 | [diff] [blame] | 379 | * Property to indicate if device supports ARC or not |
| 380 | * <p>Default is true. |
| 381 | */ |
| 382 | static final String PROPERTY_ARC_SUPPORT = |
Shubang Lu | d7efb0a | 2018-08-01 14:21:28 -0700 | [diff] [blame] | 383 | "persist.sys.hdmi.property_arc_support"; |
Amy | 77c7c98 | 2018-07-23 18:27:36 -0700 | [diff] [blame] | 384 | |
| 385 | /** |
Amy | cc49082 | 2018-07-13 16:57:04 -0700 | [diff] [blame] | 386 | * Property to save the audio port to switch to when system audio control is on. |
| 387 | * <P>Audio system should switch to this port when cec active source is not its child in the tree |
| 388 | * or is not itself. |
| 389 | * |
| 390 | * <p>Default is ARC port. |
| 391 | */ |
| 392 | static final String PROPERTY_SYSTEM_AUDIO_MODE_AUDIO_PORT = |
Shubang Lu | d7efb0a | 2018-08-01 14:21:28 -0700 | [diff] [blame] | 393 | "persist.sys.hdmi.property_sytem_audio_mode_audio_port"; |
Amy | cc49082 | 2018-07-13 16:57:04 -0700 | [diff] [blame] | 394 | |
| 395 | /** |
Shubang Lu | d7efb0a | 2018-08-01 14:21:28 -0700 | [diff] [blame] | 396 | * Property to indicate if a CEC audio device should forward volume keys when system audio mode |
| 397 | * is off. |
| 398 | * |
| 399 | * <p>Default is false. |
| 400 | */ |
| 401 | static final String PROPERTY_CEC_AUDIO_DEVICE_FORWARD_VOLUME_KEYS_SYSTEM_AUDIO_MODE_OFF = |
| 402 | "persist.sys.hdmi.property_cec_audio_device_forward_volume_keys_system_audio_mode_off"; |
| 403 | |
| 404 | /** |
Amy | d323e54 | 2018-08-01 13:24:00 -0700 | [diff] [blame] | 405 | * Property to strip local audio of amplifier and use local speaker |
| 406 | * when TV does not support system audio mode. |
| 407 | * |
| 408 | * <p>This property applies to device with both audio system/playback types. |
| 409 | * <p>True means using local speaker when TV does not support system audio. |
| 410 | * <p>False means passing audio to TV. Default is true. |
| 411 | */ |
| 412 | static final String PROPERTY_STRIP_AUDIO_TV_NO_SYSTEM_AUDIO = |
| 413 | "persist.sys.hdmi.property_strip_audio_tv_no_system_audio"; |
| 414 | |
Jungshik Jang | a6b2a7a | 2014-07-16 18:04:49 +0900 | [diff] [blame] | 415 | static final int RECORDING_TYPE_DIGITAL_RF = 1; |
| 416 | static final int RECORDING_TYPE_ANALOGUE_RF = 2; |
| 417 | static final int RECORDING_TYPE_EXTERNAL_PHYSICAL_ADDRESS = 3; |
| 418 | static final int RECORDING_TYPE_OWN_SOURCE = 4; |
| 419 | |
Jinsuk Kim | 5008486 | 2014-08-07 13:11:40 +0900 | [diff] [blame] | 420 | // Definitions used for setOption(). These should be in sync with the definition |
Donghyun Cho | bc6e372 | 2016-11-04 05:25:52 +0900 | [diff] [blame] | 421 | // in hardware/libhardware/include/hardware/mhl.h. |
Jinsuk Kim | 5b8cb00 | 2015-01-19 07:30:12 +0900 | [diff] [blame] | 422 | |
Jinsuk Kim | 5008486 | 2014-08-07 13:11:40 +0900 | [diff] [blame] | 423 | // If set to disabled, TV does not switch ports when mobile device is connected. |
| 424 | static final int OPTION_MHL_INPUT_SWITCHING = 101; |
| 425 | |
| 426 | // If set to enabled, TV disables power charging for mobile device. |
| 427 | static final int OPTION_MHL_POWER_CHARGE = 102; |
| 428 | |
| 429 | // If set to disabled, all MHL commands are discarded. |
| 430 | static final int OPTION_MHL_ENABLE = 103; |
| 431 | |
Jinsuk Kim | 5b8cb00 | 2015-01-19 07:30:12 +0900 | [diff] [blame] | 432 | // If set to disabled, system service yields control of MHL to sub-microcontroller. |
| 433 | // If enabled, it takes the control back. |
| 434 | static final int OPTION_MHL_SERVICE_CONTROL = 104; |
| 435 | |
Jinsuk Kim | 5008486 | 2014-08-07 13:11:40 +0900 | [diff] [blame] | 436 | static final int DISABLED = 0; |
| 437 | static final int ENABLED = 1; |
| 438 | |
Nick Chalko | 8015e74 | 2018-07-20 09:38:15 -0700 | [diff] [blame] | 439 | private Constants() { |
| 440 | /* cannot be instantiated */ |
| 441 | } |
Jinsuk Kim | c0c20d0 | 2014-07-04 14:34:31 +0900 | [diff] [blame] | 442 | } |