2129 Commits

Author SHA1 Message Date
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
Raph Levien
eb1f5349f8 Merge "Fix for b7155617 race condition in TextLayoutCache.cpp" into jb-mr1-dev 2012-09-12 15:44:58 -07:00
Raph Levien
13ba4e478d Fix for b7155617 race condition in TextLayoutCache.cpp
There was the possibility for a race between clearing the caches and
using fonts. This patch simply protects both under the same mLock held
by the TextLayoutCache object.

Change-Id: Ib366e16a9a9ba702a46bc078d1bc0602713991e5
2012-09-12 15:15:51 -07:00
Eino-Ville Talvala
6fc7275d0e Merge "Camera: Add enableShutterSound method." into jb-mr1-dev 2012-09-11 11:06:13 -07:00
Eino-Ville Talvala
69fe527bea Camera: Add enableShutterSound method.
Some camera apps may wish to replace the system camera shutter sound
with their own, especially if they are taking rapid bursts of
images. Add method to allow this when possible.

Hidden for now.

Change-Id: I6520f5441d28675626fafab48c6609c589fc6f7e
2012-09-10 09:09:13 -07:00
Jamie Gennis
f09263e957 SurfaceTexture: add updateTexImage synchronization
This change makes the SurfaceTexture JNI updateTexImage call the native
SurfaceTexture's doGLFenceWait method to perform the needed synchronization.

Change-Id: Ie70a1fe6b44d439d1ffe7b97689a421ff8c02fda
2012-09-09 17:53:27 -07:00
Jeff Brown
7017e48380 Merge "Add support for Wifi display." into jb-mr1-dev 2012-09-07 16:00:13 -07:00
Raph Levien
965e7ff4de Merge "Fix Time.parse and Time.parse3339 crashing bugs. DO NOT MERGE" into jb-mr1-dev 2012-09-07 15:08:42 -07:00
Chet Haase
d15ebf25c5 Enable changing properties of layer paint
Previously, to draw a layered view with a changed Paint object for the
drawLayer operation, you'd have to invalidate the parent view, to get the
native DisplayList to pick up the new Paint properties. This change adds
API and functionality so that the developer can call setLayerPaint(), which
does the proper invalidation (lightweight, doesn't cause redrawing the view).

Issue #6923810 Make it easy to efficiently animate a layer's Paint

Change-Id: I7fea79788d50f6d9c86dd5e5b2a4490cb95142bb
2012-09-07 13:27:02 -07:00
Jeff Brown
cbad976b2a Add support for Wifi display.
Change-Id: I99693786cf9d07d07d3400046c55eb4933730b80
2012-09-07 13:26:31 -07:00
Elliott Hughes
5ef49427b6 Fix Time.parse and Time.parse3339 crashing bugs. DO NOT MERGE
Two reported by users, the other spotted by inspection.

Bug: http://code.google.com/p/android/issues/detail?id=16002
Bug: http://code.google.com/p/android/issues/detail?id=22225
Change-Id: I86fe022fda4af68e5a6fb9dc5dd2abdb75e9d966

This was committed to master, cherry-picking to jb-mr1-dev
2012-09-07 12:42:18 -07:00
Mathias Agopian
63f1c43fbe update to new SurfaceComposerClient API
Change-Id: I8f2c96df56fe3a851b8ec03bb8734db0b6bea3d5
2012-09-04 20:23:23 -07:00
Romain Guy
0baaac5e9a Revert "Revert "Add more support for transformed clip rects and paths""
This reverts commit a8557d2169e14997637f57bc897640c8882d4a46.

Change-Id: I36d4883d548fc47ba6c0b4a42012107d0d2f85a6
2012-08-31 20:31:32 -07:00
Mathias Agopian
a8557d2169 Revert "Add more support for transformed clip rects and paths"
this introduced a dead lock in GradientCache's ctor.

This reverts commit dfe082f63e94cde9aee271c94d13de5e7217e036.

Bug: 7096001
Change-Id: I57b8bbab11fb7cb502fa58e3bbf5d19864db874f
2012-08-31 20:04:18 -07:00
Romain Guy
703bd32647 Merge "Add more support for transformed clip rects and paths" into jb-mr1-dev 2012-08-31 17:18:04 -07:00
Romain Guy
dfe082f63e Add more support for transformed clip rects and paths
Change-Id: I41791b1e1bffef77d503dc9e52428395d2309688
2012-08-31 17:17:40 -07:00
Dianne Hackborn
4120375d46 Remove Binder.getOrigCallingUid().
Replaced all remaining places that used it with explicit user
specification.

While doing this, I ran into stuff that was creating PendingIntent
objects (that now need to specify the explicit user they are for),
which are also posting notifications...  but have no way to specify
the user for the notification.

So the notification manager in the system process now also gets a
formal concept of a user associated with the notification, which
is passed in to all the necessary aidl calls.  I also removed the
old deprecated aidl interface for posting/cancelling notifications,
since we now always need a user supplied.

There is more work that needs to be done here, though.  For example
I think we need to be able to specify USER_ALL for a notification that
should be shown to all users (such as low storage or low battery).
Along with that, the PendingIntent creation needs to be tweaked to
be able to handle USER_CURRENT by evaluating the user at the point the
pending intent is sent.

That's for another change, however.

Change-Id: I468e14dce8def0e13e0870571e7c31ed32b6310c
2012-08-31 15:11:13 -07:00
Zhou Chang
46e942d500 framework: fix bug for uninitialized variable
Some application display error due to uninitialized varibale.
This patch fix the bug

Change-Id: I660169e325ffae60d95c7774aaaeaebf693adf3d
Author: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chong Xing <chong.xing@intel.com>
Signed-off-by: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 45356
2012-08-31 10:53:04 +08:00
Jean-Baptiste Queru
38f197863a am 14c0c989: am 4ba4caed: Merge "Fix SkBitmap::fPixels not being locked correctly"
* commit '14c0c989d21531056a5d0a0739c3ffdd1b04b295':
  Fix SkBitmap::fPixels not being locked correctly
2012-08-29 12:00:10 -07:00
Jean-Baptiste Queru
14c0c989d2 am 4ba4caed: Merge "Fix SkBitmap::fPixels not being locked correctly"
* commit '4ba4caede125ff602b0d93f577f9054a07791ff7':
  Fix SkBitmap::fPixels not being locked correctly
2012-08-29 11:55:20 -07:00
Michal Stawinski
35ef567140 Fix SkBitmap::fPixels not being locked correctly
In some cases bitmap's pixels where freed during encoding, which
caused a null pointer dereference.
This fix makes sure that underlaying buffer is locked for the whole
process of compression.

Change-Id: I0ac56821f5d333072271dc2670fa30f1562adfa3
2012-08-29 15:54:01 +02:00
Jeff Brown
64a55af0ac Add plumbing for new surface flinger display API.
Cleaned up the implementation of Surface and SurfaceSession
to use more consistent naming and structure.

Added JNI for all of the new surface flinger display API calls.

Enforced the requirement that all Surfaces created by
the window manager be named.

Updated the display manager service to use the new methods.

Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
2012-08-27 14:34:54 -07:00
Jeff Brown
0b722fe9ce Use new surface flinger API.
Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211
2012-08-27 14:34:53 -07:00
Jeff Brown
572a0859dd Merge "Add FloatMath.pow." into jb-mr1-dev 2012-08-21 23:15:56 -07:00
Jeff Brown
e2c279e8a1 Add FloatMath.pow.
Change-Id: I5c584f4894caba47fccfa22ba95f8665990d516c
2012-08-21 22:27:41 -07:00
Victoria Lease
6fb73ab83f Merge "DO NOT MERGE Han Preference" into jb-mr1-dev 2012-08-20 13:11:43 -07:00
Kenny Root
80618d66b0 am 7d5b22af: am f029c22f: Merge "Use Libcore.os.umask for setting umask"
* commit '7d5b22afae8525cdf80ba1bf8e18b87d597f830d':
  Use Libcore.os.umask for setting umask
2012-08-20 12:57:36 -07:00
Kenny Root
7d5b22afae am f029c22f: Merge "Use Libcore.os.umask for setting umask"
* commit 'f029c22f82573e7fee7c7e0cca4439fe78300bac':
  Use Libcore.os.umask for setting umask
2012-08-20 12:55:11 -07:00
Kenny Root
4c74f8c171 Use Libcore.os.umask for setting umask
Libcore.os now provides a umask method call, so just use that since it's
available.

Change-Id: I8826fa40bcab3d61a424ff98a8050d3e44f7ec34
2012-08-20 12:24:05 -07:00
Billy Hewlett
ac1cbaf2e5 DO NOT MERGE Han Preference
Cherry-pick Ib5dd86950156c5a438f25c289acb839206bb455a from master.

Data: label MTLmr3m with "ja" locale attribute, fallback_fonts-ja.xml removed,
as we only need a single fallback font file
Code: Add locale and variant to TextLayoutCache.  Paint.java sets textLocale as
the language (for example, "ja") rather than the language/locale concatenated
(for example "ja_JP")

This checkin, along with Change-Id: Id8c91ae0be6cad8a7ef77a0cd5803676290986c1,
allows text view objects to set their locale dynamically and skia will use the
correct font for the locale.

Change-Id: Ieb60b0d7a39fcfef4f8ce90cd4f6065d33673710
2012-08-20 08:51:23 -07:00
Jeff Brown
98365d7663 Refactor for multi-display support.
Split WindowManagerImpl into two parts, the WindowManager
interface implementation remains where it is but the global
communications with the window manager are now handled by
the WindowManagerGlobal class.  This change greatly simplifies
the challenge of having separate WindowManager instances
for each Context.

Removed WindowManagerImpl.getDefault().  This represents the
bulk of this change.  Most of the usages of this method were
either to perform global functions (now handled by WindowManagerGlobal)
or to obtain the default display (now handled by DisplayManager).

Explicitly associate each new window with a display and make
the Display object available to the View hierarchy.

Add stubs for some new display manager API features.

Start to split apart the concepts of display id and layer stack.
since they operate at different layers of abstraction.
While it's true that each logical display uniquely corresponds to a
surface flinger layer stack, it is not necessarily the case that
they must use the same ids.  Added Display.getLayerStack()
and started using it in places where it was relatively easy to do.

Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
2012-08-19 22:42:08 -07:00
Kenny Root
9a994b5350 am 050c87f8: am a950daf5: Merge changes Ieb566a2a,I953057cd
* commit '050c87f87e2a48c7bc90f5b15fb6e4e37e667286':
  Use Libcore's stat instead of FileUtils#getFileStatus
  Use Libcore.os.stat instead of FileUtils
2012-08-16 16:43:20 -07:00
Kenny Root
050c87f87e am a950daf5: Merge changes Ieb566a2a,I953057cd
* commit 'a950daf5c14a0009c2c62e9c3e0e8d51eb0cf7d9':
  Use Libcore's stat instead of FileUtils#getFileStatus
  Use Libcore.os.stat instead of FileUtils
2012-08-16 16:33:40 -07:00
Kenny Root
520ee7bcad am a2e8365c: am 9b0da58e: Merge "Introduce a restorecon JNI binding."
* commit 'a2e8365cc883de0d3e56e9f4af350ecfe1b8fc4c':
  Introduce a restorecon JNI binding.
2012-08-16 15:32:52 -07:00
Kenny Root
a2e8365cc8 am 9b0da58e: Merge "Introduce a restorecon JNI binding."
* commit '9b0da58e3a30b760de37138cdd51d20f269c383e':
  Introduce a restorecon JNI binding.
2012-08-16 15:29:41 -07:00
Kenny Root
617ccc081f am 1090f702: Merge "Remove StatFs from AndroidRuntime JNI"
* commit '1090f7023abefc448a492e143f76f9e0925fd6ee':
  Remove StatFs from AndroidRuntime JNI
2012-08-16 15:29:34 -07:00
Kenny Root
98e15e7893 Use Libcore's stat instead of FileUtils#getFileStatus
Remove the last user of FileUtils#getFileStatus and move it to
Libcore.os.stat instead. Then we can remove the JNI code that does the
equivalent of a stat.

Change-Id: Ieb566a2a8a17c2dd0150724b4eb3ac1cc41c823d
2012-08-16 15:27:55 -07:00
Kenny Root
786cbcacd2 Use Libcore.os.stat instead of FileUtils
PackageManagerService just needed to know the owner for this file, so
just use stat instead so we can remove the old JNI code.

This is the last user of FileUtils#getPermissions so just remove the
FileUtils method as well.

Change-Id: I953057cd6b9de4410f33b6f22e4bddff02fe2988
2012-08-16 15:27:55 -07:00
Kenny Root
3f1e8b90b0 Remove StatFs from AndroidRuntime JNI
Change-Id: I88039794cf3e4a959b37c29c67f16f2dc0751a5c
2012-08-16 14:55:18 -07:00
Kenny Root
9b0da58e3a Merge "Introduce a restorecon JNI binding." 2012-08-16 14:38:30 -07:00
Kenny Root
89db6a40af Remove StatFs from AndroidRuntime JNI
Change-Id: I88039794cf3e4a959b37c29c67f16f2dc0751a5c
2012-08-16 14:31:31 -07:00
Kenny Root
a579f7926a am d69b47c0: am 8942e5a3: Merge "Use libcore Posix class for StatFs implementation"
* commit 'd69b47c087a87355df76a5276ab18af847f64367':
  Use libcore Posix class for StatFs implementation
2012-08-16 14:26:07 -07:00
Kenny Root
d69b47c087 am 8942e5a3: Merge "Use libcore Posix class for StatFs implementation"
* commit '8942e5a32ae2d1a36b65efe5b26cc06227ea0ca5':
  Use libcore Posix class for StatFs implementation
2012-08-16 14:22:31 -07:00
Kenny Root
bdd23ae9f5 Use libcore Posix class for StatFs implementation
Remove some JNI and duplicated functionality and use libcore's Posix
class for the statfs function instead.

Change-Id: Ic1e161dc10c18c2c6ee81d895a0efd8910086dbf
2012-08-16 10:55:47 -07:00
Jeff Brown
270e3381e7 Add FloatMath.hypot.
Change-Id: I6a5a7ea2254300614dbbf540f40e39dbec2d2900
2012-08-16 01:30:22 -07:00
mike wakerly
a3665ba95d UsbRequest: set ByteBuffer.position() upon success.
Also clears allocated buffer before copying.

Closes http://b.android.com/28023

Bug: 5385026
Bug: 6766413
Change-Id: Icf2c1d45db4fb2a9bd1fcfdb29aa7308034faaf0
2012-08-09 15:28:10 -07:00
Jeff Brown
1670dc9abf Merge "Add FloatMath.exp." into jb-mr1-dev 2012-08-08 18:29:08 -07:00