Jinsuk Kim | 5fba96d | 2014-07-11 11:51:34 +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 | |
| 19 | /** |
| 20 | * Class that holds together the constants that may require per-product configuration. |
| 21 | */ |
| 22 | final class HdmiConfig { |
| 23 | |
| 24 | // Default timeout for the incoming command to arrive in response to a request. |
| 25 | static final int TIMEOUT_MS = 2000; |
| 26 | |
| 27 | // IRT(Initiator Repetition Time) in millisecond as recommended in the standard. |
| 28 | // Outgoing UCP commands, when in 'Press and Hold' mode, should be this much apart |
| 29 | // from the adjacent one so as not to place unnecessarily heavy load on the CEC line. |
| 30 | static final int IRT_MS = 300; |
| 31 | |
| 32 | // Number of retries for polling each device in device discovery phase after TV powers on |
| 33 | // or HDMI control is enabled. |
| 34 | static final int DEVICE_POLLING_RETRY = 1; |
| 35 | |
| 36 | // Number of retries for polling each device in periodic check (hotplug detection). |
Jungshik Jang | 8e93c84 | 2014-08-06 15:48:33 +0900 | [diff] [blame] | 37 | static final int HOTPLUG_DETECTION_RETRY = 1; |
Jinsuk Kim | 5fba96d | 2014-07-11 11:51:34 +0900 | [diff] [blame] | 38 | |
| 39 | // Number of retries for polling each device in address allocation mechanism. |
| 40 | static final int ADDRESS_ALLOCATION_RETRY = 3; |
| 41 | |
Yuncheol Heo | 4635038 | 2014-12-03 22:29:45 +0900 | [diff] [blame] | 42 | // Number of retries for sendCommand in actions related to new device discovery. |
| 43 | // Number 5 comes from 10 seconds for Chromecast preparation time. |
| 44 | static final int TIMEOUT_RETRY = 5; |
| 45 | |
Jungshik Jang | 8ed86c4 | 2014-07-11 11:56:46 +0900 | [diff] [blame] | 46 | // CEC spec said that it should try retransmission at least once. |
| 47 | // The actual number of send request for a single command will be at most |
| 48 | // RETRANSMISSION_COUNT + 1. Note that it affects only to normal commands |
| 49 | // and polling message for logical address allocation and device discovery |
| 50 | // action. They will have their own retransmission count. |
| 51 | static final int RETRANSMISSION_COUNT = 1; |
| 52 | |
Jinsuk Kim | 4fdd0f4 | 2014-08-06 07:23:32 +0900 | [diff] [blame] | 53 | // Do not export the CEC devices connected to a legacy HDMI switch. The usage of legacy |
| 54 | // (non-CEC) switches is deprecated. They stop the correct operation of many mandatory |
| 55 | // CEC features. If set to true, do not pass the list of CEC devices behind the legacy |
| 56 | // switch since they won't be under control from TV. |
| 57 | static final boolean HIDE_DEVICES_BEHIND_LEGACY_SWITCH = true; |
| 58 | |
Jinsuk Kim | 5fba96d | 2014-07-11 11:51:34 +0900 | [diff] [blame] | 59 | private HdmiConfig() { /* cannot be instantiated */ } |
| 60 | } |