82 Commits

Author SHA1 Message Date
Florin Malita
531fecca1c Merge "Encapsulate Canvas.mNativeCanvas" 2014-05-07 22:44:47 +00:00
Florin Malita
c677675e9c Encapsulate Canvas.mNativeCanvas
Currently, the native canvas is accessed/manipulated from several
unrelated classes.

In order to facilitate SaveFlags emulation, this CL encapsulates
the field and refactors its external users.

Two main changes:

* new getNativeCanvas() getter for use in Java-level clients.
* JNI canvas swappers (GraphicsBuffers, Surface, TextureView &
  AssetAtlasService) are refactored based on the exising/equivalent
  safeCanvasSwap() Canvas method.

Change-Id: I966bd4898f0838fb3699e226d3d3d51e0224ea97
2014-05-06 21:07:19 -04:00
Jungshik Jang
a9095ba488 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
2014-05-07 00:36:26 +00:00
Jungshik Jang
97babdc92b Fix unmatched jni method name.
It breaks systemserver

Change-Id: Iecc5600d64a273c4bbf51bd8fd779a79a3dab107
2014-05-02 13:21:15 +09:00
Jungshik Jang
e9c77c88ea 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
2014-04-30 14:29:04 +09:00
Michael Wright
15c32f2699 Merge "Move key attribute information into KeyEvent." 2014-04-29 22:31:06 +00:00
Jinsuk Kim
c79224e4b7 am 60037302: am 8fe27e88: Merge "Move logical address allocation logic into native service from HAL" into klp-modular-dev
* commit '60037302208be033442cc3f3c50a25c7064ebbd1':
  Move logical address allocation logic into native service from HAL
2014-04-29 21:38:19 +00:00
Jinsuk Kim
6003730220 am 8fe27e88: Merge "Move logical address allocation logic into native service from HAL" into klp-modular-dev
* commit '8fe27e881851921a90882f7d4da142bf936c5549':
  Move logical address allocation logic into native service from HAL
2014-04-29 21:35:01 +00:00
Michael Wright
337d9d2edc Move key attribute information into KeyEvent.
This consolidates all of the information that was in the native
KeyEvent and the KeyLayout files into the managed KeyEvent class.

It also moves the definition for all of the key names to the native
side, rather than having them in both places.

Change-Id: I172e3b554e7eb52c79ae2ec406ef4332e8b25ffa
2014-04-28 14:33:40 -07:00
Jungshik Jang
0792d37385 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
2014-04-25 08:37:51 +09:00
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
4bdcd299da am 55dab4dd: am b11f250e: Merge "Delegate HdmiCecService method impl to HdmiCecDevice subclass" into klp-modular-dev
* commit '55dab4dd3b5b56ade91c012d688b581b6cbdebdf':
  Delegate HdmiCecService method impl to HdmiCecDevice subclass
2014-04-11 09:43:37 +00:00
Jinsuk Kim
55dab4dd3b am b11f250e: Merge "Delegate HdmiCecService method impl to HdmiCecDevice subclass" into klp-modular-dev
* commit 'b11f250e09195d1ab250c93bfed0b31ed3a40f3d':
  Delegate HdmiCecService method impl to HdmiCecDevice subclass
2014-04-11 09:40:46 +00: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
4e5c089ef3 resolved conflicts for merge of 337e764d to master
Change-Id: I8168dbf42b68c2f7b5ccb300e0080dddc627af26
2014-04-11 01:33:20 -07:00
Jeff Brown
337e764deb am f24687e2: Merge "Plumb display power state through display manager." into klp-modular-dev
* commit 'f24687e2731811fd0e3803b691fd47a659f89329':
  Plumb display power state through display manager.
2014-04-11 03:49:37 +00: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
Michael Wright
118d113478 Merge "Fix size_t format specifier" 2014-04-04 23:51:36 +00:00
Ruchi Kandoi
654d75fec9 PowerManager: Fix build
fix build breaks by commit 667372e39bfe01bd15f0803d51ef0e9816f18808

Change-Id: I9e6e0f9146f860d27337cef0551c686ba2d60e23
2014-04-04 16:34:56 -07:00
Michael Wright
9ecba5269b Fix size_t format specifier
Change-Id: I7d4ce5e0c7bb4d9e0cc19edf68f30f6b2b054bc7
2014-04-04 15:29:53 -07:00
Leon Scroggins
7716b7d8ef Merge "Update to call new Skia APIs." 2014-04-04 20:31:00 +00:00
Ruchi Kandoi
f20a5eb279 PowerManager: add powerHint method
Add powerHint method to IPowerManager for passing power hints from other
processes.

Change-Id: Ic596ace2ed1796a6da4cddb2163dcc4536115e55
2014-04-04 20:24:16 +00:00
Leon Scroggins
cc11f15f76 Update to call new Skia APIs.
I816129d49c0118453222916f3c818eccac33663d merges a new version of
Skia that updates various APIs. Call the new ones.

SkBitmap::copyTo now takes an SkColorType instead of an
SkBitmap::Config, so do the conversion with
SkBitmapConfigToColorType or use the enum when it makes sense.

Call SkImageDecoder::decodeSubset instead of (deprecated)
SkImageDecoder::decodeRegion.

Override SkCanvas::ClipVisitor::clipRRect in ClipCopier.

In Canvas::clip calls, call SkCanvas::isClipEmpty(), which was
previously called inside the clip call, to determine the return value.

For various SkPaint effects, call the new factories (as the constructors
have been made protected).

Implement SkJavaOutputStream::bytesWritten(), overriding a new pure
virtual function on SkWStream.

Update Matrix calls to always return true (since SkMatrix calls no
longer return a value).

Depends on I816129d49c0118453222916f3c818eccac33663d (skia).

Change-Id: I5cdcea827ebff587df0bbddc0965e3e0fbf48002
2014-04-04 14:42:39 -04:00
Jinsuk Kim
f602835987 am f2fe3505: am 31518f74: Merge "Use build property for CEC device OSD name" into klp-modular-dev
* commit 'f2fe3505dac16dfa990fbab56713abab6ba0bc54':
  Use build property for CEC device OSD name
2014-04-03 02:11:40 +00:00
Jinsuk Kim
f2fe3505da am 31518f74: Merge "Use build property for CEC device OSD name" into klp-modular-dev
* commit '31518f745ffa5e832274c332ac957a065948fdaf':
  Use build property for CEC device OSD name
2014-04-03 00:39:23 +00: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
00bc283453 am 2e59bd78: am 41eaa32c: Merge "Replace individual methods with a consolidated CEC nativeSendmessage" into klp-modular-dev
* commit '2e59bd788546e29e48b85bda72da6af61704113d':
  Replace individual methods with a consolidated CEC nativeSendmessage
2014-03-31 01:50:56 +00:00
Jinsuk Kim
2e59bd7885 am 41eaa32c: Merge "Replace individual methods with a consolidated CEC nativeSendmessage" into klp-modular-dev
* commit '41eaa32c100d8a903daa7b7d09d34887a3e45ffd':
  Replace individual methods with a consolidated CEC nativeSendmessage
2014-03-31 01:44:51 +00:00
Narayan Kamath
ecd072161e resolved conflicts for merge of 22d07464 to master
Change-Id: Ic037261eedd6e224938c960d2b4597590c81ed9d
2014-03-27 14:22:47 +00:00
Narayan Kamath
22d074643e resolved conflicts for merge of eaab4df0 to klp-modular-dev-plus-aosp
Change-Id: I871431e5a3ce45a33563ced845e044d37471689b
2014-03-27 12:50:58 +00: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
Dianne Hackborn
a1bd79268b Battery stats: track actually running time
Use the uptime while creating the battery stats history to
generate a new event indicating when the CPU is actually running.
We can do this in combination with the new event reporting when
the CPU comes awake, looking at the difference between the
uptime and elapsed time at that point to determine when it last
when to sleep.

Also use this information to generate a new set of aggregated
states, the uptime caused by each wake reason.

Finally use new radio down timestamp to adjust the times we
compute for radio use.  Note that this information is not (yet)
being used to adjust how these are recorded in the history.

Change-Id: I723b3b526c8e7d64de0cac9d1193e04132d5a3e4
2014-03-21 16:14:59 -07:00
Colin Cross
a42cb8b0e2 resolved conflicts for merge of a67e34c8 to master
Change-Id: I597525886260884c9b2dfc7945e01eb8138a58c2
2014-03-21 13:11:02 -07:00
Jinsuk Kim
f2fecf48f7 am c61f4dd7: Merge "Add HDMI-CEC service" into klp-modular-dev
* commit 'c61f4dd744b1b0396703aa58eb22fc31d2b7050e':
  Add HDMI-CEC service
2014-03-21 02:37:00 +00: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
4b59883afd am 7c2b1625: am 78f204ae: am 8e240af5: Merge "Remove SO_BINDTODEVICE from VPN protect" into klp-dev
* commit '7c2b1625d66d3c80c313160f78c8bccd9499539e':
  Remove SO_BINDTODEVICE from VPN protect
2014-03-14 16:32:18 +00: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
306c46884e am ca9eef62: b/12068020 Make kb layouts only unique to vendor/product. Do not merge
* commit 'ca9eef6203b7cfb0084f8305d4dcc5d70a7a25cd':
  b/12068020 Make kb layouts only unique to vendor/product. Do not merge
2014-03-12 21:12:26 +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
Jason Gerecke
d522074232 Support unique calibration per orientation
Updates the format of the calibration XML to store the Surface rotation
that a specific calibration applies to. Also updates the API to require
a rotation value for get/set, and has the native framework supply this
according to the current rotation whenever it changes.

Change-Id: I72b6703f646dd18db537365c5c9843f720a5f41e
2014-03-10 16:33:48 -07:00
Jason Gerecke
857aa7be88 Initialize mAffineTransform and update on modification
This patch causes the InputReader to update its mAffineTransform to reflect
the currently-set calibration on startup and whenever its value is changed
through the InputManagerService.

Change-Id: I81c76e8cf168728ee140abaf148e1cd31687d5af
2014-03-10 15:54:21 -07:00
Dianne Hackborn
c51cf03cf2 Start recording wakeup reasons in battery history.
Depends on a modification to libsuspend so that we can get
a callback each time the device wakes up, to read the current
wakeup reasons from the kernel.  These are then stuffed in
to a new field in the battery history.

Also add new dump options --history-start and --charged
to better control what is dumped.

Finally the alarm manager uses a "*walarm*" tag for history
item wake locks that are coming from a wakeup alarm.

Change-Id: I457571973d5b2b5fdc4e4b63ab16275db20d7edd
2014-03-07 15:18:45 -08:00
Chad Brubaker
f87b224849 Merge "Remove SO_BINDTODEVICE from VPN protect" 2014-02-28 19:28:45 +00:00
Derek Sollenberger
4915fb22c7 Merge "Cleanup unnecessary includes for libskia." 2014-02-27 18:09:31 +00:00
Mike Lockwood
7531aa2235 Add support for USB devices with multiple configurations and alternate interfaces
Added UsbConfiguration class, as well as accessors to UsbDevice to get configuration list
Added methods to UsbDeviceConnection to select configurations and alternate interfaces.

Also added accessors for USB descriptor name strings and fixed some memory leaks in the JNI code.

Bug: 12425052
Change-Id: Idb990f4d5c054a8cb997eb3f440f6da9f83bce05
2014-02-27 09:59:02 -08:00
Derek Sollenberger
950fe8f8d4 Cleanup unnecessary includes for libskia.
The libskia target exports all of its public includes directories so
redefining them here is redundant. Also this cleans up and makes it
obvious where the framework is making using of private Skia headers.

Change-Id: Ie7ecc9ddd3df780bed6b9af54ba58ca58274e043
2014-02-27 16:21:24 +00:00
Greg Hackmann
4418372b21 am 5f652b9f: am 0cab896a: resolved conflicts for merge of 9e413bf4 to klp-modular-dev-plus-aosp
* commit '5f652b9fdfbcc279353955f7ef86b72d2ef9f5fb':
  open("/dev/rtc0") failure in AlarmManagerService.setTime() should be non-fatal
  Move time setting code from SystemClock to AlarmManagerService
2014-02-22 00:46:52 +00:00
Greg Hackmann
0cab896a98 resolved conflicts for merge of 9e413bf4 to klp-modular-dev-plus-aosp
Change-Id: Ibc41f0248235afca9546829e00b31003d09f4f7e
2014-02-21 16:35:52 -08:00