History log of /frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e26d833c4a00bc7c1c23083f28ef891703e7e385 09-Jan-2015 Jinsuk Kim <jinsukkim@google.com> CEC: Keep Playback device awake while it is the active source

Alleviates the user experience issue of having to turn on the device
manually when it goes to standby mode while the device occupies
the display.

Bug: 18882764
Change-Id: I10b239a599a310e47e3c2cb98737e4b0fdb4e435
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
6e26f7f7b09dfd8495ec5478a7a4713dab346bc1 07-Jan-2015 Jinsuk Kim <jinsukkim@google.com> CEC: Handle <Active Source> arriving before TvInputCallback.onAddInput

Resolves a timing-related bug that fails to process the command
<Active Source> at TV boot up. Checks if TV input required for
the command is ready to accept the request. If not, makes sure
the command is buffered, and processed later when the input is
ready.

Bug: 18896770

Change-Id: Id17e5e8468519b17daf61c962dd718ccc56fb0ea
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
0608b9328b1c2f804ffb2d4165c34383d34bde2a 13-Oct-2014 Yuncheol Heo <ycheo@google.com> CEC: Add a callback for vendor when HDMI control setting is changed.

- removed unregisterContentObserver() to reactivate the service later.
- added the parameter destAddress to onReceived() callback to
distinguish whether the message is broadcast or not.

Bug: 17962624
Change-Id: I552d14661583f63bb66b07866092f972b259b15a
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
6f87b4e6b6db76cb32d449ad1fdf1946ff4e96f7 10-Oct-2014 Jinsuk Kim <jinsukkim@google.com> CEC: Queue actions for starting later when not ready

Requests coming in while the service is still being brought up
were discarded. Changed to queue them so that they can be started
after the initialization is completed.

Bug: 17933899
Change-Id: Ic9d9cd2094b830c80dec54dd5ef6a18159a74dc7
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
73483b6bc9046cbb7a54748c31ee724358a631ef 26-Sep-2014 Jungshik Jang <jayjang@google.com> Support parameterized keycode in cec.

This change is to support keycode mapping between custom
android keycode and cec keycode + parameter case.

Bug: 17664826
Change-Id: I7a698655589078b8ebba96d96bff70b43d346231
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
5352081c662299b618335bf3024058fa04ef2dfd 22-Sep-2014 Jungshik Jang <jayjang@google.com> Enable all actions to have chance to consume incoming message.

Some actions such as "DevicePowerStatusAction", "PowerStatusMonitorAction",
"Routing Contron Action" might wait for receiving <Report Power Status>
message, but the oldest aciton, which is normally PowerStatusMonitorAction,
can consume it.
This change enables all actions to have chance to touch incoming message.

Along with this, it fixes audio mute bug during volume control.

Bug: 17597377
Change-Id: Iafb71f6ea6309a4fba79833da2d634222058ac78
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
d4a94db1cd44a536d535de890a0a14919a39a0dc 12-Sep-2014 Jinsuk Kim <jinsukkim@google.com> CEC: Bug fixes for vendor-specific command handling

- Add sendStandby()
- Respond with <Feature Abort>[INCORRECT_MODE] when the listener
is not ready

Bug: 17379243
Bug: 17358887
Change-Id: I26a4157a70f11206978763fbbe69e4190e3e1d5c
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
184b124ec22a796327642e3546d366179e693f07 12-Sep-2014 Yuncheol Heo <ycheo@google.com> Handle <Menu Status> message.

- Just accept the message, not to response <Feature Abort>.
- Added the CEC message validation info.

Bug: 17382771
Change-Id: I0c1ba870b0acfcd0414f0a3e7bb6c41483879116
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
4480efa05aa5dd44f1432c3260be263546daf838 04-Sep-2014 Jungshik Jang <jayjang@google.com> Prevent sending <Feature Abort> for some messages.

This change fixes the following cases.
- <Report Power Status>(0x90)
- When TV receives <Report Power Status> as a reply of <Give Device Power Status>, TV does not send <Feature Abort>. But if a device sends <Report Power Status> actively, TV sends <Feature Abort>.
- <Set System Audio Mode>(0x72)
- <System Audio Mode Status>(0x7E) Directly address message is also defined.
- <Record Status>(0x0A) (We will support One-touch record function at least in Japan)
- <Timer Status>(0x35) (We will support Timer programming function at least in Japan)
- No response for <Record TV Screen>(0x0F)

Bug: 17382769
Change-Id: I8ae355337757710d54b788edfdf37293f96cfa97
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
b502186ab34a4de40f1d98591a0c5d8b4eac76e2 02-Sep-2014 Yuncheol Heo <ycheo@google.com> Reallocate the logical address on the hotplug event.

Bug: 17337451
Change-Id: I4117638e96c64eabd64edfef3359a0f12cf110f6
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
e9f6ed3b11fb8ebae5e73db1e4736b86cae272d9 20-Aug-2014 Jinsuk Kim <jinsukkim@google.com> CEC: Invoke input change for RAP request from MHL device

Transform RAP[ContentOn/Off] to input change event.

Bug: 17141884
Change-Id: Ic2d8e305f482ebb4f4f3b3e167f726a66dc174cf
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
5691b2f2297b29dc83a7f83f77da517035b11cce 18-Aug-2014 Jungshik Jang <jayjang@google.com> Remove parameter field in HdmiCecKeycode.

Since we don't support mapping between android key and parameterized
cec keycode, remove parameter fields in HdmiCecKeycode.

Bug: 17099253
Change-Id: I8b6b6b361f0c343b0a263240b49e41bf289d36ca
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
3e1564ee397ef833cba351153029317786f3d6bb 12-Aug-2014 Terry Heo <terryheo@google.com> CEC: Handle Remote Control command

Generate an Android key event when a UserControl message is received.
And report menu state active when a MenuRequest message is received to
notify sender can send a UserControl message.

Bug: 16938007
Change-Id: Id8f393dc254508b9e7a6fa203f8e817fbe807e38
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
867b4e0c55b4b1e432a3585fc945a999f066ef81 12-Aug-2014 Jungshik Jang <jayjang@google.com> Set active port path to HdmiControlService

Set active port path to HdmiControlService so that the service
can handle proper event patch between cec and mhl devices.

Bug: 16215362
Change-Id: I2bd703916a422429b1029067fa3422e24de39274
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
64bafd9108b532102bc13c47966444b073c33faf 11-Aug-2014 Yuncheol Heo <ycheo@google.com> Make it not to go to sleep when changing TV's input to the others.

- Previously, we decided to make it go to sleep when changing TV's input
to the others. But, we found that the current molly couldn't wake up by
CEC commands actively. So, we'll revert the decision.
- In addition, during investigating this issue, we found that currently
molly couldn't work with Samsung (SS) TV harmoniously. SS TV will send
<RoutingChange> and <RequestActiveSource> when it wakes up. If there
is no <ActiveSource> response, then it will change the input to the
internal. This CL handles this issue also.

Bug: 16803105
Change-Id: I5179561775b186b486fc3f2a042e759fcb07451b
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
b509c2ecd99619248b7a07fb0fa978bb27f25cc3 07-Aug-2014 Jungshik Jang <jayjang@google.com> Rename FeatureAction into HdmiCecFeatureAction

Change-Id: I92ca11e513f8cf520e84399fe688397f2d9f714a
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
61f4fbd2e8436a1ecd478c2a1f516d064a24d43b 06-Aug-2014 Jungshik Jang <jayjang@google.com> Rename HdmiCecDeviceInfo into HdmiDeviceInfo.

In order to include mhl device info to device info,
rename HdmiCecDeviceInfo into HdmiDeviceInfo.

BUG: 16215362

Change-Id: I30fb0216061fbbdd6fdc1b82c63af83f1b678597
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
fc44e4e03c5f6486efb7457965dcf7eaf36bc971 04-Aug-2014 Yuncheol Heo <ycheo@google.com> Let STB oneTouchPlay on SCREEN_ON event.

- Eleborate the reason code to initiate the initialization.

Bug: 16668375
Change-Id: I4ce657a9438e4f7baa7df2eaa102eb1ce1a7bccb
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
e5a9337ebe738633cf7b66141cdf76efcdc5754c 25-Jul-2014 Jungshik Jang <jayjang@google.com> Implement clear timer.

This change implements clear timer, which sends
<Clear xxx Timer> to recorder, and reponse of it,
<Timer Cleared Status>.
Along with it, add result parser for [Timer Status Data].

Bug: 16160962

Change-Id: I1f48ec055aa93dc836156525de8b7ef921aad8b5
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
25c20298ad04e0e591e0cfdc0bb9d01a985433ab 31-Jul-2014 Yuncheol Heo <ycheo@google.com> Add the CEC message handler for the standby mode.

- Associate the state of AutoWakeUp with the pref value.

Bug: 16661406
Change-Id: I1299c6ca287aac4127e397a08b5af00190aa5b0b
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
43c23e273e1b78caf26899eca5a4f51df9d52400 29-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Invoke input change listener at path change

Previously input change listener is not invoked if the routing change
does not cause the TV port change, but this failed to trigger the change
from an active source connected to port 1 to a non-cec device also
connected to port 1. Do this by comparing paths not ports.

Also did some cleanup:
- Avoid allocating empty lists too often for getActions
- ActiveSource.invalidate()

Change-Id: Id79531e2552ef7fa38bd604796108b8650db69a1
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
26ba7fddcaeb052710ca8672889830dabcbfd3ac 29-Jul-2014 Yuncheol Heo <ycheo@google.com> Make it pass CECT 11.1.3 System standby

- Accept the broadcast <Standby> message.
- Fix the bug that onStandyCompleted() is called mutliple times.
- Fix the issue that <Standby> message is not sent when going to
the standby state, since the local device was cleared already.

Bug: 16497304
Change-Id: Ib04ad2386621929814a801edd6b6c0e1a3902a7c
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
72b7d738d5b9254594726304cdb1777b54d95631 24-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Give clear distinction between active source/active routing path

Previously in HdmiControlSerivce, active routing path was mixed with
the physical address of the active source, but these two concepts needs
clearer distinction.

Defined a new variable for active source that contains both logical/physical
address to keep active routing path separate. This change makes it possible
to write the flow more closely to the guideline.

Also added to this CL is flag notifyInputChange, which allows the device/
routing change triggered by external event to trigger InputChangeListener
to get TIF notified. For routing control, the device info passed to TIF
has the path information in the field mPhysicalAddress (other fields are
invalid).

Bug: 16519939
Change-Id: I8b400bc48e874b0866500655773aea38ab945fe4
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
b6591b8e5399099dc6b7693e0fc719b613aba89c 23-Jul-2014 Jungshik Jang <jayjang@google.com> Implement OneTouchRecordAction and stop one touch record.

In addition to it, add api for clearTimerRecording as well.
Separately, I will replace logic for notifying message with callback
interface.

Bug: 16160962

Change-Id: I2368f7c697eb44ed4542c0ec4412c63a6ae41a5c
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
2c1d7b3b9f7afeddca69a90e395624907e2b63bf 12-Jul-2014 Yuncheol Heo <ycheo@google.com> Merge "Handle TODO in SystemAudioActionFromTv."
c516d65fd96cdc39f9935ddb80d26ee6499a77bf 11-Jul-2014 Yuncheol Heo <ycheo@google.com> Handle TODO in SystemAudioActionFromTv.

- Added onFinishedCallback to handle the deferred starting of FeatureAction.

Bug: 15843078, Bug: 15841546
Change-Id: I6cb5fba91d6115e8bb02c38601a72ed315c22e2f
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
a9f10629f4bc1a82761917645ff4d2b6d42e47b3 11-Jul-2014 Jungshik Jang <jayjang@google.com> Start address allocation when hdmi cec is re-enabled.

When a user turns hdmi cec on from system settings or other possible way,
hdmi control service should start over from logical address allocation.
As device discovery action from bootup is slightly different from
one from enabling hdmi cec, added additional params to all notification
method which is called when logical address allocation is done.

Bug: 16222082

Change-Id: Ib73be5f642646918b470d769dc563753c4ff48d3
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
c068bb5a0468bf605b0398e6f0ea5721917de4ee 07-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Support HdmiControlService.sendKeyEvent for both TV/playback device

Added another parameter deviceType for HdmiControlService to
run the specified local device for sendKeyEvent.

Bug: 15844076
Change-Id: I598ef320ae94bba0ace38701ae0ca12fd0625559
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
b3e114af17c91a409e766e111e472f600f7b866c 11-Jul-2014 Jungshik Jang <jayjang@google.com> Clear timout when all pending actions are cleared.

Remove disable_device_timeout message when all pending
actions are cleared, PendingActionClearedCallback#onCleared
is called.

Change-Id: I32e37c94c6a6dfc149da3bb0553d2a3238bae479
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
75a77e7d6cbfc287c6126efd28b338b48b7ea70c 09-Jul-2014 Yuncheol Heo <ycheo@google.com> Add HdmiCecMessageValidator to verify the incoming messages.

- Remove all param's length-check-logics in the package.

Bug: 16051295, Bug: 16117332, Bug: 15841545
Change-Id: If48ad9731f4f4613fd22aa3d9ada7ba3142bc999
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
8f2ed357a23fac4a55da43d20138b438b4ac79a7 07-Jul-2014 Jungshik Jang <jayjang@google.com> Handle <Set Osd Name> in TV.

When TV receives <Set Osd Name> it should update the name of
device and should notify them who are listening device changes.

Bug: 16115666
Change-Id: Ic3b60def8858ca5b7041202135d5dcaf47fa06e7
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
119160a68195bcb2f5bdf4a269807e01228eca97 07-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Add vendor-specific command API for HdmiControl

Vendor-specific commands are not handled by the service. This CL
opens an API for vendors to implement customized handling of
CEC commands specific to their needs.

Change-Id: I8bfa3b891bd7994a903b3b41d7c2b27464167afa
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
0f94217e9043e9dee329fa7167ee5be75eef0c23 04-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Merge "Add API setProhibitMode in HdmiControlService"
4d43d93743222311c6377d4904c19ccb93699d3b 03-Jul-2014 Jinsuk Kim <jinsukkim@google.com> Add API setProhibitMode in HdmiControlService

setProhibitMode sets a flag inside the service that indicates if
input switch request will be processed or not. Sets to true when
TV is doing something for which TV display should be fixed, like
channel scan, software update - collectively called 'prohibit mode'.

Change-Id: I8ac623023210b58b684b9af3ac475a5fe0d09435
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
210d73df0b77b4c8be67ecc92afb238dc8c7ccfa 04-Jul-2014 Jungshik Jang <jayjang@google.com> Remove duplicated cec keycode definitions.

Remove keycode (ui command) defined and use HdmiCecKeycode one.

Change-Id: I9a7c4be3e5cfd561c7353b9cda715d431c00ff0c
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
38db629d897e9d7c8e31ce0a7e985981e3e12996 01-Jul-2014 Yuncheol Heo <ycheo@google.com> Handle the power state change.

- Add BrocastIntent listener to catch SCREEN_ON/OFF intents.
- Add callbacks onTransitionToStandBy(), onStandBy() in HdmiCecLocalDevice.java.
- When it gets the SCREEN_OFF intent, the state will be TRANSITION_TO_STANDBY,
then when there is no outstanding actions, the state will be STANDBY.
- When the state is STANDBY, the TV device will broadcast <StandBy>.
- When it gets the SCREEN_ON intent, the state will be TRANSITION_TO_ON,
then when the initialization is done, the state will be ON.
- When the state is ON and it receives <StandBy> CEC message, it will force
the system to go to sleep.
- When the state is STANDBY and it receives the cec messages to wake-up the
system, it will force the system to wake up from sleep.
- Manage the active source state for the playback device.

Change-Id: Ib473219a0b0deb5224df89386db5a83720000411
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
92b77cf9cbf512e7141cad6fef5a38d0682dde43 27-Jun-2014 Jinsuk Kim <jinsukkim@google.com> Refactor handling sequences in HdmiControlService

- Rewrote some methods to match more closely to the handling
sequences in guideline
- Added setControlEnabled() API in the aidl
- Handled <Routing Control> command
- Handled some scenarios invoking RoutingControlAction

Change-Id: I5db0c6fc775cef709c2e0f338b85937deebf2a54
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
8fa36b110be29d92a9aba070fa4666eefb14b584 25-Jun-2014 Jungshik Jang <jayjang@google.com> Implement volume control action in cec service.

Hdmi CEC's volume control is based on key event handling
but in android we can only get delta of volume change.
VolumeControlAction simulates key event action from
delta of volume change. However, it's highly dependent
on <Report Audio Status> message coming from AVR.
This implementation waits 900ms for <Report Audio Status>
message and if no message arrives it finishes action.
Instead, HdmiCecLocalDeviceTv consumes it after action
termination so that Tv can reflect system audio's
volume all the time.

Change-Id: I0442d31721365acdc009c8fa1c1e0a4361e4a1cc
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
8333571bd5e0a08773a1679964f8d96227af3356 24-Jun-2014 Jinsuk Kim <jinsukkim@google.com> Handle incoming active source-related commands for HdmiControlService

Handles incoming commands <Active Source>, <Inactive Source>, <Request
Active Source> that concern the active source update/report.

Defined mPrevPortId which is used to allow switching back to the input
set previously by <Active Source> or deviceSelect() when receiving
<Inactive Source>.

Also fixed a bug sending <Active Source> with wrong parameters.

Change-Id: I47fd804755c5c6beca38ddb21bb388a455d74f63
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
a062a9339add79a84862a34e363e3e454a6ec435 18-Jun-2014 Jinsuk Kim <jinsukkim@google.com> Implement portSelect/sendKeyEvent for HdmiControlService

TIF (TV Input Framework) uses these API to switch inputs, send
keys for selected device on CEC bus. Also renamed getActiveInput
to getActivePortId to use a unified term for port/input.

Change-Id: I8196825c0d960988cc1c0bb58a628ccd8ab1957e
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java
60cffce420db4c3395f86d3b9bb36003adf26f5d 12-Jun-2014 Jungshik Jang <jayjang@google.com> Refine new device action.

There are many ways to initiate new device action
1. When receives <Report Physcial Address>
2. When receives <Active Source> from unregistered device.

If new device is audio system, it should start
ARC and system audio initiation action.

Along with this consolidate device remove actions.

Change-Id: I189afd8bec7270d6a1734a28632593b71932d9e8
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
0a3316bcfdac9f5f40d1349d97d10329c70f7e30 14-Jun-2014 Jinsuk Kim <jinsukkim@google.com> Boilerplate class for vendor-specific commands for HdmiControlService

Vendor-specific commands in HDMI-CEC protocol needs to be handled
by OEM. This CL introduces a boilerplate class that should be filled
in to handle it for TV device.

Change-Id: I56b9aac973f1cff27ea8654850334d2d5f6838fe
/frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.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/HdmiCecLocalDevice.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/HdmiCecLocalDevice.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/HdmiCecLocalDevice.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/HdmiCecLocalDevice.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/HdmiCecLocalDevice.java