History log of /frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ca4964ccbef5f2c85855fc14577c7c25d0e0588d 07-Feb-2017 Paul Duffin <paulduffin@google.com> Replace com.android.internal.util.Predicate with java.util.function.Predicate

Bug: 35089332
Bug: 30188076
Test: make checkbuild
Change-Id: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
0b485b2f3733ddb7f24774e42f208efca9aa0f10 13-Dec-2016 Donghyun Cho <donghyun@google.com> CEC: Dump recent message history for better logging

Logging for CEC messages is disabled by default, so it is hard to debug
using bug report. Providing recent history of cec messages would be
helpful to see what happened via CEC line.

Bug: 33682018
Test: adb shell dumpsys hdmi_control
Change-Id: I476ce454418d6da8d65f520cc79d653bf96f3afd
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
bc6e372b25d7d62efecefba09304c5a66218c91a 03-Nov-2016 Donghyun Cho <donghyun@google.com> tv.cec: Update framework code to call Treble HAL

Bug: 32073236
Test: Checked CEC features works on fugu after applying Treble HAL
Change-Id: I26df037594e2505bd8f2d2bb6222cba5ddca2906
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
dbf9f9cc5e363f26f8dfc4ceef6c6abb3881a190 04-Jul-2016 Donghyun Cho <donghyun@google.com> CEC: Change the logical address allocation policy

According to the CEC spec (Section 7), a message transmitted and
acknowledged should be assumed correctly received. Therefore, If a
polling message to certain logical address(LA) is acknowledged during
the LA allocation phase, it can be assumed that there exists a CEC
device on the LA. This CL will see whether at least 1 polling message is
acknowledged or not in order to check the CEC device existence, instead
of using the previous voting policy.

Bug: 27337386
Change-Id: I39df78f6db29a1b47cb962f8fe5e0382c16028de
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
1481a4282818939436f590d8c88aea2d19166b8e 17-Dec-2014 Jinsuk Kim <jinsukkim@google.com> CEC: Pass port ID for set_audio_return_channel

This CL passes a port ID when enabling/disabling ARC in case
there are multiple HDMI ports that support the feature.

Bug: 18781204

Change-Id: I632518132bf07c8ae6f0ff5135429ca719b596b2
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
f17024873b10dabed069e502030dd85d6257c0c4 27-Nov-2014 Yuncheol Heo <ycheo@google.com> CEC: make it sure to send vendor commands when changing a setting.

- Remove 'oneway' from IHdmiVendorCommandListener.
- Add flush() method to HdmiCecController.
- Use IoThread for HdmiCecController.

Bug: 18495592
Change-Id: I497f7b49e94dd4402058ecc89cb5b7a3d58bf1e1
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
b3ecb72af8cbbd4f6f8089d0dc22289f6e2588f6 11-Sep-2014 Jungshik Jang <jayjang@google.com> Use async polling for HPD action

Since Device polling holds whole IO thread while it's running,
other sending requests would be blocked until it's finished.
Usually polling takes more than 1 seconds and some action might
be timeouted.
This change sends polling message asynchrousely for
each device address.

Bug: 17381548

Change-Id: I2f47931c5882649d6ac56092986d34d1da48f710
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
2e8f1b6399089626b4f0249427626ba6e63a62ef 03-Sep-2014 Jungshik Jang <jayjang@google.com> CEC: Revamp volume control action.

Here is a list of changes
1. Change volume control into event base not level base
2. Hide volume ui if volume change is triggered by CEC
3. Report volume change triggered by CEC in OSD message
4. Revamp HdmiLogger so that normal class uses static method only.
5. Apply format message to HdmiLogger's helper methods.

Bug: 17367215

Change-Id: I9f3cd41f7c66f76919059b463df956ed5176b054
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
f8a823b05a9db8b307817461b58bc0dda896241b 29-Aug-2014 Jungshik Jang <jayjang@google.com> Merge "Fix system audio mode failure in boot up" into lmp-dev
a7221ce87683fab16603290378408ce92f02e88a 28-Aug-2014 Jungshik Jang <jayjang@google.com> Fix system audio mode failure in boot up

This bug happens because <Set System Audio Mode> is arrived
before <Give System Audio Mode Status>'s send result callback
is called in service thread. We do set internal state
on callback resut.
This change sets state when we send command.
Along with this, add more debug log to help future debugging.

Bug: 17309726
Change-Id: I0e41f684372a4c8891a90f724944227fc689e053
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
959d2db12c7c6a06465af1251bc4cece580a72a3 28-Aug-2014 Terry Heo <terryheo@google.com> CEC: Implement dump() of HdmiControlService

In addition, use hexadecimal address representation in HdmiPortInfo.toString()

Bug: 17310007
Change-Id: Iaba8f718f86a18a23b50f983053c7589dcdcfaf8
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
c94ac5cffc982898bc4f7a5d97d8fad5520ff444 27-Aug-2014 Jungshik Jang <jayjang@google.com> Add more debug message to HdmiControlService

Bug: 17291374
Change-Id: I9568dd12b0e5864c50f81bacc2729b82242187c4
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
7df52862dae1fa33c84725c613b0d9b88c1b28b6 11-Aug-2014 Jungshik Jang <jayjang@google.com> Hook up native mhl api to HdmiControl Service.

This change hooks up all apis defined in mhl hal to
java layer's HdmiMhlController and HdmiControlService.
Along with HdmiMhlController, this change includes followings.

1. HdmiMhlLocalDevice
A logical container for a mhl device connected to specific hdmi port

2. HdmiMhlFeatureAction
A base feature action class for mhl's state behaviors like RAP and RCP.

Bug: 16215362

Change-Id: If177999853f60b68bd079549660a3f4982cb9d9e
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
8e93c84739902f5adaa499b474f39e3c4807bc1c 06-Aug-2014 Jungshik Jang <jayjang@google.com> Prevent hot plug detection action from multiple device polling

Along with this removed unused code and wrong references in
java doc.

Change-Id: I8b2fd8065f582f60cde5ada0e1669515b6a60f3f
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
6aae6528a6672497b1d1dffb5c083093d5c46dc8 05-Aug-2014 Yuncheol Heo <ycheo@google.com> Refactor <Feature Abort> logic to concentrate it in one place.

- Don't reply from the unregistered address.
- Use "unrecognized opcode" as the default reason.

Bug: 16799466, Bug: 16798785
Change-Id: I7c2ece6436f7ebd59986d2baf4f45cd86e6622d9
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
1827fdcbf6a53378f05620790e4798201341097b 17-Jul-2014 Jungshik Jang <jayjang@google.com> Do no send <Feature Abort> as response of <Feature Abort>

Cec service replies <Feature Abort> back to original device
if incoming message is not handled by any of feature action or device.
It's applied to <Feature Abort> message itself, but it can cause
weird sideeffect of it.
This change just ignore <Feature Abort> even though it's not handled
by any of local device or feature actions.

Bug: 16359564
Change-Id: I925e89ca4db49a637dd296447c04eee1ba679c6b
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
af2acf0447aff34450cde2bcfb35dff9cf631729 11-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Keep preferred address for HdmiControlService

Uses SystemProperties to store/retrieve preferred logical address

Bug: 15843075
Bug: 15844858
Change-Id: Ie1304805cbec4e11ef4b44a5cceb108121c60581
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
8ed86c467afa107f7aafacb85ca64c979cf56dc2 11-Jul-2014 Jungshik Jang <jayjang@google.com> Implement retransmission of cec request.

BUG: 16218422
Change-Id: I4a6692ba8815e9a0ae26c872656b31b678d54fd6

Conflicts:
services/core/java/com/android/server/hdmi/HdmiCecController.java
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
d3dc721c0a7addef43852d60bfd2472616332ef6 11-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Merge "HdmiConfig class holding constants that may need customization"
5fba96df30b6b50b3cb9fe1d783320b1cc3bd6ea 11-Jul-2014 Jinsuk Kim <jinsukkim@google.com> HdmiConfig class holding constants that may need customization

Put in one place some constants used in HdmiControlService that
may need customization. This makes it easy to do the job.

Bug: 16160911

Change-Id: I59786a48d336cfca722daa82c1f0dceb88c5e5e4
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
4fc1d105fc279bf7df6c876e160672866bdad8e7 09-Jul-2014 Jungshik Jang <jayjang@google.com> Revamp disabling device in local device.

When a cec deivce turns into disabled mode such as power off, standby,
and cec feature disabled, cec service should execute cleanup tasks.
Including cleaning up all feature actions, each device should run
their own cleanup.
It should stop system audio mode and arc for tv, while it should
send inactive source for for playback device.
Along with this, to prevent stale feature action, added timeout
to local device so that if there is stale action, it enforce to
finish it.

Bug: 16118520

Change-Id: I5ce30ab0f4459b6e2834f8d31b6a7ff789b35d07
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
42230728b8212738c2351939c5577730f05a58de 07-Jul-2014 Jungshik Jang <jayjang@google.com> Add port number to hot plug event handler.

This is to remove a TODO about adding port number to
jni interface.

Bug: 15844074
Change-Id: I4dba0879527035a4cabad6cc80e359e6c1fd39b0
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
c0c20d0522d7756d80f011e7a54bf3b51c78df41 04-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Removed class HdmiCec

Most of the constants in HdmiCec are internal use only. Moved them
to service, and dispersed the rest to other relevant classes.

Also moved HdmiCecMessage class to service as it doesn't need to be
open ouside the service.

Change-Id: I7b2ce3bf465330aa4d7fcd05f9aefa1e6c8b056a
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
1de514256fd3015cf45256f3198ab5472024af9b 03-Jul-2014 Jungshik Jang <jayjang@google.com> Set source address for <Polling Message>

CEC spec mentions that logical address allocation uses
the same address for source and destination while <Polling Message>
uses device's source address.

Bug: 16045547
Change-Id: Id18f328755501c62a98a1040b287c180cb889c9b
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
160a6e5b99de15ce755e2e5521dce32d81ab180a 01-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Add setOption for HdmiControlService

Bug: 15845304
Change-Id: I96b285ae3938aeecdd44b2c08a178def33bd2bf2
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
a5b7414970c85217e88015e78ecbc5ba093dead3 23-Jun-2014 Jungshik Jang <jayjang@google.com> Introduce @ServiceThreadOnly and @IothreadOnly to HdmiControlService

Many of hdmi service modules assumes that it runs on
service thread without any lock. But it's a bit
hard to distinguish whether a method runs on
service thread or not even though there is run-time
assertion (runOnServiceThread()) is top of method.
@ServiceThreadOnly interface documents that a method should
run on service thread while @IoThreadOnly documents
that a method should run on io thread.

Change-Id: Ia4a6a48675d2302fb2cb7a8a807fcf112da5d4e7
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
3ecdd832c77483c909fbf90d17d0e6d97ca365ee 17-Jun-2014 Jungshik Jang <jayjang@google.com> Fix missing iteration policy on device discover action

Device polling requires both pick policy and pick iteration policy,
however, device discovery action has no iteration policy.
Along with fix, move send result and pick policy constants
to HdmiConstants package

Change-Id: Ibbcfdc482a189bbc3aa2c61143422541da78447d
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
79c58a4b97f27ede6a1b680d2fece9c2a0edf7b7 16-Jun-2014 Jungshik Jang <jayjang@google.com> Rearrange ownership between Hdmi control modules.

Here is a list of changes on this. (R: rationale)
1. HdmiCecLocalDeviceTv takes over responsibilty of device info
management.
R: All devices infos are added or removed by only Tv's
device discovery and hot plug detection mecanism

2. Each HdmiCecLocalDevice manages FeatureAction and Cec
message cache.
R: There is no direct connection between actions that
are created in different device action. If there is
an same actions created from different local device,
they should be managed independently.

3. Active path and logical address is managed by
HdmiCecLocalDevice.
R: All device should know active path of current source.

4. All system audio & ARC features are handled by
HdmiCecLocalDeviceTv
R: In terms of ARC, theoretically, any device can be transmiter of
ARC but TV is the de facto device
On other hands, for system audio Tv is the recipeint
of request.

Change-Id: Iac9ff43fb41798ed4f94c61d23345fe5fe777fbb
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
0340bbc89f8162f9c2a298c98b03bfcdd1bc6e87 05-Jun-2014 Jinsuk Kim <jinsukkim@google.com> RoutingControlAction for HdmiControlService

Routing control action is initiated in various cases, such as manual
TV input port switching, routing change of a different CEC switch,
and so on. The action determines the device to be a new active source.

Change-Id: I1efcd6ff1919dd94d6fa0e0ffa6e430c48d4e9c6
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
092b445ef898e3c1e5b2918b554480940f0f5a28 11-Jun-2014 Jungshik Jang <jayjang@google.com> Move message handling logic to local device instead of service.

Local device is in charge of handling incoming messages
and for some messages such as <set menum language> or
<report physical address> each device has slightly different
behavior. Instread of checking destination address and
local device status from service, this change leaves it
to each local device.
Note that some messages are still left on service
and will be refactored in the following changes.

Along with this, following changes are included.
1. add missing jin interfaces
set_option
set_audio_return_channel
is_connected
Note that get_port_info is under review of jinsuk's change
2. if tv device receives <Report Physical Address>,
starts NewDeviceAction.
3. add constants variables related to new interfaces.
4. add two helper methods for physical address and vendor
id handling

Change-Id: I9c9d04744bc09fbf38431ecfa6e77097b0618a37
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
0f8b4b770c49b83fa8260833d8e1ec5c721a05d3 28-May-2014 Jungshik Jang <jayjang@google.com> Implement hotplug detection sequence.

Hotplug detection is periodic operation to detect new/removed device.
In case of directly connected device fires hotplug devices
but remote devices which are plugged in hdmi switch may not
report their existence.
Hotplug action polls all devices in regular base; 5s for
system audio (only when it's active) 15s for others.

Change-Id: I77c308ecfd5d6bf92f306923fa5ac9eabdad4127
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
3ee65720e91c7f92ad5a034d7052122a606aa8d5 03-Jun-2014 Jungshik Jang <jayjang@google.com> Refactor HdmiCecLocalDevice and logical address allocation logic.

1. Factor out logical allocation logic to HdmiControlService.
2. Contains a reference to HdmiControlService rather than
HdmiCecController so that it enables to access service's logic
directly.
3. Move launch device discovery logic to HdmiCecLocalDeviceTv.

Change-Id: Ic97b4d51311a3c18f6d586c2245cac410cbd370e
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
63a2e0696ce2a04fbe0f1f00cfe9c93189f944da 27-May-2014 Yuncheol Heo <ycheo@google.com> Add SystemAudioAction(FromAvr|FromTv).

The system audio can be initiated by Tv itself or by AVR through
<Set System Audio Mode> CEC message.

This CL also includes:
- Add HdmiConstants, HdmiUtil class to handle various constants and
utility functions.
- Add default message dispatcher to all queued actions.
- Add an argument on HdmiControlService.removeAction(class) to prevent
from removing the caller itself.

Change-Id: I9fd9089bed876f04b58c483879b64edfae94a298
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
8b308d93c8fdcc7304b33d9b445ae3807eae97c8 29-May-2014 Jungshik Jang <jayjang@google.com> Start Device Discovery after logical address allocation.

Usually TV initiates Device Discovery sequence after logical address
allocation of local devices. For that added new callback interface
to AddressAllocationCallback to HdmiCecDevice.
Along with this, add onAddressAllocated to HdmiLocalDevice so that
start sending local device information once logical allocation is done.

Change-Id: I4cdc5dd7770674a17a0f23c383a6c1ca221e3104
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
3a2f74373a6892ca5c11cd19b4b662c069634717 28-May-2014 Jinsuk Kim <jinsukkim@google.com> Do not reply with <Feature Abort> to CEC Broadcast message

Broadcast message is not targeted to a specific device but for
announcement. Individual reponse with <Feature Abort> is neither
necessary nor useful. Changed to send the message back only for
direct messages.

Change-Id: I927aa8e58a9868e158ed945c753492207e7c97f6
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
cc5ef8c918e96516a5c51cc40735a1b8a24d8497 27-May-2014 Jungshik Jang <jayjang@google.com> Implement device discovery sequence.

When device discover is launched it goes through the following step

1. clear all existing devices
2. send <Polling Message> of all logical addresses
excecpt one of local device
3. Once got all allocated logical addresses, gather physical address of
them
4. Once got physical address of them, gather display name of them
5. Once got display names, gather vendor id of them
5. Once got vendor id of them, register all gathered info to
internal device info list.

Change-Id: Ic9aca3b15d88ac7650f10b6d0bfa9c97923975e8
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
4085d0ef62554c7e139b82bca0f97161bb159f8c 27-May-2014 Jungshik Jang <jayjang@google.com> Add cec message handler to hdmi cec jni implementation

Notification for incoming cec message can be issued
from any thread but jni can call java method
in the thread that jni knows like service thread.
So this change delegates incoming message to
jni-friendly thread, service thread by exploit
looper of service thread.

Change-Id: If3b141d917df3e209912af1778eb509777199969
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
0bc8b0718f740cc543e88b45591da903bb235f90 27-May-2014 Jinsuk Kim <jinsukkim@google.com> Fix a bug using wrong addresses for CEC logical address allocation

Change-Id: I41da586c16dca4f325d147bb3abe5d4e09f7b91c
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
7fe2ae0fe9c24f0a1a5ddf20850069b56af2c2fd 26-May-2014 Jinsuk Kim <jinsukkim@google.com> Hook up the CEC playback API to service internal logic.

This change enables CEC playback API (oneTouchPlay, queryDisplayStatus).
Also updated local device list type to SparseArray to make it easy
to get one based on device type.

Change-Id: I6f88b2dac2d873c493a90411549a4e5719a5e460
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
1a4485dcd25ed036fb8de1a271b37121d8135f4e 26-May-2014 Jungshik Jang <jayjang@google.com> Add HdmiCecDeviceInfo to HdmiCecLocalDevice

As HdmiCecLoclaDevice is a wrapper for local devices
it should include cec device info.

Change-Id: I479665b2aa6bd56470b79dbbb7fb1015f6356090
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
02bb4265ac41e1974ec7d4793e6c2a0ed2adc3c4 23-May-2014 Jungshik Jang <jayjang@google.com> Implement <Polling Message>.

When Device Discovery is launched or Hot-plug detection is
launched, the first step of it is to send <Polling Message>
to all remote devices. According to type of feature,
it may have different retry count for sending <Polling Message>.

As <Polling Message> to all devices should be serialized operation
it runs on io thread as single operation.

Along with this, added assertRunOnIoThread and
assertRunOnServiceThread used to make sure that all methods are
called in proper thread.

Change-Id: I2d2df0216867c188e99ba24b216ec73f3396eeae
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
1178cd29b2a9268a915f5ba60def9142d5d1da78 26-May-2014 Yuncheol Heo <ycheo@google.com> Merge "Add the constants for the callback result of SendCecCommand()."
ece603b7955938d6001c376f351ca0a2219330ac 23-May-2014 Yuncheol Heo <ycheo@google.com> Add the constants for the callback result of SendCecCommand().

- Move the send failure warning messages into HdmiCecController.sendCommand()
from each Actions.
- Stringfy with more detail messages for some opcodes.

Change-Id: Ib7ce24dd2a1f290e6c3a0b26738772ef1d4a9630
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
2918e9e133de8066ab497a5f8dac1c310c792767 20-May-2014 Jinsuk Kim <jinsukkim@google.com> CEC Initialization per device type

CEC initialization may vary from device type to type. Changed logical address
map to HdmiCecLocalDevice map to handle it. These per-type classes for local
device will be extended also to take care of incoming CEC commands that should
require different action based on device type.

Change-Id: Ia59a464607b14e942fcf83e63aa1d6310ca6a575
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
d643f764f72efc1e7aa67392bf9ac40720ae14c3 22-May-2014 Jungshik Jang <jayjang@google.com> Add SendMessageCallback to Hdmi control service.

As we have separate IO thread, we should have async callback
mechanism to get result of send request.
For that, I added SendMessageCallback interface to HdmiControl
Service
Along with this, replace message-based IO handling with
post Runnable based one for consistency

Change-Id: I61cf5b751b4f2af3b34956060869f3512f161d11
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
67ea521d14f366fe5aac09e512865d31bfa0ee53 15-May-2014 Jungshik Jang <jayjang@google.com> Add several actions for ARC (Audio Return Channel)

ARC channel is established by both TV and AV Reciever.
From TV, it sends <Request ARC Initiation> and AVR
responds with <Initiate ARC>.
From AVR, it can be initiated by sending <Initiate ARC> directly
to TV.
Once TV receives <Initiate ARC> it sets up ARC internally
and replies <Report ARC Initiated> to AVR.
Termination steps are almost same except for message name
(use Terminate instread of Initiation).

In order to implement the above steps, this change introduces
following classes.

RequestArcInitiation(Termination)Action:
handles <Request ARC Initiation> (<Request ARC Termination>)
RequestArcAction handles common logic of them.

SetArcTransmissionStateAction:
handles ARC set up, enabling/disabling ARC and
reports results to AVR.

<Initiate ARC> and <Terminate ARC> handles directly in
HdmiControlService

Along with this, this change has implmentation for
add&removeAction. To avoid synchronization issue
they are isolated to main thread.

Change-Id: I3c5cf7c777e6c1de50d63ce4643b191dfe15fe1f
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
a8a5e50c6f9ba3ae0ff59eda76354e93515d6f8f 15-May-2014 Jinsuk Kim <jinsukkim@google.com> Initialize internal CEC logical devices

Allocates logical address of internal HDMI-CEC logical device(s)
using the resource config_hdmiCecLogicalDeviceType.

Change-Id: I1a0d2f7bce36fc643887241f03161dc053d6c25c
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
a1fa91fe263c483cf13066e2847a440de2cd52a5 08-May-2014 Jungshik Jang <jayjang@google.com> Implement handlers for system information query command.

System information query commands are stateless command and
it should be replied immediately when it receives query command.
Here is a list of command handler (and it's reply) implemented
in this change.
1. <Get Menu Language> -> <Set Menu Language>
2. <Give(Get) OSD Name> -> <Set OSD Name>
3. <Give Physical Address> -> <Report Physical Address>
4. <Give Device Vendor ID> -> <Device Vendor Id>
5. <Give CEC Version> -> <CEC Version>

In order to centralize all cec message building, added new
builder class, HdmiCecMessageBuilder for HdmiCecMessage.
Accordingly, all helper methods for building of HdmiCecMessage
are moved to HdmiCecMessageBuilder class.

Change-Id: Ib7c5d2b0cb3d69d51159af8bc277ffb49a60909b
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
a9095ba488ea18aeafaf9c3a8258bf9f459bda71 02-May-2014 Jungshik Jang <jayjang@google.com> Implement more native api for Hdmi cec.

HAL interface for CEC has more apis that haven't
connected with HdmiCecController.
Here is a list of apis.

1. addLogicalAddress
2. clearLogicalAddress
3. getPhysicalAddress
4. getVersion
5. getVendorId

Verified that it does not affect to other components in nakasi

Change-Id: I535bde47c43dd25bbede002c0a2aefbe86779076
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
3f74ab0ee0ec27a6be31cdb5a4258f4f25909ba8 30-Apr-2014 Jungshik Jang <jayjang@google.com> Implement logical address allocation logic for HDMI CEC.

Logical address in CEC is to distinguish each logical device from others.
In order to allocate logical address for new device, CEC sends
<Polling Message> to CEC bus. <Polling Message> is a CEC message
which has the same address for both source and destination without
body frame. (10bits).
CEC allows one and more logical address for a device type.
For example, there are 3 logical address defined for recorder device(1, 2, 9).
Among logical address candidates for the given device type, CEC scans
first the previous logical address (preferred logical address) of device.
If a device has not been allocated any logical address, preferred address
will be 15 (Unregistered), which means scan address from the minimum address
number of type. For example for recorder device, it starts from 1.
If no devices acks to the <Polling Message> during scan, it will be the
logical address of the device.
Since logical address is determined by a series of sending <Polling Message>
it happens in IO thread with separate allocate logical address message
instead of individual sendCommand message.

Along with this, updated ADDR_FREE_USE(14) to ADDR_SPECIFIC_USE(14)
which is revised name on HDMI 1.4.

Change-Id: Ic96dcdbe4aaa3789cfed0352a88ca75369335a98
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
7d9a843af83dbc75b1d170c743603198ede5a10f 29-Apr-2014 Jungshik Jang <jayjang@google.com> Implement add/remove device info api for Hdmi Cec device.

In order to manage info of all cec devices connected hdmi bus,
HdmiCecController should have data structure for them.
This change includes two major pieces.

1. HdmiCecDeviceInfo
It's data structure containing basic device information such as
logical address, physicall address, device type and vendor id.
It will not be available to thirdparty but some system component
like TIF needs this to update device information connected to
its hdmi ports.

2. Managing device list in HdmiCecController.
HdmiCecController is a host to manage all CEC device.
and we need to have logic add or remove as well as get it.
All cec devices are managed as sparsearray which uses logical address as key.

This change introduces internal api and the later change will have logic
to call these apis.

Change-Id: Idc2f189ac0bffe904e011ced0ac991f16da07db1
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
e9c77c88ea34a66f83a94f960547275c0ff6bd07 24-Apr-2014 Jungshik Jang <jayjang@google.com> Implement native send and receive logic for HdmiCecController.

This change includes native jni implementation for
incoming and outgoing message of CEC.
For incoming message, native layer converts it into three
pieces, source address (initiator), destination address (follower)
and data body which includes opcode. In Java layer, it is delegated to
main io thread. For now all messages are rejected by sending <Feature Abort>
to initiator.
For outoging message, all messages are sent to io thread and it delegates
it into native layer. Native logic converts it into cec_message and
pass it to HAL so that HAL performs sending message.
In order to handle <Feature Abort> message, added [Abort reason] which is
defined in hdmi_cec.h.

Change-Id: If9fd74745f476105e5cfae964e39c78bae69d3e2
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java
0792d37385e60aa8d73f8df174d0a32f4f618bc4 23-Apr-2014 Jungshik Jang <jayjang@google.com> Implement skeleton of new HDMI Control Service.

HdmiCecService is a system service handling HDMI-CEC features
and command. Recently we found out that industry has more
requirements to support HDMI-CEC. Also, MHL is another
standard should be in our pocket. Basically, MHL is
a standard to support communication between mobile device
and TV or Av device. As CEC is a control standard over HDMI
cable, MHL has control channel for peer device.
There behavior is very similiar. Both have commands that
can change Tv's current input and can send/receive key
to other device to control other deivce or TV.

In order to cover both CEC and MHL, current HdmiCecService
implementation has limitation. We had several
session of discussion and decided to refactor
HdmiCecService into HdmiControlService.
For each standard it will have separate controller instance
like HdmiCecController and HdmiMhlController.

In this change I didn't touch original HdmiCecService
because some component, like cast receiver, uses HdmiCecService.
For a while we will keep HdmiCecService until HdmiControlService
accomodates all features of HdmiCecService.

Change-Id: I5485280ab803dbf071d898bfbe34be0b11ce7958
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecController.java