17 Commits

Author SHA1 Message Date
Jinsuk Kim
cbafd1b3ea Move logical address allocation logic into native service from HAL
Logical address logic is independent from hardware, and the algorithm is
standardized in the spec. Moved the logic to service so that all HAL
implementations doesn't have to duplicated logic inside.

Related change in HAL definition is in:
https://googleplex-android-review.git.corp.google.com/#/c/447951/

Change-Id: I9699309719f3214fc2dbdf219faad484c0c1c5bf
2014-04-21 07:42:35 +09:00
Jinsuk Kim
b11f250e09 Merge "Delegate HdmiCecService method impl to HdmiCecDevice subclass" into klp-modular-dev 2014-04-11 09:38:23 +00:00
Jinsuk Kim
61791075f4 Delegate HdmiCecService method impl to HdmiCecDevice subclass
Most of the methods in the interface IHdmiCecService should be implemented
based on the device type. This CL makes a change such that the HdmiCecDevice
just has stub methods that should be overriden by subclasses.

Other changes:
  - Fixed a bug of <Inactive Source> not sending its physical address
    in its message body. Also the command should have been sent to TV
    only rather than broadcast.

  - Put back sendGiveDevicePowerStatus interface method. It allows the client
    to keep track of the other device(like TV) power status more closely.
    Devices goes through the status from standby -> transient to on -> on
    but the CEC spec doesn't require that they broacast it actively.

    The restored method can be used to let the playback device to get
    up-to-date power status of TV/display when it is booting up.

    This method should work the same across all the device types. So it was
    implemented in the service, not delegated to HdmiCecDevice.

  - Send <Report Physical Address> when a new logical device is registered,
    which is required by CEC spec: "it should report the association between
    its logical and physical address by broadcasting <Report Physical
    Address>

Change-Id: Iac1d2cf5783d947f2dcd6965a54670fbdb8e6a63
2014-04-11 18:35:01 +09:00
Jeff Brown
037c33eae7 Plumb display power state through display manager.
Declare a new method, Display.getState() to retrieve the actual
power state of a display.

Improved documentation for Intent.ACTION_SCREEN_ON and
Intent.ACTION_SCREEN_OFF to clarify what they really mean in
terms of the interactive state of the device.

Deprecated PowerManager.isScreenOn() and replaced it with
PowerManager.isInteractive() with a more suggestive name and
better documentation.

Redirect display power state changes to go through the display
manager first and only then head over to the power manager for
legacy compatibility.

Eliminated the bright here and woke here policy flags since they
were unused.  Simplified the input dispatch policy somewhat.

Ensure that screen wake locks are respected up until the point
when dozing really begins.

Fixed a regression in DreamService where onDreamingStarted
might be called before onWindowAttached.

Bug: 13133142
Bug: 13472578
Bug: 13929355
Bug: 13760290
Change-Id: Iabef96921dd554ce3768fb18619cefc3230b5fb0
2014-04-10 20:46:14 -07:00
Jinsuk Kim
60b17cc094 Use build property for CEC device OSD name
Previously OSD name was based on device type. This CL makes it
independent of device type. CEC spec says "A device that implements
more than one type of CEC functionality should respond with the same
OSD name for each logical address. It is recommended that the name
refers to the complete physical product rather than the individual
CEC functionality".

Now the default name comes from system build property. I removed
setOsdName() from aidl for now since it won't be in use.

Change-Id: I3c9fb877fad4bc5efef56268d155a3f37a865fc2
2014-04-03 07:59:27 +09:00
Jinsuk Kim
40a00a341b Replace individual methods with a consolidated CEC nativeSendmessage
It saves us from having to add numerous native methods to HdmiCecService.
A new native method that reports physical address was added in consequence
to be able to build the message in Java side.

Other changes:
 - Substituted more concrete type (cec_device_type_t) to int.
 - Fixed the issue about byte endianness in handling physical
   address/vendor id. The bytes of variable mPhysicalAddress in native
   service were being reversed previously but still worked because they
   were reversed again when copied out to outgoing messages. Vendor id
   had a bug of bytes being reversed. In order to fix the issue, the way
   they are copied to byte array was changed so that it becomes
   independent to byte endianness.
 - CL's for header/HAL implementation changes are:
   https://googleplex-android-review.git.corp.google.com/#/c/437667
   https://googleplex-android-review.git.corp.google.com/#/c/437668

Change-Id: Id1ac683fe54597a2c707f30492c7f86e5392504d
2014-03-27 07:59:31 +09:00
Jinsuk Kim
c61f4dd744 Merge "Add HDMI-CEC service" into klp-modular-dev 2014-03-21 02:32:38 +00:00
Jinsuk Kim
4f512fb451 Add HDMI-CEC service
This CL adds a system service handling HDMI-CEC protocol. The service
is equipped with the capability sending/receiving HDMI-CEC messages

Not all the messages are in place. Currently it has messages to support
a few features only, as follows:

- One touch play
- System information
- Routing control (partially - active source status maintenance only)
- Device OSD transfer
- Power status

It will be extended to cover the wider usages in the follow up CLs.

The CEC standard version referenced in the implementation is 1.3a.

Change-Id: Ifed0b02f52ebf098eddb3bd0987efbf353b7e8fe
2014-03-20 16:40:22 +09:00
Chad Brubaker
7c2b1625d6 am 78f204ae: am 8e240af5: Merge "Remove SO_BINDTODEVICE from VPN protect" into klp-dev
* commit '78f204aed8c0f3c8174616801d66f96a9a00a5fd':
  Remove SO_BINDTODEVICE from VPN protect
2014-03-14 16:27:58 +00:00
RoboErik
ca9eef6203 b/12068020 Make kb layouts only unique to vendor/product. Do not merge
This is a cherry-pick of https://googleplex-android-review.git.corp.google.com/#/c/399886/

Instead of storing a kb layout per device descriptor (which is expected
to be unique), store it for each vendor/product. This way we can keep
a consistent layout between identical but physically different keyboards.

There are some corner cases this is expected to fail on, namely devices
that incorrectly have the same vendor/product id. Devices that don't
define a vendor/product id will continue to use the descriptor to store
layout files.

Change-Id: I1f2508561992080459310d5a644dad65a9c24f1a
2014-03-12 13:21:08 -07:00
Jeff Brown
2687550272 Add a new "doze mode" based on Dream components.
When a doze component has been specified in a config.xml resource
overlay, the power manager will try to start a preconfigured dream
whenever it would have otherwise gone to sleep and turned the
screen off.  The dream should render whatever it intends to show
then call startDozing() to tell the power manager to put the display
into a low power "doze" state and allow the application processor
to be suspended.  The dream may wake up periodically using the
alarm manager or other features to update the contents of the display.

Added several new config.xml resources related to dreams and dozing.
In particular for dozing there are two new resources that pertain to
decoupling auto-suspend mode and interactive mode from the display
state.  This is a requirement to enable the application processor
and other components to be suspended while dozing.  Most devices
do not support these features today.

Consolidated the power manager's NAPPING and DREAMING states into one
to simplify the logic.  The NAPPING state was mostly superfluous
and simply indicated that the power manager should attempt to start
a new dream.  This state is now tracked in the mSandmanSummoned field.

Added a new DOZING state which is analoguous to DREAMING.  The normal
state transition is now: AWAKE -> DREAMING -> DOZING -> ASLEEP.
The PowerManager.goToSleep() method now enters the DOZING state instead
of immediately going to sleep.

While in the doze state, the screen remains on.  However, we actually
tell the rest of the system that the screen is off.  This is somewhat
unfortunate but much of the system makes inappropriate assumptions
about what it means for the screen to be on or off.  In particular,
screen on is usually taken to indicate an interactive state where
the user is present but that's not at all true for dozing (and is
only sometimes true while dreaming).  We will probably need to add
some more precise externally visible states at some point.

The DozeHardware interface encapsulates a generic microcontroller
interface to allow a doze dream for off-loading rendering or other
functions while dozing.  If the device possesses an MCU HAL for dozing
then it is exposed to the DreamService here.

Removed a number of catch blocks in DreamService that caught Throwable
and attempted to cause the dream to finish itself.  We actually just
want to let the process crash.  Cleanup will happen automatically if
needed.  Catching these exceptions results in mysterious undefined
behavior and broken dreams.

Bug: 12494706
Change-Id: Ie78336b37dde7250d1ce65b3d367879e3bfb2b8b
2014-02-20 13:39:13 -08:00
Jeff Brown
38f96e5020 Add support for injecting events into ActivityContainers. (DO NOT MERGE)
Modified ActivityView to inject touch events it receives back into
its activity container.  The container then injects the event into
the input system along with the display id of the underlying virtual
display.

Enhanced the input system to support concurrent dispatch of touch
events on multiple displays which is required for this to work.

Change-Id: I9cf1870db3be6f99a52ed9a1e3ceafe42c940093
2014-02-11 14:43:04 -08:00
Narayan Kamath
583b7b1671 am 39a789bf: am 7ae1726d: am aa9ba887: am 6e09eb4c: Merge "AArch64: Make graphics classes 64-bit compatible"
* commit '39a789bf6efd5c3478a442e60e896cae371fd04c':
  AArch64: Make graphics classes 64-bit compatible
2014-01-28 19:26:29 +00:00
Mike Lockwood
43bc1c07d2 am d9e708e3: am 12ec2e6d: am 99206593: am 9607d78f: Merge "Added missing USB device descriptor fields needed for intent filters"
* commit 'd9e708e365d94e83ec135f1486129febd3f8eaea':
  Added missing USB device descriptor fields needed for intent filters
2014-01-08 16:08:17 +00:00
Narayan Kamath
e853de1f10 am 2d87407e: am 136c0219: am c156021d: am 8a927cfa: Merge "Fix a bug introduced in change 73712"
* commit '2d87407e5765228a3469b9681ebff6c0c7eee140':
  Fix a bug introduced in change 73712
2014-01-08 13:06:55 +00:00
Narayan Kamath
3f7b8d0c6c resolved conflicts for merge of 92ae0347 to klp-modular-dev
Change-Id: I703aea4f20985a4bbda0f685254721d6480bb20f
2014-01-08 12:19:40 +00:00
Amith Yamasani
9158825f9c Move some system services to separate directories
Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
2013-12-19 15:25:37 -08:00