5081 Commits

Author SHA1 Message Date
Victoria Lease
df64ac688d ask skia to use flat gamma when rendering fonts from hwui
Bug: 13748392
Change-Id: I6930629b8e900628f15354f663b86dfb29a4db78
(cherry picked from commit b66270eac288de53207e55d10879b070a0ec8b6b)
2014-04-22 22:54:10 +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
John Spurlock
6c191299a7 Introduce new UI_MODE_TYPE_WATCH and qualifier.
Default ui mode to watch if we have FEATURE_WATCH.

Bug:13395758
Change-Id: Ie5ff95de60e69e91ad3612c7d2f1fca7f49061bd
2014-04-04 15:21:53 -04:00
Michael Wright
4932a355f1 Merge "Misc. buttons aren't gamepad keys." into klp-modular-dev 2014-04-02 20:26:36 +00:00
Michael Wright
f46b5d466d Misc. buttons aren't gamepad keys.
BUTTON_[1-9] are intended to be misc. buttons so the kernel will
assign them to non-gamepad devices.  As such, we shouldn't treat them
as belonging to gamepads at all.

Bug: 13432364
Change-Id: I9495760f2379e44785b9ce1cf018b6db7f6cb0f4
2014-04-01 15:43:43 -07:00
Michael Wright
1b10869f39 Generate and respect ACTION_CANCEL for joystick fallbacks. DO NOT MERGE
Also change MotionEvent.PointerCoords bit packing and unpacking
methods to be consistent with BitSets which are now used on the
native PointerCoords object.

Bug: 11480300
Change-Id: Ib18c99b94ac555104c69eac526860aa501e89e03
2014-03-26 14:56:07 -07:00
Michael Wright
69e58e446b Merge "Add idc config option for handling key repeats" into klp-modular-dev 2014-03-20 01:55:16 +00:00
Chris Craik
29f00c9f35 am 7c9bd98a: am 89513ee5: Merge "Fix projection offset caching - DO NOT MERGE" into klp-dev
* commit '7c9bd98a4bb0aa6954d5f612c197d03f309980f0':
  Fix projection offset caching - DO NOT MERGE
2014-03-20 01:14:44 +00:00
Chris Craik
5d39a77992 Fix projection offset caching - DO NOT MERGE
bug:13214038

Because the caching of projection matrix didn't account for changes in
the offset flag, the flag could be ignored. Now we use both to verify
that the cached matrix can be used.

Change-Id: I193b94eaf0b98f046a6484f0866c3d25048653fd
(cherry picked from commit d04a6b15f74035fd2068f34225825b55e94521f4)
2014-03-19 20:09:04 +00:00
Michael Wright
39ca052292 Add idc config option for handling key repeats
Bug: 13285870
Change-Id: Iea2a5d03e29c86dcee5f99a25e48736ebc6dd913
2014-03-17 14:13:25 -07:00
Leon Scroggins III
f8d8777ddd Update framework to use M33 Skia. DO NOT MERGE
(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
  the length (read(NULL, 0)) is no longer implemented, since it is
  no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
  so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
 const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
 const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
 const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33

Conflicts:
	core/jni/android/graphics/Bitmap.cpp
	core/jni/android/graphics/Graphics.cpp
	core/jni/android/graphics/Typeface.cpp
	graphics/java/android/graphics/Bitmap.java
2014-03-17 13:57:18 +00:00
Michael Wright
d23d916e0f Merge "Controllers must have buttons and a movement mechanism." into klp-modular-dev 2014-03-13 00:37:10 +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
RoboErik
c1e0015ec3 b/12068020 Add a way to add uniqueness to device descriptors. Do not merge
Cherry pick from https://googleplex-android-review.git.corp.google.com/#/c/398226/

This adds an integer to the descriptor of devices without uniqely
identifying information. It will reuse values that are no longer
in use, so if you remove a single device and attach a different
identical device it will appear to be the same device.

TODO: Derive uniqueness from USB port when possible. This version
will generate different descriptors for each half of a USB keyboard
that shows up twice.

Change-Id: Ie628f19c01469f6ec2d354cd00000898ac6432fa
2014-03-12 13:20:57 -07:00
Michael Wright
b0aa4822f5 Controllers must have buttons and a movement mechanism.
Some devices have joystick axes or DPad keys, but no gamepad buttons
(or vice versa). We shouldn't count these as gamepads since games
can't really be expected to work with this setup in the general case.
Instead, require that a device has a movement mechanism (joystick
axes or DPad buttons), as well as at least one gamepad button before
considering it a controller.

Bug: 13432364
Change-Id: Ia113c8441557d4c858c1e5740a3e1c7e0e9fdcdd
2014-03-12 12:58:53 -07:00
Michael Wright
ed28fc89e3 Utilize new Android LED constants. DO NOT MERGE
Also, have EventHub manage game controllers' player LEDs

Change-Id: Ic7dba19ad236a3c7d1aff5d3f938bd239b98d51d
2014-03-11 14:52:18 -07:00
Leon Scroggins III
5e49b497ae Update framework to use M33 Skia. DO NOT MERGE
(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
  the length (read(NULL, 0)) is no longer implemented, since it is
  no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
  so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
 const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
 const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
 const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
2014-03-06 12:14:47 -05:00
Jeff Brown
6ca90042b3 Add touch.wake IDC property to control wakeup.
Normally we do not wake the device when the internal touch screen is
touched.  This behavior can now be configured by setting a property
in the input device configuration file.  Add the following line to
the IDC file to enable an initial touch to wake the device from sleep.

  touch.wake = 1

Change-Id: Ifd6d4f51afacd30d85f475725a66e6fcccde9cbb
2014-02-26 15:15:53 -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
1cd2834fde am 30e20ac5: am ebd43d46: am dff83e2b: am d5970e9c: Merge "AssetManager cookies should be int32_t and not void*."
* commit '30e20ac528731a778eec45506d1e57c8839b318a':
  AssetManager cookies should be int32_t and not void*.
2014-01-27 12:07:15 +00:00
Narayan Kamath
745d4efc83 AssetManager cookies should be int32_t and not void*.
Cookies are really indices into vectors and arrays, so
they don't need to be void*. We choose int32_t instead
of size_t to allow their width to be well specified.

(cherry picked from commit ebfdd0f467e39c3af8d92cade78263935340acb7)
(cherry picked from commit a7fa2e592e2e579e5acdb903dba83fc074ebc215)
(cherry picked from commit a9d5701b034ed2d9771b3f0943e1add00741d7cd)

Change-Id: I2aed3db568b6fdc487bf99e2c5dd123206736fda
2014-01-27 11:20:24 +00:00
Chris Craik
ee846d3e74 am 38cf0704: am e9a7d229: am 66b5a2b2: am 5150eb8f: Merge "Initialize pointer members to NULL to avoid illegal reference"
* commit '38cf0704f6fbfa6d41d5d10488ce25e645adb835':
  Initialize pointer members to NULL to avoid illegal reference
2014-01-17 19:30:31 +00:00
lina.x.pi
920287399a Initialize pointer members to NULL to avoid illegal reference
mBitmap and mTexture is not initialized to NULL which causes
illegal address access when it fails to be created from
oversized bitmap.

Change-Id: Iea54bec8788bc5f3a10040fdb43f416c0d41a14c
2014-01-17 13:49:26 +09: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
Tim Murray
804ff38bff Handle user-defined cache path for RS.
Change-Id: I92e3346dca331ae6a9dfbe4f95292bc604dfd196
2013-12-18 17:04:04 -08:00
Narayan Kamath
070274ec0c Add libutils dependency for libandroidfw host build.
Change-Id: I7fe0bb466f0b1cdbfef8934da2231ad20f05b648
2013-12-11 16:48:07 +00:00
Narayan Kamath
afd31e0829 Reimplement ZipFileRO in terms of libziparchive.
This lets us share zip archive processing code with both
the runtime (Art, dalvik) and critical java code
(StrictJarFile).

This change also moves several utility methods to ZipUtils
and dedups code across several zip inflation methods.

One of the side effects of this change is that several
processing loops are now O(n) instead of O(n^2).

bug: 10193060

Change-Id: I3c7188496837a47246c4f342e45485a70fef3169
2013-12-09 16:23:16 +00:00
The Android Open Source Project
dbccd44a63 Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
2013-11-22 11:18:57 -08:00
Digish Pandya
a5ff739d3c Update the layer's alpha value upon composition of the layer
Fixes: This patch makes sure that the layer's alpha value is
up-to-date and does not reflect the previous view's alpha value.
it fixes the square block on marquee fading edge when text view
is applied transparency.

Change-Id: I110649db72a75fecc02ba56c201a05773f80328c
2013-11-05 09:22:37 +05:30
Elliott Hughes
c367d48c55 Fix a variety of small publicly-reported bugs.
Possible NULL dereference in cmds/bootanimation/BootAnimation.cpp.
https://code.google.com/p/android/issues/detail?id=61556

Missing fclose in core/jni/android_os_Debug.cpp.
https://code.google.com/p/android/issues/detail?id=61546

Bad loop guards in core/jni/android_util_Process.cpp.
https://code.google.com/p/android/issues/detail?id=61557

Assignment to wrong variable in libs/androidfw/AssetManager.cpp.
https://code.google.com/p/android/issues/detail?id=61560

Missing delete[]s in libs/androidfw/ObbFile.cpp.
https://code.google.com/p/android/issues/detail?id=61549

Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I5820f3824e72d07a9acb776cf0af3e7443f5694a
2013-10-29 13:12:55 -07:00
Romain Guy
318ae7bb92 Take SkBitmap's stride into account when uploading textures
Bug #10151807

Change-Id: I7ba4804fa3619088fea70eb55f10519fff0bf5f0
2013-09-25 22:31:31 +00:00
Chris Craik
d8a84a8609 Merge "Correct bitmap merging logic" into klp-dev 2013-09-21 00:33:36 +00:00
Chris Craik
996fe65634 Correct bitmap merging logic
bug:10863163

This fixes two issues

The check for pure translation was incorrect. It was fixed and renamed
for clarity.

Certain matrix paths weren't setting kTypePositiveScale. For
simplicity (and because positive scale is simple to check) removed
flag in favor of dynamic checking.

Change-Id: Ic5ce235653ef49a68b8b242bd89fc2e95874ecc9
2013-09-20 17:25:31 -07:00
Victoria Lease
16c84069a4 fix emoji clipping in hw draw path
I guess we don't want to overwrite the last line in every RGBA glyph
with our one-line texture atlas spacer?

Bug: 10841207
Change-Id: Ief85ca58650c731e9d21dbf90942b7b44670abcc
2013-09-19 15:38:21 -07:00
Chris Craik
ce9ee16d65 Merge "Conservatively estimate geometry bounds" into klp-dev 2013-09-18 01:50:02 +00:00
Chris Craik
a42ceb03cf Merge "Disallow negative scale matrices in merged Bitmap drawing" into klp-dev 2013-09-18 01:49:32 +00:00
Chris Craik
32f05e343c Conservatively estimate geometry bounds
bug:10761696

Avoids a case where a rect with top coordinate of (e.g.) 0.51f is
assumed to not draw in the first row of pixels, which leads to it not
being clipped. Since rounding can cause it to render in this first
pixel anyway, we very slightly expand geometry bounds.

Now, in ambiguous cases, the geometry bounds are expanded so clipping
is more likely to happen.

Change-Id: I119b7c7720de07bac1634549724ffb63935567fc
2013-09-17 17:48:14 -07:00
Chris Craik
d965bc5823 Disallow negative scale matrices in merged Bitmap drawing
bug:10622962

Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3
2013-09-16 18:19:55 -07:00
Chris Craik
5af5fc50c2 Fix merged operation clipping
bug:10745870

Missing 'const' meant MergingDrawBatch would never clip anything.

Change-Id: Ia6367eff94cf5f437efafbc3ba7f0da102ffd956
2013-09-13 14:44:08 -07:00
Romain Guy
1de466fc91 Always disable the clip for layers
Bug #8149344

Change-Id: Ifd413cadb171232eb846b3d91b05b2d2457b9f35
2013-09-12 23:13:38 +00:00
Chris Craik
88ee0dac81 Merge "Move DeferredDisplayState out of ops" into klp-dev 2013-09-12 22:08:54 +00:00
Chris Craik
c1c5f08702 Move DeferredDisplayState out of ops
bug:9969358

Instead of storing DeferredDisplayState within an op (thus forcing ops
to be tied to a single state instance), associate each op with a new
state at DeferredDisplayList insertion time.

Now, DisplayLists (and the ops within) can be reused in a single
DeferredDisplayList draw call, as ops will use different state
instances at different points in the frame.

Change-Id: I525ab2abe0c3883679f2fa00b219b293e9ec53d9
2013-09-12 13:33:01 -07:00
Kenny Root
1c7cf90af4 Fix another off-by-one error in ZipFileRO
Bug: 10424836
Change-Id: I491458bd31ef39e87127d061427b32a3d59ac807
2013-09-11 15:28:39 -07:00
Kenny Root
0d6c2d7b9d Reconcile differences between zip implementations
Reconcile the difference between ZipFileRO and java.util.ZipFile to have
the same behavior.

Bug: 10424836
Change-Id: I6bde1bad7e20065ee650945fd43a913c05ce5ac7
2013-09-11 11:44:40 -07:00
Kenny Root
0c4b3646b0 Revert "Reconcile differences between zip implementations"
This reverts commit 9ffddc7eb50653cf60ce6b27a0e1945eed5b5ce1.

Change-Id: Ifeba63511211bfc2b375f2205e319e91403b7d06
2013-09-11 18:10:09 +00:00
Kenny Root
9ffddc7eb5 Reconcile differences between zip implementations
Reconcile the difference between ZipFileRO and java.util.ZipFile to have
the same behavior.

Bug: 10424836
Change-Id: Iff159c9e1a91b59f6c5346dc0278cb9e4bbc1a39
2013-09-11 00:29:18 +00:00
John Reck
874ae2adf8 Merge "Fix scissor for functor invocation" into klp-dev 2013-09-10 21:03:48 +00:00
Tim Murray
7a454ba5fe Fix FontRenderer bug.
bug 10691313

Change-Id: Icd5341a3c2066e337911f040ddc935c48c8d7cd1
2013-09-10 13:46:49 -07:00
John Reck
25d2f7bc1f Fix scissor for functor invocation
Bug: 10677765
 enableScissor() must precede setScissorFromClip() as
 otherwise setScissorFromClip() doesn't do anything.
 Also make sure to call setScissorFromClip() if
 enableScissor() returns true as enableScissor() calls
 resetScissor() if the scissor state has changed.

Change-Id: I9226b20bb256c92066aae344e4e6407540b6eae9
2013-09-10 20:45:29 +00:00
Tim Murray
9578e64240 Add flags word to initialization.
bug 10427951

Change-Id: I1356b9b96315ead44aa3898de5604d75f9bb8be5
2013-09-09 16:23:27 -07:00