1185 Commits

Author SHA1 Message Date
Jean-Michel Trivi
68622396b6 Bug 5045498 Keep track of RemoteControlClient play state change time
Store the time at which a RemoteControlClient changes it playback
 state, and send that time to the IRemoteControlDisplay.
This change will enable displays to implement strategies such as
 timeouts (e.g. to not display transport controls for clients which have
 been paused or stopped for a certain amount of time).

Change-Id: I902882500565743d455d56f6000efaf612cbe0a9
2011-09-20 11:59:51 -07:00
James Dong
92d0a64b90 Merge "Add QVGA resolution to CamcorderProfile" into ics-factoryrom 2011-09-19 20:06:52 -07:00
James Dong
07b9ae3312 Add QVGA resolution to CamcorderProfile
Change-Id: Icebbafb68d8164370f98a2c36699845d10ef081b
related-to-bug: 5145483
2011-09-19 19:32:26 -07:00
Jean-Michel Trivi
f0cff04562 Bug 5300223 RemoteControlClient uses PendingIntent for media button events
Update the implementation of the RemoteControlClient / Display
 feature rely on PendingIntent as provided in the construction
 of the RemoteControlClient instance.
The ComponentName that describes the target of the media button
 events is set as the target of the Intent from which
 a PendingIntent is constructed.
This ComponentName is still saved in the stack for persisting
 the last media button event receiver.

This CL also updates the lockscreen IRemoteControlDisplay
 implementation to use the PendingIntent supplied by the
 application when sending transport control events. A (good)
 side effect of doing this is that intent will be directly
 targeted at the application.

Restoration of the media button event receiver
 after reboot is not fully functional yet.

Change-Id: I2be82f2839e9dee1de02512437b3fb41cc386cde
2011-09-16 12:40:43 -07:00
Jean-Michel Trivi
34d0d300ca Fix bug 5327199 Recycle bitmaps in RemoteControlClient
When applying the new bitmap from the editor to the client,
 recycle the old bitmap, and set the reference to the editor
 bitmap to null.

Change-Id: I7d79e4b8410e5035fa51b20be4b1ada391c84c28
2011-09-16 11:33:50 -07:00
Eric Laurent
16066ec591 Merge "Issue 5044873: Pb with BT SCO AudioManager API" 2011-09-14 09:18:23 -07:00
Jean-Michel Trivi
e83f771f0a Merge "Bug 5300223 RemoteControlClient uses PendingIntent" 2011-09-14 09:05:36 -07:00
Eric Laurent
d7454be47f Issue 5044873: Pb with BT SCO AudioManager API
Do not identify the SCO connection client by the binder interface
passed when starting the connection as this binder changes if the
AudioManager proxy changes. Use the client PID instead.

This solves an issue with gTalk starting a SCO connection from one
AudioManager proxy and then changing audio mode from another thus
terminating the previously started SCO connection.

Change-Id: Ia3067fecc551fc15df3bf75ce0c43d181859e4f0
2011-09-14 08:45:58 -07:00
Jean-Michel Trivi
6e920e6dac Bug 5300223 RemoteControlClient uses PendingIntent
API change so RemoteControlClient is given a PendingIntent in
 its constructor, which will be used for receiving media button
 events from remote controls.
Leave the old constructors (but hidden) to not break
 current functionality until the AudioManager and AudioService
 implementations have been updated.

Change-Id: Ifa12c8036c948931adc386a827dce2936788e1cd
2011-09-13 19:27:20 -07:00
Dianne Hackborn
48c5fb1493 API review: Metadata class not used.
The Metadata class doesn't actually seem to be used with anything
in the SDK, and the API probably needs some work, so hide it.

Change-Id: Ifecf49130b90cbb4c588ad8104f1e7957978f789
2011-09-13 16:24:45 -07:00
Marco Nelissen
02ea7d4877 Merge "Fix bug 5045498 Unhide Remote Control Client API" 2011-09-09 08:44:19 -07:00
Eric Laurent
ebf6478f55 Merge "Fix issue 4673378: switching from VoIP to GSM call" 2011-09-09 08:27:04 -07:00
Eric Laurent
9f103de83f Fix issue 4673378: switching from VoIP to GSM call
The problem is that any app can change the audio mode and override
a mode previously set by another app. If two apps (gTalk and Phone) compete
for audio mode ownership, there is no mechanism to maintain coherency
in the actual audio mode selected.

Added a mechanism in AudioService to manage an audio mode request stack.
Any app requesting a mode different from NORMAL enters at the top of the stack
and the requested mode is applied. When an app sets mode back to NORMAL, it exits
the stack and the new mode corresponding to the request at the top of the
stack (if any) is applied.

Change-Id: I68d1755d0922f680df4a19bfc5ab924f5a5d8ccd
2011-09-08 19:23:56 -07:00
Chih-Chung Chang
70ad1c378b Merge "Fix 5156702: rotate thumbnails" 2011-09-08 05:52:44 -07:00
Chih-Chung Chang
47a52158d2 Fix 5156702: rotate thumbnails
Change-Id: I97b51dadf129172d5b154e9dfd66da254e4559d7
2011-09-07 19:20:45 +08:00
Marco Nelissen
671db6f3ba Fix startBluetoothSco race
Change-Id: I8b711bd3c6b12f2e3e92144c0dadac72261bf914
2011-09-06 16:51:21 -07:00
Jamie Gennis
2e6f49cc81 Merge "MediaPlayer: remove the setTexture method" 2011-09-05 14:50:33 -07:00
Chih-Chung Chang
09bb20b5f6 Merge "Fix 5240036: Generate a reasonable bitrate for intermediate clips." 2011-09-04 19:36:20 -07:00
Eric Laurent
dca56b9432 Fix issue 5252593: any app can restart the runtime
Replace null device address string by empty sting.

Change-Id: I285c35f3345334e6d2190493b1a8a5aca1a361a4
2011-09-02 15:59:50 -07:00
Jamie Gennis
83fb94d188 MediaPlayer: remove the setTexture method
This change removes the MediaPlayer#setTexture method.  It has been
replaced with MediaPlayer#setSurface.

Change-Id: Iaecbbac7629d7092883f270694c5c67391f4ed6c
2011-09-02 15:48:52 -07:00
Dave Burke
fc301b0bb5 Require INTERNET permission for network-based content.
Bug #1870981

Change-Id: Ia3ad166390c4d60cea19c3783895b078a2c4c15f
2011-09-02 11:26:59 +01:00
Chih-Chung Chang
8b1f350993 Fix 5240036: Generate a reasonable bitrate for intermediate clips.
Change-Id: I96bf9a7d0e2ce78fd19cce7bccbd4ac318748709
2011-09-02 18:19:54 +08:00
Jean-Michel Trivi
466ade5ad6 Fix bug 5045498 Unhide Remote Control Client API
The RemoteControlClient API enables media application to have
 information such as album art, current song, playback state
 be displayed on "remote control displays", as well as be
 controlled by "remote controls".
The new API consists in:
 - a new class, RemoteControlClient
 - new methods in AudioManager to register a RemoteControlClient
 - a new class, RemoteControlClient.MetadataEditor to edit and
  apply the information associated with a RemoteControlClient,
  and which will be displayed on a "remote control display"

Change-Id: I5616085e4ad58ce0bbc1a5953b0a5a28d32f8703
2011-09-01 16:13:50 -07:00
Jean-Michel Trivi
a6ec356d2f Merge "Fix 5243349 RemoteControlDisplay incorrectly updated" 2011-08-31 19:02:59 -07:00
Jean-Michel Trivi
b716f0b7b2 Fix 5243349 RemoteControlDisplay incorrectly updated
This fixes a case where the RCD would display transport control
 for a RemoteControlClient that didn't have audio focus.
This was happening because registering an RCD was directly calling
 the updateRemoteControlDisplay method, without first calling
 the checkUpdateRemoteControlDisplay method which verifies the
 conditions before updating the display. One of those conditions
 is that the audio focus stack shouldn't be empty.

To verify this fix, several functions were also rename to clearly
 indicate the lock order and verify we properly synchronize on
 the right objects. In doing so, a missing synchronization on
 audio focus was found.

Change-Id: If1baaac224ea676aeb83ac0aefcc53f87461c32e
2011-08-31 18:24:04 -07:00
Rajneesh Chowdury
270bcaa9d1 Merge "Fix for 5156702 Rotate video output for thumbnails and export" 2011-08-31 17:14:52 -07:00
Eric Laurent
16b241a58f Merge "Change condition to enter silent mode." 2011-08-31 12:59:28 -07:00
Jean-Michel Trivi
3387945766 Fix 5242200 only update RemoteControlDisplay when a client is present
A precondition for updateRemoteControlDisplay_syncRcs() is that
 mRCStack is not null. This condition was not verified when
 registering a RemoteControlDisplay.

Change-Id: I0b152410e57c590114b387e9ab83f0c4d15d060d
2011-08-31 11:52:16 -07:00
Eric Laurent
3d4c06f907 Change condition to enter silent mode.
Previously, silent mode was entered if volume was already at 0 and
volume down key was pressed once.

The new volume management policy specifies that silent mode is entered when
volume is at last audible step and volume down key is pressed once.

Change-Id: Id3e75a99c522d8afe276868010b6e73495d23fde
2011-08-31 09:47:24 -07:00
Jean-Michel Trivi
5ad4b9fb96 RemoteControlClient metadata: add method for metadata of long type
Update to the RemoteControlClient.Editor API:
 - new method for setting metadata of type long
 - methods for setting metadata throw an exception if using
    the wrong key with the wrong method.

Note that this change will cause the Music2 application to
 throw an exception when it tries to set the duration as a string.

Change-Id: I17cff86467851a0aff313c07653e752ae6b6180f
2011-08-30 18:42:33 -07:00
Jean-Michel Trivi
2261c7d645 Merge "Bug 5045498 Force display update when display registers" 2011-08-30 15:14:12 -07:00
Jean-Michel Trivi
958bba6862 Bug 5045498 Force display update when display registers
When an IRemoteControlDisplay registers, cause the
 RemoteControlClient to send all its information to the newly
 registered display.
The previous code was only sending a request for update: this
 request didn't here cause the client to send the data because
 a new client generation had not been synchronized among clients
 and displays.
This CL uses the same code path to force an update as when audio
 focus changes, or a new client registers, by calling the same
 method that is called in those cases,
 updateRemoteControlDisplay_syncRcs(flags).
Also in this CL: more method renames to indicate methods that
 are called synchronized on mRCStack.

Change-Id: I54102f45ba1cd4812d958ecd883bec7bc45ae88f
2011-08-30 14:48:31 -07:00
Jamie Gennis
8d102eb672 Merge changes I33f59705,Ia4c8c822,I2fb695ab,I2e587afc
* changes:
  MediaDump: use the MediaPlayer#setSurface method
  HTML5VideoView: switch to MediaPlayer#setSurface
  MediaPlayer: unhide the setSurface method
  Surface: unhide the SurfaceTexture ctor
2011-08-30 14:38:56 -07:00
Rajneesh Chowdury
c847b1a89d Fix for 5156702 Rotate video output for thumbnails and export
This is part of a multi project submit.
This is the Java and Jni changes.

Change-Id: I8851f5d865e657b7846bcded38e752f388f95895
2011-08-30 12:44:44 -07:00
Rajneesh Chowdury
8f7bf02506 5106773 Can't export a movie - Error returned from OMX API in ducati
Video Editor engine wrongly set the profile in place of level.
So level was always 1 (default value for Profile)

Change-Id: I202f866d32e81869d9692174d59d9d777a772282
2011-08-29 20:16:22 -07:00
Jamie Gennis
b283dc64bc MediaPlayer: unhide the setSurface method
Change-Id: I2fb695ab918d1099ad7cc51bfd436712a0b640d9
2011-08-29 14:33:10 -07:00
Jean-Michel Trivi
db8a361629 Update IRemoteControlDisplay when it registers.
When an IRemoteControlDisplay registers, it must receive information
 from the current client.

Change-Id: Id845e7a87ac74c2db2c59e0281b28a45f8d20528
2011-08-29 09:57:18 -07:00
Jean-Michel Trivi
7309c83b95 Cannot compare Binder references for RC display to unregister
Cannot trust references to IRemoteControlDisplay to remain the
 same when removing a RemoteControlDisplay, compare the
 result of .asBinder() instead.

Change-Id: Ib2e82aa24bd4b12804bccff94a6a0090ff83bea8
2011-08-26 18:54:44 -07:00
Jean-Michel Trivi
18e7bce523 Address multiple RemoteControlDisplay competing for registration
The RemoteControlClient / Display feature only supports one
 display. If multiple displays are registered, this CL implements
 the following policy:
 - cannot unregister a display that is not the current one,
 - registering a display when another is already registered
    causes the old one to be unregistered.
This fixes a death handler leak where the previous display was
 simply overwritten, without unlinking to its death.

Change-Id: I63f8a38093796e0960761936d7fc58d47b7589b3
2011-08-26 18:14:29 -07:00
Jean-Michel Trivi
6e679d5a53 Don't try to rescale when no bitmap in RemoteControlClient
If a RemoteControlClient has a null artwork, do no attempt to
 rescale the bitmap, it's ok to send a null bitmap to the
 IRemoteControlDisplay.

Change-Id: I8332ccfcf18107ea0b41d4e7fa232d7f68798efc
2011-08-26 11:57:42 -07:00
Jean-Michel Trivi
3094d955b8 Fix deadlock in AudioService
Locks related to audio focus and remote control should always be
 taken in the following order:
 1/ audio focus lock
 2/ remote control stack
 3/ current remote control client generation

Change-Id: If8be11bfef92849957e692b2bd52adbd67a2ef0b
2011-08-24 19:08:48 -07:00
Jean-Michel Trivi
4b6df6a3dc More information for RemoteControlDisplay about new client
When the client gets cleared, let the display know the new
 client generation ID is for a clear.
When a new client becomes current, let the display know
 what the associated media button event receiver is.

Change-Id: I18e37a309b5b30ed361a68918379b60418409f1e
2011-08-24 17:13:49 -07:00
Jean-Michel Trivi
44413e5b51 Bug 5045498 Single binder call when metadata and artwork are updated
When metadata gets applied, optimize the artwork and metadata
 update by doing it in a single call.

Add missing RemoteControlDisplay-related methods in AudioManager.

Change-Id: I97aa802cc480327bee5592ea8dfdbd414c0f037a
2011-08-23 19:08:47 -07:00
Jean-Michel Trivi
4da5eeffc9 Bug 5045498 Implementation of RemoteControlClient.MetadataEditor
A MetadataEditor contains all the metadata and artwork to be applied
 to a RemoteControlClient.
A MetadataEditor can only be applied once.

Change-Id: I3ce9d97f520cd9ab009fb1a92a2b399717511bd8
2011-08-23 18:09:49 -07:00
Jean-Michel Trivi
68e37ae87a Merge "Bug 5045498 New implementation of remote control API" 2011-08-23 11:46:44 -07:00
Jean-Michel Trivi
4426e42ac6 Bug 5045498 New implementation of remote control API
Remote control displays expose an IRemoteControlDisplay interface
 which they register through AudioManager.
Remote control clients create a RemoteControlClient object, which
 implicitely exposes an IRemoteControlClient interface registered
 in AudioService through AudioManager.
AudioService tells all clients and displays when a new client
 is the one that should be displayed.
A client's data gets sent to the display when it is valid, or
 it sets new data (while being valid).

The implementation for setting metadata and album art is temporary,
 and will migrate to the MetadataEditor API in future CLs.

Change-Id: Ibab6ea1d94c68f32482c760c6ae269541f885548
2011-08-23 11:23:22 -07:00
Eric Laurent
cf56f1e7ad Merge "Revert "Change condition to enter silent mode."" 2011-08-23 08:44:13 -07:00
Eric Laurent
73a56fe477 Revert "Change condition to enter silent mode."
This reverts commit c11c3ae4dd5d4054e5b44a7bdfe6b203bdb69976.
2011-08-23 08:27:41 -07:00
Chih-Chung Chang
f1824a9762 Pass correct indices for thumbnails of MediaImageItem.
Change-Id: I8e52014ab76c63994385bc54106c19b425be8550
2011-08-23 16:00:28 +08:00
Rajneesh Chowdury
3ced044154 Fix for 4142219 Don't hard code platform-specific limitations (Jni/ Java)
Also fixes 5118207 add other video codec support for video editor export.

Change-Id: If72427173bd8ff684af07ba00f4425c1deef29c6
2011-08-19 14:34:47 -07:00