1832 Commits

Author SHA1 Message Date
Jean-Michel Trivi
679d5046f2 Add support for querying whether the music stream is active remotely
Bug 7485803

Change-Id: I554b44bd35b017fa4030a0d89779066c96594f2b
2013-02-11 10:15:47 -08:00
Eric Laurent
78c2d8b356 Merge "AudioRecord: allow front + back mic capture" 2013-01-31 22:33:37 +00:00
Amith Yamasani
6d2def71e0 am c28fde57: am 0b515aec: am 3cfca67b: Merge "Fix possible integer overflow in MtpStorage"
# By Henrik Engström
# Via Android Git Automerger (2) and others
* commit 'c28fde57f0c7762913615b16d651d4e7991d6175':
  Fix possible integer overflow in MtpStorage
2013-01-28 10:33:55 -08:00
Amith Yamasani
0b515aece6 am 3cfca67b: Merge "Fix possible integer overflow in MtpStorage"
# By Henrik Engström
# Via Gerrit Code Review (1) and Henrik Baard (1)
* commit '3cfca67b0f1e3f464274fa5d3b2e31e5288d8f38':
  Fix possible integer overflow in MtpStorage
2013-01-28 10:28:38 -08:00
Eric Laurent
6809afe1c2 AudioRecord: allow front + back mic capture
Change-Id: Id75c9b420198092f5f5d255bd5512ec5a7a2c502
2013-01-17 17:43:35 -08:00
Dianne Hackborn
35654b61e8 More work on App Ops service.
Implemented reading and writing state to retain information
across boots, API to retrieve state from it, improved location
manager interaction to monitor both coarse and fine access
and only note operations when location data is being delivered
back to app (not when it is just registering to get the data at
some time in the future).

Also implement tracking of read/write ops on contacts and the
call log.  This involved tweaking the content provider protocol
to pass over the name of the calling package, and some
infrastructure in the ContentProvider transport to note incoming
calls with the app ops service.  The contacts provider and call
log provider turn this on for themselves.

This also implements some of the mechanics of being able to ignore
incoming provider calls...  all that is left are some new APIs for
the real content provider implementation to be involved with
providing the correct behavior for query() (return an empty
cursor with the right columns) and insert() (need to figure out
what URI to return).

Change-Id: I36ebbcd63dee58264a480f3d3786891ca7cbdb4c
2013-01-16 12:11:01 -08:00
Jean-Michel Trivi
26bf4d9020 Merge "Optimize media button stack traversal for remote volume" 2013-01-11 11:30:30 -08:00
Fabrice Di Meglio
9003007d35 Merge "Fix Volume icons for RTL languages" 2013-01-11 11:10:00 -08:00
Fabrice Di Meglio
8c02884c8c Fix Volume icons for RTL languages
- add mirrored version of the icons
- make VolumePanel respond to layout direction changes
- make AudioService propagate layout direction changes to the VolumePanel

Change-Id: Ibb884ab81641c319a9b7bea1381066f3f19581f0
2013-01-09 18:25:20 -08:00
Marco Nelissen
299942002b Fix media scan NPE
b/7966288

Change-Id: I066bc9f00bccf070332d87d6f1bf3d6054b31136
2013-01-09 09:46:54 -08:00
Henrik Engström
6393b07134 Fix possible integer overflow in MtpStorage
When converting the MB value MtpReserveSpace value to bytes there is a
possible integer overflow since 3 integer values are multiplied, even
though the result is stored in a long variable. This would be visible when
the value is more than 2 GB. This is solved by making the constants
longs instead of ints.

Change-Id: I799129f7076a6e331cece17b5c05aed210499648
2013-01-09 09:27:59 +01:00
Jean-Michel Trivi
5df0e6ad26 Optimize media button stack traversal for remote volume
Iterate over entries in the media button stack from the top
 for remote volume-related operations as the stack entry being
 looked for is more likely at the top of the stack.

Change-Id: Iaa2685ebb297d2184dd2c63498d7bd2b811ce744
2013-01-07 12:07:06 -08:00
Jean-Michel Trivi
a578c48e6c Use playback state to update remote control stack
The remote control stack in AudioService is responsible for handling
 which application receives media button events. When an application
 "registers" its media button receiver, it gets placed at the top
 of the remote control stack. If the app also has audio focus (is
 at top of focus stack), this will also cause the information of
 the attached remote control client (RCC) to be displayed on the
 lockscreen.
If an app doesn't re-register its button receiver when it wants
 to receive the button events, it might have lost its place at the
 top of the remote control stack, and would not show up in the
 lockscreen anymore.
This change consists in using the playstate reported by the RCC
 to change the remote control stack. If an RCC reports a "playing"
 state (e.g. playing, fast forwarding), it is safe to assume the
 application is actively being used, and should be the one that
 receives the transport control buttons. This CL uses the reported
 playstate to conditionally move the corresponding stack entry
 to the top of the stack.

Bug 7311023

Change-Id: I1505f01664c16e108b22d33e3f47f0056343676e
2013-01-02 12:31:56 -08:00
Jean-Michel Trivi
84aa61e2a8 Optimize remote control stack traversal order
Iterate of remote control stack entries from the top of the stack
 for cases where the condition being checked is more likely at
 the top of the stack, as opposed to the bottom, which is first
 accessed when using an iterator.

Change-Id: I625bee59021c2d652e9d6355b48dc0c11e36093f
2013-01-02 12:17:43 -08:00
Jean-Michel Trivi
383f36cf64 Merge "Add comments on remote control stack traversal order" 2013-01-02 12:15:45 -08:00
Jean-Michel Trivi
66cbd19737 Add comments on remote control stack traversal order
Add comments to justify where remote control stack traversal order
 doesn't matter.

Change-Id: I71a71ae22446cee529649e047142c774f78a377b
2013-01-02 12:11:15 -08:00
Jean-Michel Trivi
d6a7925d14 Merge "Updates to remote control client (un)registration" 2013-01-02 11:05:08 -08:00
Jean-Michel Trivi
f2fc1cbb06 Merge "Fix stack traversal order when removing or adding media button receiver" 2013-01-02 10:56:35 -08:00
James Dong
cf1df19448 am 0c1e566f: am c8db3b8a: Merge "Set "isdrm" info in Mediastore"
* commit '0c1e566f97a39dd79e563afe953de8879ef66bd9':
  Set "isdrm" info in Mediastore
2012-12-28 09:47:41 -08:00
Jean-Michel Trivi
58a9cad4e8 Remove unused audio source
Bug 7110996

Change-Id: I90737c14a4e6f9fe662eb7eb5bd0483da823083b
2012-12-27 15:31:47 -08:00
Jean-Michel Trivi
ed2d10dab7 Updates to remote control client (un)registration
Iterate over the remote control stack from top to bottom
 when (un)registering a remote control client (RCC).
When unregistering an RCC, stop traversing the stack when
 match found. If match was at top of the stack, update
 the remote control display (RCD).

Change-Id: If64acf102bdf328085d707f9e0f7e86cf4d4001a
2012-12-27 09:43:46 -08:00
Jean-Michel Trivi
bc83425c11 Fix stack traversal order when removing or adding media button receiver
Iterate over the media button receiver stack from top to bottom
 when removing or adding a receiver.
Update comments and name to reflect that the corresponding methods
 must be synchronized on audio focus and remote control.

Change-Id: I1fb7f682a999aa66d92d56ca6ecd8b37eeff8ac9
2012-12-26 16:18:24 -08:00
Jean-Michel Trivi
c30f45b97f Add comments in AudioService focus and media button stack traversal
Add comments to reflect where and why the audio focus and media
 button stacks are traversed with an iterator, which traverses
 the stack from bottom to top.

Change-Id: I462a522195e742295d13eff5fc727e59a5d7e830
2012-12-26 10:46:29 -08:00
James Dong
0c1e566f97 am c8db3b8a: Merge "Set "isdrm" info in Mediastore"
* commit 'c8db3b8ae34c76430e8e97418e485dedc44d0954':
  Set "isdrm" info in Mediastore
2012-12-21 14:42:37 -08:00
Glenn Kasten
06f7de4944 Merge "Simplify AudioTrack event handling and fix a race" 2012-12-18 17:10:52 -08:00
Glenn Kasten
b6ed68ccb2 Revert "Update AudioTrack comments"
This reverts commit 3f411cacbe4204c779a794451a5d5b0f67e03416

Change-Id: Ieb32310bc007bf2c6a2dc324db4873e7128177fa
2012-12-18 11:50:28 -08:00
Glenn Kasten
3f411cacbe Update AudioTrack comments
Change-Id: I0cdca92e3ac63088ed919c4dcfb309d3ccb59092
2012-12-18 10:00:49 -08:00
Andreas Huber
30676a7031 am bb2985aa: am 683028ca: Merge "Make it clear that non-optional MediaFormat keys are required" into jb-mr1.1-dev
* commit 'bb2985aa0e3435a4a945233eebc9ea36769209d2':
  Make it clear that non-optional MediaFormat keys are required
2012-12-06 18:59:53 -08:00
Glenn Kasten
28d4cf50e7 Merge "AudioTrack error checks" 2012-12-06 16:34:48 -08:00
Glenn Kasten
91c7bc2a8d Merge "Allow more APIs before write in static buffer mode" 2012-12-06 13:48:34 -08:00
Glenn Kasten
e1a2c9f944 Merge "Use the utility logging methods and single tag" 2012-12-06 12:47:17 -08:00
Glenn Kasten
ee88bc8ab9 Merge "Document that ByteBuffer position not updated" 2012-12-06 12:00:44 -08:00
Glenn Kasten
678210251c Merge "Remove dead method native_get_session_id()" 2012-12-06 11:41:34 -08:00
Eric Laurent
942de41bb1 Merge "more fixes on safe volume warning message" 2012-12-06 11:26:40 -08:00
Glenn Kasten
f0336d11f5 Merge "Remove whitespace at end of line" 2012-12-06 11:14:05 -08:00
Glenn Kasten
f94942f1b9 Merge "Import only what's needed" 2012-12-06 08:37:37 -08:00
Erik Almqvist
59c14048bf Set "isdrm" info in Mediastore
The mediascanner member mIsDrm was never set
according to the drmframework canHandle call.
This subsequently caused that the isdrm column
in mediastore was never set, and was defaulted
to false for all files.
mIsDrm is now set according to drmframework
canHandle result for each files that is scanned.

Change-Id: Id557d921c4e3e3dfc35da56b69471f4bd6b3c8bf
2012-12-06 16:22:33 +01:00
Eric Laurent
fde16d5879 more fixes on safe volume warning message
Fixes the following problems with safe headphone volume warning message:
- Do not display the warning dialog when screen is off.
- Use the same 3 second timeout as for the volume slider to dismiss the dialog.
- Do not dismiss the warning dialog when touching outside of the slider window
but inside the warning window.
- Disable the volume slider when the warning message is displayed.
- When setting volume directly (touching the volume slider), and the warning
is displayed, save the requested volume and apply it if acknowledged by the user.
- Do not display the warning message when restoring safe volume after 20h of
cumulative listenening

Bug 7658641.

Change-Id: Ib3d1315193a433dad918aa5df78fa071062b2394
2012-12-05 17:59:39 -08:00
Glenn Kasten
a501b5b8d5 AudioTrack error checks
getMinBufferSize():
  Simplify native_get_min_buff_size error checks and handle more errors.

setPlaybackHeadPosition():
  Disallow for streaming mode [underlying AudioTrack C++ requires this].
  Disallow setPlaybackHeadPosition before write().
  Remove unnecessary synchronization around native_set_position().

setLoopPoints():
  As setLoopPoints() is effectively a variant of setPlaybackHeadPosition(), do the same error checks.

write():
  Don't set "write completed" state if write() parameters are invalid or native write fails.
  It was setting "write completed" flag too early, and ignoring native write return value.
  Detect integer overflow.

reloadStaticData():
  Disallow reloadStaticData() before write().

Change-Id: Iec36fc0ea67095e18a2c238b148dad5545c102c1
2012-12-05 17:08:48 -08:00
Glenn Kasten
9c1d2de177 Merge "Make mInitializationLooper final" 2012-12-05 15:44:07 -08:00
Glenn Kasten
4e71faec0c Merge "Simplify throw statements" 2012-12-05 15:35:39 -08:00
Glenn Kasten
0fc11dd059 Merge "Remove redundant AudioTrack. qualifiers" 2012-12-05 15:28:06 -08:00
Glenn Kasten
df3cb52798 Remove redundant AudioTrack. qualifiers
Symbols of the current class don't need to be qualified.

Change-Id: Ic89ce568771165d01d4b5bcf835c591ca0b86541
2012-12-05 15:24:40 -08:00
Andreas Huber
4df82703a7 Make it clear that non-optional MediaFormat keys are required
Also mark KEY_CHANNEL_MASK optional.

Change-Id: I569087f564dc60a89b15a3440a9b1c538927f610
related-to-bug: 7623602
2012-12-05 14:28:22 -08:00
Andreas Huber
08067d376e Make it clear that non-optional MediaFormat keys are required
Also mark KEY_CHANNEL_MASK optional.

Change-Id: I569087f564dc60a89b15a3440a9b1c538927f610
2012-12-05 11:12:26 -08:00
Eric Laurent
526b035bc5 Merge "Allow mute when playing over fixed volume device" 2012-12-04 18:25:37 -08:00
Glenn Kasten
1e821372be Merge "Replace hard-coded sample rate values by constants" 2012-12-04 16:32:41 -08:00
Eric Laurent
3ef7549876 Allow mute when playing over fixed volume device
Modified AudioService to add the possibility to mute/unmute music
with volume keys while playing over fixed volume devices (HDMI, digital dock).
VOL- forces volume to 0 and VOL+ forces volume to maximum.

Bug 7377764.

Change-Id: Ibaf805d76c30e3c0e395547cd3ce0087dbfb9f30
2012-12-04 14:29:24 -08:00
Marco Nelissen
a5c9fd93cc Merge "Fix default ring/alarm/notification insertion" 2012-12-03 15:39:42 -08:00
Marco Nelissen
4ecfce6f6f Fix default ring/alarm/notification insertion
Before directly inserting an item that is the default ringtone, alarm or
notification, flush the MediaInserter, since a parent of the inserted item
might not have been flushed yet.

b/7650557

Change-Id: Icdd25bd9cac8b43a75e63318b936246562744c59
2012-12-03 15:15:47 -08:00