1452 Commits

Author SHA1 Message Date
Eric Laurent
7ef9743597 Merge "AudioService: fix system stream muted by restore" 2012-03-07 16:22:27 -08:00
Eric Laurent
9ac8d0c445 AudioService: fix system stream muted by restore
Releases prior ICS (included) would persist the stream volumes in the
database when muted by silent mode. If the DB was backed up while in
silent mode, stream volume was backed up at 0.
When restored on a new device, the volume was restored at 0 which was
a problem for SYSTEM stream because it would never be corrected as
this stream volume is fixed.

Added a check on valid volume values when reading settings from the DB
and correct the DB if this happens.

Change-Id: Ie3b98eb74e10413c22aab7568b83ac3ace5bfc07
2012-03-07 16:00:57 -08:00
Eino-Ville Talvala
d5f0799082 Merge "NEW_API: Rework CameraSound into MediaActionSound, and unhide it." 2012-03-07 13:54:43 -08:00
Eino-Ville Talvala
e69095869c NEW_API: Rework CameraSound into MediaActionSound, and unhide it.
MediaActionSound is a helper class for applications that use the
camera, or include camera-like behavior such as taking
screenshots. This class helps applications match the sound-playing
behavior of the Camera.takePicture, MediaRecorder.start, and
MediaRecorder.stop methods.

This is useful for applications that don't use the above methods, but
still logically capture images or video, such as the panorama capture
feature and the video effects in the platform camera application.

Bug: 5029099
Change-Id: I829f6e2941f167f91f9cb506215b7232cb054958
2012-03-06 16:33:50 -08:00
James Dong
a00c2939c7 Changed 480p and 1080p resolution documentation
o related-to-bug: 6041794

Change-Id: I01c52ec68c715c46c3ce9e778dbc6ac1f74685b6
2012-03-06 07:45:13 -08:00
Lei Zhang
d674dd50b7 Add batch volume adjust support to adjustMasterVolume() in AudioManager and
AudioService.

Change-Id: I34382839622a5cc5f2a8768aed011e8224cadff9
2012-03-02 11:48:28 -08:00
John Grossman
720aa28279 Switch the way we configure for MediaPlayer retransmission.
This is a cherry-pick of I6ab07d89b2eeb0650e634b8c3b7a0b36aba4e7dd
with merge conflicts addressed by hand and additional changes made in
response to code review feedback.

Move in the direction of a more publishable API for configuring a
media player for retransmission.  It used to be that we used a custom
invoke and a modified URL (prefixed with aahTX://).  There are many
issues with this technique and it was never meant to stand the test of
time.

This CL gets rid of all that.  A new (but currently hidden) method was
introduced to the java level MediaPlayer API, called
setRetransmitTarget(InetSocketAddress), which allows an app writer to
set the retransmit target.  For now, this method needs to be called
before a call to setDataSource (which is pretty unusual for the
MediaPlayer API) because this mid level code uses this as a cue to
instantiate an aahTX player instead of relying on the data source to
select a player.  When retranmit functionality becomes part of the
existing android player implemenation, this
set-retrans-before-set-data-source behavior can go away, along with
the aahTX player itself.

Change-Id: I3b46c5227bbf69acb2f3cc4f93cfccad9777be98
Signed-off-by: John Grossman <johngro@google.com>
2012-03-01 14:41:35 -08:00
RoboErik
1918d4353c Fix Audio ramping code
The audio ramping was being ignored and we were always adjusting
by the same amount.

Change-Id: I1dc122e033c382f556844c5acadcfb698c8d2092
2012-02-24 17:44:27 -08:00
John Grossman
4aea858564 Switch the way we configure for MediaPlayer retransmission.
Move in the direction of a more publishable API for configuring a
media player for retransmission.  It used to be that we used a custom
invoke and a modified URL (prefixed with aahTX://).  There are many
issues with this technique and it was never meant to stand the test of
time.

This CL gets rid of all that.  A new (but currently hidden) method was
introduced to the java level MediaPlayer API, called
setRetransmitTarget(InetSocketAddress), which allows an app writer to
set the retransmit target.  For now, this method needs to be called
before a call to setDataSource (which is pretty unusual for the
MediaPlayer API) because this mid level code uses this as a cue to
instantiate an aahTX player instead of relying on the data source to
select a player.  When retranmit functionality becomes part of the
existing android player implemenation, this
set-retrans-before-set-data-source behavior can go away, along with
the aahTX player itself.

Change-Id: I6ab07d89b2eeb0650e634b8c3b7a0b36aba4e7dd
2012-02-23 12:02:04 -08:00
John Grossman
fa4a191d0d Revert "Add a way to play file descriptor data sources using the A@H transmitter media player."
This reverts commit 64006cb1642b2ec0ee74c66007d869b884391fd1.

Back out this change in order to get ready to implement a longer term,
more media-team approved way of selecting a retransmit player.

Change-Id: I97b68b9859a174eab858598cb00d4445a14fbc17
2012-02-23 09:29:51 -08:00
Andreas Huber
0ae6b481e4 Merge "Implementation of a java media codec interface and associated tools." 2012-02-22 15:13:44 -08:00
Andreas Huber
88572f7a3e Implementation of a java media codec interface and associated tools.
Change-Id: I13e54062d4de584355c5d82bb027a68aeaf2923b
2012-02-22 15:06:06 -08:00
James Dong
a352d1e241 Merge "Allow to record time lapse videos without using setProfile()" 2012-02-22 11:47:07 -08:00
James Dong
a4d205d02c Allow to record time lapse videos without using setProfile()
o also added a check on whether capture rate was set before starting time lapse video recording.

o related-to-bug: 6045507

Change-Id: I8e1fdc8e8931e2684ab3822dc6260db44658e87d
2012-02-22 10:20:46 -08:00
Marco Nelissen
58ef68905d Eliminate scanner file cache
Get rid of the file cache, since it tends to run out of memory for large
numbers of files. This slows down the scanner somewhat, but recent
optimizations more than make up for that.

With this change, the postscan phase of the media scan now only processes
playlists. Removal of entries for files that no longer exist is done as
part of the prescan.
Lookups in the file cache are replaced by simple queries, which are still
reasonably fast because of a new index recently added to the media provider
database. Note that there was a bug in the case-insensitive matching for
file cache entries, in that e.g. an uppercase a-accent-aigue would be mapped
to its lowercase version, whereas the underlying case-insensitive filesystem
treats them as different characters. Getting rid of the file cache also fixes
this issue.

Bug: 4474617
Change-Id: I39c6f1a35bb518ef7ab912e9b9401663821ef48e
2012-02-22 08:37:26 -08:00
John Grossman
3540a0197f Enhance Visualizer behavior in the case of mediaserver death.
Bring the Visualizer class into line with the SDK documentation by
returning ERROR_DEAD_OBJECT instead of ERROR_INVALID_OPERATION when
the Visualizer loses its binder connection to the mediaserver because
of a mediaserver restart.

Also add a new callback interface to allow clients to be
asynchronously notified in the case of server death.  Right now, the
interface definition and the registration method are flagged as hidden
pending API council review/approval.

See http://b/issue?id=5717519 for details.

Change-Id: Ic15856f27ed5a950a583ac11ca81f79bd7e9b1a0
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:11 -08:00
John Grossman
449725f9aa Reuse callback buffers in the Visualizer.
Don't re-allocate buffers used by Visualizer callbacks as this causes an
unacceptable amount of GC thrash.  Instead, lazily allocate the buffers and only
reallocate them when the required size changes.

See http://b/issue?id=5717519 for details.

Change-Id: Ibd157ed51f30687ce7c4ef0b4003258a484e0f5d
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:11 -08:00
Eric Laurent
98ad9b9d6f Fix music volume regression on tablets
A regression was introduced by the change enabling per device volume:
music volume will not be completely silenced even if volume is shown at 0.

The problem is that when media volume goes to zero, silent mode is entered and
AudioService sends one message per stream/per connected device to the audiosystem
handler to mute volume on each stream. As those messages were sent with the
SENDMSG_NOOP attribute, some of them where lost.

Change-Id: Ic665b1e9dcaf09506a4ec19bf3fe6997d4b071fd
2012-02-15 17:21:37 -08:00
Marco Nelissen
d121cfcbb4 Further optimize media scanner.
Inserts of directories can be done in bulk as long as they're inserted before
the files contained within. Extend MediaInserter to accommodate giving priority
treatment to directories.
Bulk deleting of entries can be further sped up (by a factor of ~3 in my tests)
by deleting entries in database order. Switch the file cache to use
LinkedHashMap instead of HashMap to allow iterating over the cache in database
order. Also use bindArgs to allow for better caching of sql statements.

Change-Id: Ieb9ffc4e866c6cd505bf795eb80ff5d03ffc56bd
2012-02-13 15:39:15 -08:00
Mike Lockwood
9760647dd0 Add support for non-linear ramping of master volume adjustment
Bug: 5472584

Change-Id: I1227007d1563eca739fb78b6d9595febc04a3f03
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-10 15:58:07 -08:00
Jason Simmons
1ce5b26d70 Only send master volume or mute updates if the settings have changed 2012-02-10 14:44:08 -08:00
Jason Simmons
e3f5979307 Make AudioManager.adjustMasterVolume public and hidden 2012-02-10 14:44:08 -08:00
Mike Lockwood
9063154a79 Restore persisted master volume if the media server restarts
Bug: 5755071

Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-10 14:44:08 -08:00
Mike Lockwood
b7bd88a3b6 Don't allow changing master volume when muted
Bug: 5793021

Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-10 14:44:07 -08:00
Mike Lockwood
5c55a051ad Defer persisting master data to avoid excessive database writes
Bug: 5705192

Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-10 14:44:07 -08:00
Mike Lockwood
3194ea9434 Remove reference counting and client death notification for master mute
The use case for master mute is to toggle it on and off from a
KEYCODE_VOLUME_MUTE event, so this was unnecessary and prevented unmuting
in certain cases

Bug: 5724755

Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-10 14:44:06 -08:00
Mike Lockwood
0dc37cce9d AudioService: Send broadcasts when master volume and mute state change
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-10 14:44:06 -08:00
Mike Lockwood
fa7b06147c AudioManager: Add wrapper methods for master volume support
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 14:44:05 -08:00
Mike Lockwood
ce952c8e13 AudioManager: Add support for master mute
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 14:44:05 -08:00
Mike Lockwood
4767690f09 AudioManager: transparently convert volume settings for other streams to master volume if config_useMasterVolume is set.
This allows Music2 and other media apps to control master volume without changing their code

Bug: 5567694

Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 14:44:04 -08:00
Mike Lockwood
8dc1dabd25 VolumePanel: Add support for master volume
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 09:05:49 -08:00
Mike Lockwood
8517e46f3d Save and restore master volume in the settings provider
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 09:05:39 -08:00
Mike Lockwood
cbdb49dc5e Simple master volume support
Still needs integration with Settings (for persistence) and VolumePanel UI.

Change-Id: I9eca92c4b1ef2df2564411006a35753ab9618dce
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 09:01:28 -08:00
Scott Main
e7eeace594 am ec12ae99: am 79cfde69: am 52bfc243: docs: fix misc doc bugs from external issue tracker
* commit 'ec12ae9933e463181338834387caa7c58b330635':
  docs: fix misc doc bugs from external issue tracker
2012-02-09 12:53:12 -08:00
Scott Main
dfa926f54b am 52bfc243: docs: fix misc doc bugs from external issue tracker
* commit '52bfc243684b2f340da326aaa38e9021e4e3b2e6':
  docs: fix misc doc bugs from external issue tracker
2012-02-09 12:48:18 -08:00
Scott Main
52bfc24368 docs: fix misc doc bugs from external issue tracker
Change-Id: If6ff3476670e42b321d56d4a1482ccff96d4d500
2012-02-09 12:45:16 -08:00
Mike Lockwood
0e8392e1dc Add support for non-linear ramping of master volume adjustment
Bug: 5472584

Change-Id: Id75f8835f6693ae3fcb7ca451ada01f22faba1aa
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-09 11:24:10 -08:00
Marco Nelissen
b3f04a6569 Merge "Delete entries in bulk" 2012-02-08 10:15:01 -08:00
Marco Nelissen
9ff4774cac Delete entries in bulk
Deleting entries from the database in bulk greatly speeds up the media
scanner in some cases; removing 31k entries used to take about 2 hours,
now it takes about 15 minutes.

Change-Id: Ia8f3fd6d828289e3d67178e9ad10399ded8d70d2
2012-02-08 10:13:11 -08:00
Marco Nelissen
f047c14f23 Merge "Make media scanner use new delete-parameter" 2012-02-07 08:28:02 -08:00
Marco Nelissen
ac259f17a0 Make media scanner use new delete-parameter
This speeds up the media scan case where many files were deleted or moved.

Change-Id: I86e6fc6d0968eebf24923c0b5587b90d309721bb
2012-02-07 07:54:39 -08:00
James Dong
874d1f1f65 Unhide AAC_ADTS file format
o also actually decprecated RAW_AMR file format

Change-Id: Ic8ef5b0dca6f793fddf9e79d431e79f5083f7bff
2012-02-02 15:50:24 -08:00
Jason Simmons
a477bab9c3 Only send master volume or mute updates if the settings have changed
Change-Id: If12ec3b7a4b4bf5165d7538013759f07a845d8c4
2012-02-02 13:00:17 -08:00
Marco Nelissen
d6b3e0cc36 Enable media scanner bulk inserts
Change-Id: I357162d0fe498a182ccb14630fe565daaa8bb0c1
2012-02-02 10:35:22 -08:00
Marco Nelissen
f3a3b9ec9c Merge "Handle adding/removing/renaming nomedia paths" 2012-01-30 08:27:57 -08:00
Jason Simmons
64006cb164 Add a way to play file descriptor data sources using the A@H transmitter media player.
* Added a MediaPlayer.setMediaPlayerType API that be called to specify the
  desired media player implementation before calling setDataSource
* Implemented setDataSource(fd) in the AAH_TxPlayer

Change-Id: I359075d9c7d6fd699dda14eb85ec50da19307639
2012-01-29 18:03:02 -08:00
Jeff Brown
2d2d7d6f42 Merge "Implement a cancelation mechanism for queries." 2012-01-27 17:37:24 -08:00
Jeff Brown
75ea64fc54 Implement a cancelation mechanism for queries.
Added new API to enable cancelation of SQLite and content provider
queries by means of a CancelationSignal object.  The application
creates a CancelationSignal object and passes it as an argument
to the query.  The cancelation signal can then be used to cancel
the query while it is executing.

If the cancelation signal is raised before the query is executed,
then it is immediately terminated.

Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
2012-01-27 17:33:21 -08:00
Glenn Kasten
30c918ce7f Use final on new member variables
Use final for member fields initialized to a new and that are never modified.

Change-Id: I042352c7bc21879613e7a50b1205b6923f8083cf
2012-01-27 16:13:00 -08:00
Marco Nelissen
ca78f3d9af Handle adding/removing/renaming nomedia paths
b/5849015
Change-Id: I3ec7419498d1ecc83db6d4605b3d7610349231f7
2012-01-27 15:10:14 -08:00