1975 Commits

Author SHA1 Message Date
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
Posselwhite
45e4584a0f Performance increase in thumbnail handling
Allow for 160*120 thumbnails which is what cameras commonly
generates. The constants for the micro thumbnail were set to other
values, resulting in recalculations of the thumbnais, which
takes time.

This change only affects the maximum size of the temporary image,
when choosing whether to use the EXIF thumbnail or decoding and
downsampling the full image. Without this change, it will choose
an x16 downsampling of the full image over an x2 downsampling of
the EXIF thumbnail, after the change it will prefer the EXIF
thumbnail.

Cf the DCF specifications at http://www.exif.org/dcf.PDF,
"3.3.6. DCF basic thumbnail data structure, (C) Pixel count"

Tested by running DDMS and measuring the time required to create
a thumbnail. This was 220-280 ms prior to change, < 20 ms after.

Change-Id: I59c753493f947e920bad3fde5eeed5d49d509863
2012-12-04 09:48:02 +01: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
Andreas Huber
1adc5975fa am 800c8ab6: am 2644494a: Merge changes I8462f040,Ie471f40f
* commit '800c8ab68d695f1b6c5332c80a32316cdca69954':
  MediaCodec: Allow getting the codec info directly
  MediaCodec: Allow getting the chosen component name
2012-11-30 14:28:14 -08:00
Andreas Huber
800c8ab68d am 2644494a: Merge changes I8462f040,Ie471f40f
* commit '2644494a9841c1f842d790b60911699f09eb63d1':
  MediaCodec: Allow getting the codec info directly
  MediaCodec: Allow getting the chosen component name
2012-11-30 14:26:16 -08:00
Andreas Huber
2644494a98 Merge changes I8462f040,Ie471f40f
* changes:
  MediaCodec: Allow getting the codec info directly
  MediaCodec: Allow getting the chosen component name
2012-11-30 13:26:51 -08:00
Eric Laurent
b686eceac9 am b46857d2: am b1f45c4a: am c3eb57b2: Merge "AudioService: improve initial safe volume delay" into jb-mr1.1-dev
* commit 'b46857d228edc53878e738ffd484dea1acf44baf':
  AudioService: improve initial safe volume delay
2012-11-30 09:33:01 -08:00
Eric Laurent
b46857d228 am b1f45c4a: am c3eb57b2: Merge "AudioService: improve initial safe volume delay" into jb-mr1.1-dev
* commit 'b1f45c4a587e5adda39774a867c78b56682c5f0d':
  AudioService: improve initial safe volume delay
2012-11-30 09:31:03 -08:00
Eric Laurent
c3eb57b22f Merge "AudioService: improve initial safe volume delay" into jb-mr1.1-dev 2012-11-30 09:26:30 -08:00
Eric Laurent
05274f348e AudioService: improve initial safe volume delay
AudioService relies on a valid mmc in order to enforce the headset
volume limitation or not. There is a timeout to enforce the limitation
if no mcc is configured after boot.
Until this timeout is reached or a valid SIM is detected the headset
volume is not limited.

This change makes that the last known volume limitation state (enforced or
not) is persisted so that next time we boot, last known state is applied until
a new mcc is configured if any. In most cases, the mcc does not change from one
boot to the next and we do the right thing. If teh mcc does change, the correct
policy will be enforced when the mcc is detected or after the timeout.

Also fix a bug where the volume panel was not displayed if the limitation mechanism
is triggered at the first press on VOL+ key.

Bug 7455275.

Change-Id: Id0f2996d893d38c6a14f4f9e4a0e9e3be17ef127
2012-11-29 17:46:05 -08:00