2717 Commits

Author SHA1 Message Date
Glenn Kasten
04c58e9ec1 Merge "Java API for AudioTrack timestamps" into klp-dev 2013-09-04 22:29:19 +00:00
Glenn Kasten
948c2e6ff4 Java API for AudioTrack timestamps
This change adds android.media.AudioTimestamp and
android.media.AudioTrack.getTimestamp, with implementation, but hidden.

Change-Id: Ic314f04ff775baca05c57d19b5ea91133dbd0be1
2013-09-04 15:23:27 -07:00
Derek Sollenberger
2696797939 Revert workaround for Skia bug now that Skia has been fixed.
bug: 7170836
Change-Id: If357767a5f66d539f775bce766e963b3d0df38bf
2013-09-04 10:50:06 -04:00
Aravind Akella
b4c76b18a3 Sensor batching. Implementation for registerListener(with batch support) and flush APIs.
Bug: 10109508
Change-Id: I6dfdd986bd8c3368cb568fa7d90abf9c03de9aef
2013-09-03 17:02:41 -07:00
Leon Scroggins III
3f8da09136 Merge "Change name back to CreateJavaInputStreamAdaptor." into klp-dev 2013-09-03 17:37:10 +00:00
Leon Scroggins III
c779752508 Change name back to CreateJavaInputStreamAdaptor.
In order to fix open source builds, change WrapJavaInputStream's
name back to CreateJavaInputStreamAdaptor.

Remove FIXME in CopyJavaInputStream, and return a more generic type,
since the more specific type was only needed by a change in external/webkit,
which is being reverted since it depends on unreleased code.

Change-Id: I89b0431e357b509a2a0c17a624b31bd49d29070f
2013-09-03 11:35:00 -04:00
Jesse Hall
0fa257fe53 EGL10.eglCreateWindowSurface should set producerControlledByApp
Bug: 10521699
Change-Id: Ief3f01edf7dabc7996b7af1a756dfd00f0987f1a
2013-08-30 13:49:14 -07:00
Leon Scroggins III
4b2993123b Merge "Replace stream wrap-function w/ more specific ones" into klp-dev 2013-08-29 17:12:01 +00:00
Leon Scroggins III
ca32021b43 Replace stream wrap-function w/ more specific ones
The current stream wrapper returns a potentially incorrect
value for a call to getLength(), is typically copied into
another stream (not always in the same way), and doesn't
always take advantage of its underlying data (like when it
is an Asset). The overall goal of this CL is to provide the
caller with something that is ready to use, depending on
what is asked for. If a copy is desired, the copy is made
before being returned to the caller.

core/jni/android/graphics/Bitmap.cpp:

    Include SkStream.h, since it is no longer included by
    CreateJavaOutputStreamAdaptor's header file.

core/jni/android/graphics/BitmapFactory.cpp:

    Pass an SkStreamRewindable to decoding functions, as Skia
    decoders will be updated to only take an SkStreamRewindable
    (which makes more sense because they require rewinding).

    Call the more specific GetRewindableStream to get a
    rewindable stream.

    Remove copyAssetToStream which has been moved to Utils.

    In nativeDecodeAsset, pass forcePurgeable as allowPurgeable
    in doDecode. Technically the old code worked, but it checked
    the BitmapOptions again.

    Remove getFDSize, which is no longer used.

core/jni/android/graphics/BitmapRegionDecoder.cpp:

    Remove redundant buildSkMemoryStream. nativeNewInstanceFromStream
    now calls CopyJavaInputStream, which handles the copy.

    Copy the Asset directly, using common code, rather than creating
    an AssetStreamAdaptor to copy.

core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp:
core/jni/android/graphics/CreateJavaOutputStreamAdaptor.h:

    Provide new interfaces to access data from a Java InputStream.
    The new interfaces are more specific about what type of stream
    is desired.

    Use forward declarations where possible.

    Remove doSize, which gives a misleading answer to the question
    of how long the entire stream is.

    TODO: Only call FindClass etc once.

core/jni/android/graphics/Movie.cpp:

    Check for an asset stream, and use it if possible. Then call
    GetRewindableStream if there is not an asset.
    Remove the memory leak. Call DeleteLocalRef to delete the
    allocated memory.

core/jni/android/graphics/Picture.cpp:

    Call the new interface.

core/jni/android/graphics/Utils.cpp:
core/jni/android/graphics/Utils.h:

    Make AssetStreamAdaptor inherit from SkStreamRewindable so it
    can be passed to Skia decoding functions once they require it.

    Add CopyAssetToStream (moved from BitmapFactory.cpp) so it can
    be used by multiple files.

graphics/java/android/graphics/BitmapFactory.java:

    Remove the call to mark, which is now done natively.

    Remove the BufferedInputStream. Mark/reset is now handled
    by native code.

    Allow decodeStream to handle a FileInputStream by using the
    FileDescriptor, if it is seekable. In decodeFileDescriptor,
    call nativeDecodeStream instead of decodeStream so this new
    functionality will not loop.

    Call setDensityFromOptions in decodeFileDescriptor.

graphics/java/android/graphics/BitmapRegionDecoder.java:

    Remove the BufferedInputStream. Mark/reset is now handled
    by native code.

TODO: ADD TESTS!

Requires https://googleplex-android-review.googlesource.com/#/c/344317/

BUG=https://b.corp.google.com/issue?id=8432093

Change-Id: I4419b70b3482325c98ecc673dbfc4613f1b18581
2013-08-27 15:28:58 -04:00
Leon Scroggins III
2cc409ae52 Fix unpremul setting in BitmapRegionDecoder.
requireUnpremultiplied should be the opposite of BitmapOptions.
inPremultiplied, as in BitmapFactory.

Fixes CTS tests.

BUG=10490308

Change-Id: I21b8c057ccdc9b35c69730a7fe8c3b6802ee6dd8
2013-08-26 14:41:58 -04:00
Chong Zhang
1f3ecaae63 wifi-display: add certification options
When certification mode is enabled:

- Pass wfd session info to wifi display settings

- Allow sink to connect to source

- Add interface in display manager for pausing/resuming session

- Add interface in WifiP2pManager for setting lc, oc and starting
  autonomous GO

Note that we're compliant regardless of certification mode, but
some confusing options (eg. allowing incoming connection from
sink) we want to hide when not being tested.

Bug: 9371882
Change-Id: Icc7dcae4e046453796cfa03f5f197055fabf234b
2013-08-23 16:02:09 -07:00
Eino-Ville Talvala
d5ea6e113c Merge "Camera1: Rename setPreviewTexture to ...Target for clarity" into klp-dev 2013-08-22 00:50:55 +00:00
Elliott Hughes
d7a90ca50c The VM handles blocking SIGPIPE.
We don't need this any more.

Bug: 10211309

(cherry picked from commit 437e76208d451e7954699ead8931d0fe147bb07d)

Change-Id: I97b3ab4f65a70eacca2fbe95cfb11b1cc85c4021
2013-08-21 16:08:29 -07:00
Eino-Ville Talvala
7b29779d97 Camera1: Rename setPreviewTexture to ...Target for clarity
Bug: 10312644
Change-Id: I4bee90428cb932a12d73dad89e91bb2ef492dc86
2013-08-21 14:54:19 -07:00
Mathieu Chartier
67a4d32c0d Merge "Launch VM with -XX:LowMemoryMode if ro.config.low_ram is "true"." into klp-dev 2013-08-21 20:09:46 +00:00
Chris Craik
1abf5d6242 Add inPremutiplied option to BitmapFactory.Options, functionality in Bitmap
bug:2248948

Change-Id: I8fdd649332667598504a1076d5a447572bd53086
2013-08-20 18:29:33 -07:00
Mathieu Chartier
e6c2241f7a Launch VM with -XX:LowMemoryMode if ro.config.low_ram is "true".
Bug: 10131789

Change-Id: Ib9962f7becdedd71f48123a4720dcce1d09abb9d
2013-08-20 17:38:24 -07:00
Andy McFadden
59210de17c Merge "Avoid crashing in unlockCanvasAndPost" into klp-dev 2013-08-20 21:27:07 +00:00
Andy McFadden
ed55c8db1c Avoid crashing in unlockCanvasAndPost
It's possible to update the native surface pointer while the
surface is locked (via lockCanvas).  This leads to a surprise when
the surface is unlocked.  Avoid the surprise by tracking the
locked surface separately.

Bug 10289713

Change-Id: I84346c952be859bbd91ceae7df07b91dabe0948e
2013-08-20 11:23:17 -07:00
Eric Laurent
dfb881f96a AudioSystem: new audioflinger restart detection
Add a specific method to AudioSystem for AudioService to poll
for AudioFlinger service restart instead of relying on current
callback mechanism which is flaky.

Bug: 9693068.
Change-Id: Id21d142a22b257205700201978cce1cb8b15180d
2013-08-19 18:26:21 -07:00
Eric Laurent
539719a7af Revert "Fix media server restart detection mechanism"
This reverts commit ca35e4823459189dd57ec5472caf3a617d03b568.
2013-08-19 17:44:30 -07:00
Elliott Hughes
b93489270d Merge "Remove a fixed-length buffer in the wifi code." into klp-dev 2013-08-19 18:08:49 +00:00
Jeff Sharkey
d1da67017f Merge "Richer ParcelFileDescriptor close events." into klp-dev 2013-08-17 00:05:36 +00:00
Elliott Hughes
a11d574fc6 Remove a fixed-length buffer in the wifi code.
Also increase the size of the buffer we do need, simplify the code, and
fix some of the error checking.

(cherry-pick of 56968581ce77d3c0ee4286da6b0d5548874934b9.)

Bug: http://code.google.com/p/android/issues/detail?id=36193
Bug: 10363597
Change-Id: Iadd2ee25469a37ddf06c3292b675a4cbcc4ecfa3
2013-08-16 14:48:38 -07:00
Jeff Sharkey
da5a3e12f4 Richer ParcelFileDescriptor close events.
When reading from the end of a pipe or socket, there is no way to
tell if the other end has finished successfully, encountered an error,
or outright crashed.  To solve this, we create a second socketpair()
as a communication channel between the two ends of a pipe or
socket pair, sending a status code with details about why the
ParcelFileDescriptor was closed.

The writer end of a pipe or socket can closeWithError() to send a
message to the reader end.  When the reader encounters EOF, they
call checkError() to detect if any error occured.  This also detects
the case where the remote process died without sending a success
message.

This design is also extended to support regular files on disk, using
the communication channel above to detect various remote close events
or crashes, and delivering that event to a supplied OnCloseListener.

Replaces JNI with best-practice Libcore.os calls, and deprecates
some flags to match Context.

Bug: 10330121
Change-Id: I8cfa1e4fb6f57397667c7f785106193e0faccad3
2013-08-16 14:34:43 -07:00
Romain Guy
3ed72781a0 Convert 4444 bitmaps to 8888
Bug #10206452

Change-Id: I928c9189b0d80741490b01a739959d8c2d5312a7
(cherry picked from commit a2cdb59b186d0ee51f110c1a7d358911573d48bf)
2013-08-15 19:56:05 +00:00
Jeff Sharkey
e0475c8287 Gracefully handle missing directories.
Bug: 10295932
Change-Id: I9d18682d0ba57bf7f77d043ee8dab286ee80ba2a
2013-08-15 12:04:37 -07:00
Michael Wright
51b4a40ef5 Merge "Expose vendor and product IDs for InputDevices" into klp-dev 2013-08-13 00:04:08 +00:00
Michael Wright
54e56946d1 Expose vendor and product IDs for InputDevices
Change-Id: I08665a41e474cbedd10b342eeae20d2ca7c03ac0
2013-08-12 16:39:59 -07:00
Romain Guy
d1f6b6245c Merge "Take text alignment into account to compue text bounds Bug #10258621" into klp-dev 2013-08-12 20:52:13 +00:00
Romain Guy
b15b446f42 Take text alignment into account to compue text bounds
Bug #10258621

Change-Id: I91abf1829a1814410ce8c0c2c17d888031987f18
2013-08-12 13:25:29 -07:00
Colin Cross
cb4728f247 parse named anonymous memory for dumpsys meminfo
Treat [anon:libc_malloc] as native heap and anything else that
starts with [anon: as unknown.

Bug: 10212959
Change-Id: Ifd120ae86e7a22291383df37d2b96f9f2dcd68b9
2013-08-09 20:37:23 +00:00
Mathias Agopian
5893a97cbf Merge "fix-up dependencies to gl headers" into klp-dev 2013-08-09 04:39:55 +00:00
Mathias Agopian
e3eae73abb fix-up dependencies to gl headers
Change-Id: I9f176847587db1f9ccee2bc425106d277ffceee6
2013-08-08 21:09:16 -07:00
Jeff Sharkey
8a65f5b871 Merge "Allow packages.list access with new GID." into klp-dev 2013-08-09 00:44:55 +00:00
Jeff Sharkey
184a0100ab Allow packages.list access with new GID.
The FUSE daemon is using packages.list to map from package name to
appId after it drops permissions, so create a new "package_info" GID
to grant read access.

Also switches FileUtils to use Libcore.os.

Change-Id: I9451ca4e90e8a985526805c6df0888a244a1db36
2013-08-08 17:38:13 -07:00
Jonathan Dixon
427733280b Merge "Refactor Canvas.drawPicture() to delegate to Picture" into klp-dev 2013-08-09 00:36:03 +00:00
Jonathan Dixon
667fe1039f Refactor Canvas.drawPicture() to delegate to Picture
Bug: 9814370

To allow WebView.capturePicture() to return a subclass, we need to
ensure the subclass is always consulted when being drawn into a canvas.

Change-Id: Ia0357f95b6fafb3ac81e6bcfaef05739e619897a
2013-08-08 17:22:48 -07:00
Jeff Brown
0933570357 Merge "Use new ISurfaceComposer::destroyDisplay method" into klp-dev 2013-08-08 23:30:31 +00:00
Jesse Hall
6a6bc216d1 Use new ISurfaceComposer::destroyDisplay method
Bug: 10191053
Change-Id: I3ecc6880db4a4c77c6db4e8b50faa9b4021d17c6
2013-08-08 15:44:15 -07:00
Vinit Deshapnde
c249c2cc6b Use a single socket to communicate with supplicant
This helps to prepare for future updates from external sources.

Bug: 9298955

Change-Id: I4c63ad5fc1ea3564aab38cfce955de19bad75c0c
(cherry picked from commit fb40801ed8c217ae01082fb1cbd0c30bbf5532ac)
2013-08-08 18:38:53 +00:00
Glenn Kasten
d840526196 Merge "Update audio comments" 2013-08-07 17:17:56 +00:00
Mathias Agopian
24f43c9d2c put TextureView back to async mode
it's probably not strictly needed, but it guarantees
that the app won't deadlock itself while using a
TextureView -- this could happen if it blocked
in View.onDraw() waiting for the producer

this mimics the behavior TextureView always had.

Change-Id: I453339237a48dea91a10840b8cc0f5d2d84d1520
2013-08-06 20:16:12 -07:00
Glenn Kasten
86fad47e68 Update audio comments
Change-Id: If470efd77ed886da8d83a1b427c132bad77e668b
2013-08-06 13:38:16 -07:00
Mathias Agopian
52a9a10b6b Clearly separate consumer and producer interfaces
Bug: 9265647
Change-Id: Ic68e91788d0a05251e1d2fb9f9d4de403c7099bf
2013-08-06 13:07:42 -07:00
Jean-Baptiste Queru
3c9c091863 Revert "Revert "be more robust with handling unknown sensors""
This reverts commit 17548b3c70fe4f29d33367a61300f5323f5efe99.
2013-08-05 11:03:28 -07:00
Glenn Kasten
f7d280396c Merge "Replace run-time PCM encodings by compile-time constants" 2013-08-05 18:01:27 +00:00
Glenn Kasten
094010925a Merge "Explicitly compare raw pointers to NULL" 2013-08-05 17:27:29 +00:00
Glenn Kasten
4c59c54f77 Merge "Remove dead code in AudioTrack JNI" 2013-08-05 16:35:59 +00:00
Jean-Baptiste Queru
1e01943fe1 am ae311f4c: am 17548b3c: Revert "be more robust with handling unknown sensors"
* commit 'ae311f4c5f86779bb681b9fa8c1122dc174fea72':
  Revert "be more robust with handling unknown sensors"
2013-08-02 17:58:40 -07:00