2175 Commits

Author SHA1 Message Date
Irfan Sheriff
511d5346ce Stop supplicant and dhcp before start
Bug: 7227463
Change-Id: Iaa0df7522edc38d25fae2bbda8d24490e997e733
2012-11-06 15:53:32 -08:00
Jamie Gennis
cd79b35c38 Merge "Surface: add the PhysicalDisplayInfo#secure field" into jb-mr1-dev 2012-10-23 15:22:37 -07:00
Jamie Gennis
95429c3d1b Surface: add the PhysicalDisplayInfo#secure field
Bug: 7368436
Change-Id: I38bf7bbfca354380c30da7516f628cf40416d350
2012-10-23 15:07:22 -07:00
Chet Haase
74261d847f Merge "Don't null the reference to Bitmap pixels until we're really ready" into jb-mr1-dev 2012-10-22 15:46:43 -07:00
Chet Haase
547e66531d Don't null the reference to Bitmap pixels until we're really ready
A change in the VM triggers a native memory error more aggressively than before,
showing that there's a bug in the logic of recycling bitmaps. Since the pixel
memory is allocated on the Java heap, nulling out the reference to that memory
in the Java level Bitmap object can cause that memory to get collected at any time.
Meanwhile, we may have a reference to that memory at the native level for rendering
purposes, causing an error if/when we access that memory after it has been collected
by the VM.

The fix is to avoid setting the reference to the pixels to null unless we are
not referring to it in native code. This is determined at the time we call
recycle() - we return a boolean to indicate whether the native code is still
using the memory. if not, the Java code can null out the reference and allow the
VM to collect it. Otherwise, it will get collected later when the encompassing
Bitmap object is collected.

Issue #7339156 HTML5 tests crash the app (Vellamo)

Change-Id: I3a0d6b9a6c5dd3b86cc2b0ff7719007e774b5e3c
2012-10-22 15:25:19 -07:00
Jamie Gennis
7bbf8163fb Set the secureness when creating displays
This change makes use of the new 'secure' argument to the
ISurfaceComposer::createDisplay method.  In this change both the overlay and
wifi displays are hard-coded to be non-secure displays.

Bug: 7368436
Change-Id: Ib65312f2adab5104d8deefbfc32af9dc106a9129
2012-10-19 18:34:35 -07:00
Romain Guy
b2e2f24706 Take into account the texture layer's transform for clipping
Bug #7370212

Change-Id: Ibdc3161306f54a1cfe66e08458f05ee01a13b1df
2012-10-17 18:18:35 -07:00
Bart Sears
0ee71adde0 Merge "Fix native crash while saving a panorama." into jb-mr1-dev 2012-10-17 10:20:50 -07:00
Wu-cheng Li
4b63f14c96 Fix native crash while saving a panorama.
YuvToJpegEncoder should handle the case when the height is not
multiples of 16.

bug:7165606

Change-Id: I02f142b233c4f5c0cd8df5e3d1eaebbf62d28052
2012-10-17 18:06:59 +08:00
Romain Guy
713e1bb9df Add API to enable mipmaps on Bitmap
Bug #7353771

This API can be used when scaling large images down to a small size
to get nicer looking results.

Change-Id: If09087eed36077eee5355f6047a3ca67747d7d9e
2012-10-16 18:44:09 -07:00
Jamie Gennis
b6ce6e42cc Flag window animation transactions as animations.
This change makes WindowManager use the new eAnimation flag when animating
windows.  This prevents some of the window updates from being combined with
updates from prior animation frames.

Bug: 7353840
Change-Id: I5a9f8fa2c1a2f5f08363a45cd9f28bb97cd77080
2012-10-15 19:19:50 -07:00
Keun young Park
c378656d5e Merge "fix wrong read size in ToColor_S4444_Opaque" into jb-mr1-dev 2012-10-12 13:41:19 -07:00
Keun young Park
038953da05 fix wrong read size in ToColor_S4444_Opaque
- S4444 takes 16bits, not 32bits
- This caused sporadic failure in CTS BitmapFactoryTest#testDecodeStream4

Bug: 7179389
Change-Id: Ib36a3a569b3149d74f36ae67a069a7b65a72e895
2012-10-12 11:36:13 -07:00
Jeff Brown
c51cb89dd6 Fix off-by-one.
Bug: 7330567
Change-Id: I8653435c77daefa24991595f68b9f23dd930f14a
2012-10-11 15:58:49 -07:00
Jeff Brown
9cf36b7a77 Don't process UEvents in Dalvik unless they match a pattern.
On some devices, vsync is delivered from the kernel to userspace
over a netlink socket via UEvent.  The result is that a thread wakes
up, reads a message, creates a new String then searches it for matches
against a pattern on every single frame.

Reduce the overhead by performing the initial pattern matching in
native code.

Bug: 7326329
Change-Id: Icb22db1c38330694207bec1153840e0c06f502d6
2012-10-10 21:46:55 -07:00
Jean-Michel Trivi
d677054ca6 Don't play notifications during speech recognition
Add support for querying AudioManager to know whether speech
 recognition is currently underway.

Don't play a notification if speech recognition is underway.

Bug 7314859

Change-Id: I1bd013a3168cfe1a6b6dcfd28565e1c3c512eb6a
2012-10-10 12:03:41 -07:00
Eino-Ville Talvala
cbdb213646 Merge "Camera: Query AudioService for shutter sound enforcement." into jb-mr1-dev 2012-10-09 15:21:36 -07:00
Eino-Ville Talvala
4f8e5ce21d Camera: Query AudioService for shutter sound enforcement.
The AudioService now tracks the shutter sound enforcement status, in
addition to the existing approach. Check with it when doing shutter
sound operations.

Bug: 7032634
Change-Id: Ief855d3a36ca5679832cf439f5638b10f70b8636
2012-10-08 23:53:48 -07:00
Jeff Brown
9e316a1a2a Blank or unblank all displays as need.
Ensures that both the internal display and HDMI are blanked
or unblanked in tandem.

Bug: 7309812
Change-Id: Ie8b96d393e8bb20d23c92f3320142d9f7cf42aff
2012-10-08 19:23:15 -07:00
Raph Levien
577b07197b Fix for 7281523 android.text.cts.SelectionTest#testMoveRight failures
The failures were caused by the implementation of doTextRunCursor
passing a too-small value for contextCount into the underlying
getTextRunAdvances call (it wasn't accounting for the start offset).
Thus, when getTextRunAdvances made a copy of the text for its cache key,
it was getting a partial copy.

This patch fixes the size so the cache key always has a full copy of the
text.

Change-Id: I57e3ac6de7aef0e1f1c7000dc3d653f9b0d623d2
2012-10-04 23:15:12 -07:00
Raph Levien
e174ae210e Fix for testPaintFlagsDrawFilter CTS test
This fixes bug 6948776
android.graphics.cts.PaintFlagsDrawFilterTest#testPaintFlagsDrawFilter
failures on JO

When we moved the drawing of text decorations (underline, strikethrough)
from Skia to our own drawing (so we could take into account the metrics
computed by TextLayoutEngine), we just used the raw flags from the
paint, which ignored the overrides that a DrawFilter can effect.

The patch simply checks for the existence of a DrawFilter in the canvas,
and applies it to a copy of the paint where present. This will be one
extra paint copy where the filter exists, but that's expected to be rare
(other than running this CTS test, of course).

Change-Id: I664c478b73a3a1cc43599ee11bbc02c69b7a96c2
2012-10-03 15:26:47 -07:00
Raph Levien
217ca3b0d3 Merge "Fix for bug 7234184 F/TextLayoutCache: Failed to put an entry..." into jb-mr1-dev 2012-10-02 13:02:31 -07:00
Raph Levien
832815cb53 Fix for bug 7234184 F/TextLayoutCache: Failed to put an entry...
This bug was triggered by user code concurrently mutating the character
array while calling into a drawText method in another thread. When the
value of the array changed, it caused inconsistent state, leading to
assert failures.

This is arguably bad behavior by the user code, but it shouldn't cause a
native crash. The fix is to do a defensive copy of the text into the
key, so the value is guaranteed to remain constant throughout the text
layout process. The change is mostly deletion of code, because there was
an optimization to try to avoid such a copy. That optimization was not
actually effective, however, because the indexOfKey() operation in the
KeyedVector underlying the TextLayoutCache did the copy anyway. Thus,
even though this change looks like it's introducing a copy where there
wasn't one before, the actual performance impact should be nil.

Note that the ability to handle a mutating argument is now part of the
contract for TextLayoutEngine::getValue(), and is now documented. That
contract may change, as the result of future optimization. Also, care
was taken to only use the value after the copy.

Other performance issues with TextLayoutCache are tracked in bug
7271109.

Change-Id: I9c90e8e4d501f3f37e2f22a7851f032808d46fbe
2012-10-02 12:32:40 -07:00
Ian Rogers
e983008863 Fix target utilization property_get.
Copy and paste error where wrong compare meant the code thought a target
utilization option was specified even if there wasn't one.

b/7062303

Change-Id: Ibf1c6cf72743c5fbec7618a719d12d0373184754
2012-10-01 14:59:39 -07:00
Chet Haase
6a2d17f713 Fix texture corruption
When memory gets low on a device, activities flush everything they can.
Hardware-accelerated activites, such as Launcher, flush GL resources and destroy
the GL context. However, some resources were still hanging around, due to deferred
destruction policies (we don't delete layers until the DisplayLists they are in
are finalized, to ensure we don't deref deleted objects). This meant that we were
referring to obsolete GL data in these objects. in particular, it meant that we might
come around later, after a new GL context was created, and delete a texture object
that was incorrect. We use the layer's "texture id" to refer to the texture underlying the
layer. But if there's a new GL context, then this texture ID is no longer valid, and
we may be deleting the texture that a different object (layer, icon, whatever) is referring
to, because the driver may return that same ID under the new GL context.

The fix is to more aggressively delete things that we know will not be used again
when the GL context is destroyed. In particular, we delete all resources being used
by all DisplayLists at GL context destruction time.

Issue #7195815 Textures corruption on all devices, in many apps

Change-Id: I52d2d208173690dbb794a83402d38f14ea4c6c22
2012-09-30 15:35:08 -07:00
Raph Levien
54801e120a Merge "Fix for bug 6936752 Tamil text gets truncated on right-hand side" into jb-mr1-dev 2012-09-28 11:14:48 -07:00
Jeff Sharkey
dd78d462f6 Fix JNI method signature.
Change-Id: I156624e0ac55330f43d9c4d7f15d59f6c529aa0a
2012-09-26 18:46:08 -07:00
Glenn Kasten
c6c4365ddb Implement android.media.AudioManager.getProperty()
Bug: 6635041
Change-Id: I0e7d53b99559cdc89f2f107f23048e4b1a8dd383
2012-09-25 17:01:40 -07:00
Romain Guy
ef09a210dd Don't destroy the same texture twice
Bug #7221449

SurfaceTexture already deletes the GL texture when detachFromContext
is invoked. The newly introduced refcount would casue the Layer
object to be destroyed later and attempt to delete the GL texture
again. By the time the second cleanup occurs, the texture name
might have been reused by somebody else, resulting in erroneous
behaviors.

Change-Id: I257c589fea64b34c00f46fbfaa7732e6854a5e41
2012-09-25 12:22:21 -07:00
Ian Rogers
a8a7e7140d Merge "Extra GC heap configuration parameters." into jb-mr1-dev 2012-09-25 11:34:35 -07:00
Raph Levien
1b10241a8f Fix for bug 6936752 Tamil text gets truncated on right-hand side
The getTextRunAdvances() method wasn't accounting for the true width of
the text. On closer examination, in Tamil the clusters consist of a
number of glyphs each of which has a nonzero advance (in some other
scripts, the first glyph in the cluster has an advance, and others are
effectively zero). Previously, we were just using the advance of the
first glyph in the cluster. This patch changes the behavior to sum the
advances of all the glyphs within the cluster.

Change-Id: I77a51235f4bb0dfaa72cbb920a8c3b217ad25404
2012-09-24 16:14:38 -07:00
Romain Guy
87e2f757be Add a property to disable libhwui's scissor optimization
Bug #7158326

When scissor optimization is enabled, OpenGLRenderer will attempt to
minimize the use of scissor by selectively enabling and disabling the
GL scissor test.
When the optimization is disabled, OpenGLRenderer will keep the GL
scissor test enabled and change the scissor rect as needed.
Some GPUs (for instance the SGX 540) perform better when changing
the scissor rect often than when enabling/disabling the scissor test
often.

Change-Id: Idb68862e287a23358f9188d577ae0f86161902fd
2012-09-24 11:47:52 -07:00
Ian Rogers
5325010486 Extra GC heap configuration parameters.
Allows parameters to increase the maximum free size. b/6606849

Change-Id: Ia74ccdbb8e32954820e3bd26f441b2c2fac889f4
2012-09-23 16:38:03 -07:00
Eino-Ville Talvala
5ce25d7170 Merge "NEW_API: Add android.hardware.Camera.CameraInfo#canDisableShutterSound" into jb-mr1-dev 2012-09-21 16:05:59 -07:00
Jeff Brown
e87bf03076 Support HDMI hotplug.
Bug: 7206678
Change-Id: Ia5212b16658a5f5a2ccf8528eca7bebd45ca857a
2012-09-21 15:34:32 -07:00
Romain Guy
3f7c246f3e Merge "Update layers in a single batch at the beginning of a frame Bug #7186819" into jb-mr1-dev 2012-09-21 10:50:12 -07:00
Romain Guy
11cb642756 Update layers in a single batch at the beginning of a frame
Bug #7186819

Change-Id: Ice5926dfedfb3be3a3064e65008dafa2852407da
2012-09-21 00:39:43 -07:00
Raph Levien
3034d45104 Merge "Fix for native crash on image decode OOM" into jb-mr1-dev 2012-09-20 23:25:26 -07:00
Raph Levien
005bfc694d Fix for native crash on image decode OOM
When decoding an image with scaling, if the allocation of the bitmap
data for the scaled bitmap failed, we were just ignoring it and going
on. This was yielding strange native crashes (bug 7196860 and bug
7175536). This patch checks whether the allocation succeeds, and returns
a null bitmap if not.

Of course, if the app really is OOM because it's allocated too many
bitmaps, it'll still get the OOME, but that's a lot nicer than a native
crash or memory corruption.

Change-Id: I8384059ab11c2ab9e93e283b9438d79e6709b7b1
2012-09-20 22:51:47 -07:00
Zhihai Xu
77f6677bcd Merge "ISSUE 6849488 Bluedroid stack, remove system/bluetooth." into jb-mr1-dev 2012-09-20 16:41:02 -07:00
Zhihai Xu
a3ae439425 ISSUE 6849488 Bluedroid stack, remove system/bluetooth.
remove system/bluetooth stuff.

bug 6849488
Change-Id: I9ea87c9cd60d5ecfa0d58d28301554e716cd2893
2012-09-20 10:47:06 -07:00
Eino-Ville Talvala
f7c6c5ad64 NEW_API: Add android.hardware.Camera.CameraInfo#canDisableShutterSound
Allow applications to check if the camera shutter sound can be
disabled.

Bug: 7172643
Change-Id: I3e9184325d3676b24830cc5418ebca8dcade8697
2012-09-19 14:31:26 -07:00
Jamie Gennis
94998c9c4e Merge "SurfaceTexture: remove call to doGLFenceWait" into jb-mr1-dev 2012-09-18 14:32:01 -07:00
Andy McFadden
923c18b142 Merge "Plumb display name into SurfaceFlinger" into jb-mr1-dev 2012-09-18 09:23:30 -07:00
Jamie Gennis
917a3b34a3 SurfaceTexture: remove call to doGLFenceWait
This call is no longer needed as the default behavior of the native
SurfaceTexture class is to do the wait whenever updateTexImage is called.

Change-Id: I995686a5989409e21b00fac913bd33c11f806998
2012-09-17 19:00:19 -07:00
Andy McFadden
3bcbad7bcb Plumb display name into SurfaceFlinger
Pass the display name into SF's createDisplay().

Bug 7058158

Change-Id: Ia21f07063db2c2fb5a34d6526e16d4b2d3694377
2012-09-17 18:32:40 -07:00
Chet Haase
603f6de35f Fix occasional crash bug with layers
Launcher occasionally crashes with a stack trace indicating that the memory
of a Layer object is corrupt. It is possible for us to delete a Layer
structure and then, briefly, use it to draw a DisplayList again before
that DisplayList gets recreated (without the layer that got deleted).

When this happens, if the memory got corrupted, it's possible to crash.

The fix is to add Layer to the other objects which we currently refcount
(bitmaps, shaders, etc.). Then instead of deleting a Layer, we decrement the
refcount. We increment when creating it, then increment it again when it's
referenced from a DisplayList. Then we decrement the refcount instead of
deleting it, and decrement when we clear a DisplayList that refers to it.
Then when the refcount reaches 0, we delete it.

Issue #6994632 Native crash in launcher when trying to launch all apps screen

Change-Id: I0627be8d49bb2f9ba8d158a84b764bb4e7df934c
2012-09-17 11:21:34 -07:00
Elliott Hughes
08153ee01e Switch DateUtils and Time over to using the CLDR for all week and month names.
(cherry-pick of 99c406e42ba154584070ca7ec100e8be7ff8a800.)

Conflicts:

	core/res/res/values-fa/donottranslate-cldr.xml
	core/res/res/values/public.xml

Bug: 6811501
Change-Id: I2ad9608ae34804e02c6b0271197e96611df12b0a
2012-09-14 20:22:17 -07:00
Raph Levien
c1eff0857e am e5905684: am eceb3171: am f4afc401: Merge "framework: fix bug for uninitialized variable"
* commit 'e590568417aa824e7b0e76ae727556d329cb57cf':
  framework: fix bug for uninitialized variable
2012-09-14 12:19:03 -07:00
Raph Levien
eceb317116 am f4afc401: Merge "framework: fix bug for uninitialized variable"
* commit 'f4afc40101c00800c4dc53f165b93f741327416d':
  framework: fix bug for uninitialized variable
2012-09-14 12:15:03 -07:00