385 Commits

Author SHA1 Message Date
Jean-Michel Trivi
399eb1f00e am 219dbb67: am 8dc4c790: am fe8620ac: Merge "Update AudioService to reflect phone state changes with AudioFocus. Phone calls and rings are treated as a new client, with a dedicated client ID that identifies it in the audio focus stack. When it is present in the stack 2010-04-20 16:15:33 -07:00
Jean-Michel Trivi
b4bccb6d8d Update AudioService to reflect phone state changes with AudioFocus.
Phone calls and rings are treated as a new client, with a dedicated
client ID that identifies it in the audio focus stack. When it is
present in the stack, others clients cannot request audio focus
(request is denied).
Because the phone state is now mostly handled like a new client,
there is no need monitor mode changes and to keep track of
undispatched focus changes, as those will delayed focus gains
will now automatically happen at the end of the call when the
phone client is removed from the focus stack.

Change-Id: I11ff73b015ab93f07040755fd8ee75c8d675e025
2010-04-20 15:23:39 -07:00
Marco Nelissen
03e4b571ea am fe13eebe: am 9d14e3ea: am 9b8b417c: Merge "When updating existing entries in the media database, don\'t update the is_music, is_ringtone, etc columns. This ensures that custom ringtones will still be shown in the ringtone picker after a rescan. Bug 2594125 Change-I 2010-04-20 11:42:02 -07:00
Marco Nelissen
9b8b417cd1 Merge "When updating existing entries in the media database, don't update the is_music, is_ringtone, etc columns. This ensures that custom ringtones will still be shown in the ringtone picker after a rescan. Bug 2594125 Change-Id: I56761240d6f6e699514169d80a445317ba0de9e2" into froyo 2010-04-20 11:24:10 -07:00
Eric Laurent
7dc9bcea53 am 5b550c9e: am 11bae140: am 3891c4cc: Fix issue 2602879: camera shutter sound not playing. 2010-04-20 10:31:43 -07:00
Eric Laurent
1a8597cb51 am e33e9db6: am 3cd1f9f9: am 3b591260: Fix issue 2604270 Device auto connects to Car Dock (Media profile) after undocking. 2010-04-20 10:02:16 -07:00
Marco Nelissen
c066557378 When updating existing entries in the media database, don't update
the is_music, is_ringtone, etc columns. This ensures that custom
ringtones will still be shown in the ringtone picker after a rescan.
Bug 2594125
Change-Id: I56761240d6f6e699514169d80a445317ba0de9e2
2010-04-20 09:47:31 -07:00
Eric Laurent
3891c4cc91 Fix issue 2602879: camera shutter sound not playing.
The problem occurs if the device is powered down in silent mode. When the device restarts,
AudioService reads current ringer mode from saved settings but does not call setRingerModeInt()
to perform actions required when ringer mode changes.
The volumes of streams affected by ringer mode are actually at 0 because they are also read from settings
but their mute state is not applied correclty. When we later exit from silent mode, the streams
other than STREAM_RING that are affected by ringer mode are not restored as they are not considered
muted. This applies to STREAM_SYSTEM but also to STREAM_NOTIFICATION if its volume is controlled independently
from STREAM_RING.

The fix consists in calling setRingerModeInt() when AudioService starts.

Change-Id: Ica75b9874938dda1bc1b634c3e97db4a650d295c
2010-04-20 09:40:57 -07:00
Eric Laurent
3b5912602b Fix issue 2604270 Device auto connects to Car Dock (Media profile) after undocking.
There was a regression introduced by change 4c637b9e34f4c8db69a64ad21a4e2bcfa7485b5f
fixing issue 2578813. As the A2DP device disconnection is notified to the audio policy manager
after a delay, there is a period during which the A2DP device is actually not connected but the
A2DP output is considered present by audio framework. If a playback is started during this period,
The A2DP output requests the activation of the A2DP sink which in turn triggers a reconnection
of the A2DP sink.

The fix consists in suspending the A2DP output immediately when receiving the A2DP disconnection
intent so that any activity on A2DP output is ignored until the output is actually closed by the
audio policy manager.

Change-Id: I16eaace45e12bfc970f50836b46a73b756b493f0
2010-04-20 07:01:00 -07:00
Eric Laurent
36b763e952 am 5c14f2d0: am def7db5b: am 758dd527: Fix issue 2592680: Saved ringer volume forced to 0 when receiving a call in silent mode. 2010-04-15 06:38:55 -07:00
Eric Laurent
491f250583 am 5db9adfd: am 834f0483: am 745b43c2: Merge "Fix issue 2589563: Able to set ringer volume to 0 outside of silent mode." into froyo 2010-04-15 06:38:39 -07:00
Eric Laurent
758dd527f6 Fix issue 2592680: Saved ringer volume forced to 0 when receiving a call in silent mode.
This is a regression introduced by change 5b4e654d0c7de8e4d58d73e73b0d5220f19b68f7 for issue 2472495.
When AudioService changes audio mode, setMode() reapplies current volume for the default active stream
which in this case is STREAM_RING.
Because the new implementation of silent mode actually mutes the ringer stream,
setStreamVolumeInt() now applies the volume change received while in silent mode
to the last audible value and we end up clearing the last audible volume for ringer.

The fix consists in not modifying last audible value when the new value is 0.

Also removed obsolete code in setStreamVolumeInt() since new implementation of setRingerModeInt()
in change 5b4e654d0c7de8e4d58d73e73b0d5220f19b68f7.

Change-Id: I746f3bc1af39a602ce12d130ce592007b2d0ebb6
2010-04-14 10:52:01 -07:00
Eric Laurent
527c3ab51e Fix issue 2589563: Able to set ringer volume to 0 outside of silent mode.
The problem happens only if volume down key is pressed while
already in silent or vibrate mode. In this case, AudioService accepts
changing the last audible index for ringer volume from 1 to 0.
When volume up is pressed, current ringer volume value is restored from 0
instead of 1.

The fix consists in keeping last audible index at 1 once in silent of vibrate
mode even is volume down key is pressed.

Change-Id: Id08edd12ce985c22233124545eba2c3e4b8cdc8e
2010-04-14 09:32:17 -07:00
Jean-Michel Trivi
7558905bdf am 824ca797: am b8430335: am 34b2ecc8: am c30890e1: Merge "Fix bug 2578813 Delay pausing music and routing audio for car docks" into froyo 2010-04-13 16:24:29 -07:00
Daniel Sandler
57e6f58bb7 am cd3f349f: am a32efedd: am de3601e0: am bcac4960: Honor the "Never vibrate" setting for incoming calls. 2010-04-13 16:24:16 -07:00
Jean-Michel Trivi
4c637b9e34 Fix bug 2578813 Delay pausing music and routing audio for car docks
Moved broadcast of ACTION_AUDIO_BECOMING_NOISY from BluetoothA2dpService
to AudioService.
Broadcast ACTION_AUDIO_BECOMING_NOISY when disconnecting an A2DP
device.
Disconnect from A2DP docks with a delay to handle transient
disconnections.
Cancel delayed A2DP disconnections when connecting to a dock as this
can be a reconnection after a transient disconnection.

Change-Id: I1ee9e99f3ffa20727af38a4c4c8711942894a696
2010-04-13 09:44:08 -07:00
Daniel Sandler
bcac496076 Honor the "Never vibrate" setting for incoming calls.
Bug: 2579295
Change-Id: Ia4207492c5dfa2c39d27372c4892b60121b6d9e8
2010-04-13 12:18:44 -04:00
Jean-Baptiste Queru
36ce643dbe am cd839752: manual merge 2010-04-12 15:38:08 -07:00
Jean-Michel Trivi
2930bb2d47 Fix monkey bug 2586534 java.util.ConcurrentModificationException
Unlike the other audio focus and media button stack handling
methods, abandonAudioFocus() and unregisterAudioFocusClient() were
not synchronized around their focus stack. This CL corrects this.

Change-Id: I5ada574e4e163fa95da9dad2fefe610b48303320
2010-04-09 19:27:58 -07:00
Ray Chen
f974b84b54 am e4b62c23: am 84d12f3f: am dbad286c: am 25c2dd60: Merge "Per requested by API council, rename MediaScannerConneciton.ScanResultListener to .OnScanCompletedListener http://2553871" into froyo 2010-04-07 13:52:52 -07:00
Ray Chen
b7c8c76180 Per requested by API council, rename MediaScannerConneciton.ScanResultListener to .OnScanCompletedListener
http://2553871

Change-Id: I293b8138a2c23ea107b634da014902f838966c0e
2010-04-07 10:14:04 -07:00
Ray Chen
505a318eae am 507748e9: am 6c935602: am 44dcf658: Make createVideoThumbnail and createImageThumbnail look consistent. 2010-04-05 13:30:13 -07:00
Ray Chen
44dcf65871 Make createVideoThumbnail and createImageThumbnail look consistent.
Change-Id: I9a4798fefe3968ac847d46100036a6dde39791c9
2010-04-05 13:06:39 -07:00
Jean-Michel Trivi
5a3a3b16ba am 055897ac: am 28525488: am 9ab05fff: Merge "Fix bug 2565463 Ensure an object cannot appear twice in the AudioFocus stack. Enforce parameter check in AudioManager.requestAudioFocus() Typo correction in AudioService.unregisterMediaButtonEventReceiver()" into froyo 2010-04-02 09:28:50 -07:00
Jean-Michel Trivi
55d1bb3483 Fix bug 2565463 Ensure an object cannot appear twice in the
AudioFocus stack.
 Enforce parameter check in AudioManager.requestAudioFocus()
 Typo correction in AudioService.unregisterMediaButtonEventReceiver()

Change-Id: Iedd6081a2a096bd7effbaeb9f888a31691201b3b
2010-04-01 17:40:58 -07:00
James Dong
bf3b4985b6 am 85bc2ae1: am d12d6c30: am ccc17b34: Merge "Public API changes for CameraProfile and CamcorderProfile classes" into froyo 2010-04-01 10:56:47 -07:00
James Dong
e64d9a236e Public API changes for CameraProfile and CamcorderProfile classes
1. CamcorderProfile: “@see” links are broken; Remove m prefix from fields; remove “final”
2. CamcorderProfile.Quality: use an int rather than an enum
3. Add API on MediaRecorder to pass in a CamcorderProfile
4. CameraProfile.getImageEncodingQualityLevels @hide or make it consistent with CamcorderProfile
5. Remove a convenient method and instead let the (mms) app do that task

bug - 2553862

Change-Id: I759215c7892f772aeddf3651d17038489c6fbc50
2010-04-01 00:12:20 -07:00
Glenn Kasten
7f9b1fa671 Add isSilentMode initially hidden before API council approval, test case to be added separately.
Change-Id: Id9384a2caf45b8775705cde6c990c3c65c7c6312
2010-03-31 15:54:12 -07:00
Jean-Michel Trivi
7f7e67f1b6 Fix bug 2553575 API REVIEW: android.media Change 1 of 3
Notes from API Council review:
  Rename onAudioFocusChanged -> onAudioFocusChange

Change-Id: I8296cc84381506dabe8a9ceb1b5e3c0ab6d4af25
2010-03-31 12:08:26 -07:00
Eric Laurent
5b4e654d0c Fix issue 2472495: Phone cannot be set to silent mode via volume keys while Driveabout is taking.
The problem is that AudioService.adjustStreamVolume() only handles the ringer mode change when the
STREAM_RING volume changes from 1 to 0 or 0 to 1. If another stream is soloed, the STREAM_RING stream
volume is forced to 0 and then never transits from 0 to 0 when volume down key is pressed.

The fix consists in considering the saved value instead of current value when ajusting or setting
the volume of a muted stream: only the saved value is adjusted too, leaving the stream muted but updating
the value that will be restored when it will be unmuted.

Also changed implementation of stream volume control by setRingerModeInt() to use stream mute feature
instead of direct volume control.

Change-Id: Id85d76450b36d61a0fe8195eb4bffe63ffbd427c
2010-03-22 15:46:58 -07:00
Jean-Michel Trivi
bbbb1dc3c3 Unhide the MediaButton receiver API in android.media.AudioManager
Change-Id: Ic9222b0bf6e2ff481c6aa5f16ac0259fa7a52355
2010-03-22 13:49:30 -07:00
James Dong
90f8680f41 Update MediaRecorder.java documentation to mention it does not work on the emulator yet.
bug - 2532726

Change-Id: If6dbf0d89c4681a647419e1911213a4c22dc3dab
2010-03-22 00:31:12 -07:00
Jean-Michel Trivi
9f3168b327 Merge "Fix two AudioFocus issues: - if a focus owner abandons audio focus during a call, the next focus owner in the stack was never notified - if a focus owner requests the focus while alread owning it, and the type of focus request changes, the previous focus owner was not notified that the type of focus loss had changed." 2010-03-19 16:31:34 -07:00
Jean-Michel Trivi
983ac2b8cf Unhide new constants used in AudioFocus API to denote a situation
where a new focus owner signals it  allows other audio apps to keep
playing by ducking their audio streams.

Change-Id: I1109f44546f3cbcff8ad33ee21cfff50f4f12177
2010-03-19 16:10:42 -07:00
Jean-Michel Trivi
e5e1e870fd Fix two AudioFocus issues:
- if a focus owner abandons audio focus during a call, the next
 focus owner in the stack was never notified
- if a focus owner requests the focus while alread owning it, and
 the type of focus request changes, the previous focus owner was
 not notified that the type of focus loss had changed.

Change-Id: Iee6c6e17bcdd3c225a4b600f40ba434294870f17
2010-03-19 15:39:03 -07:00
Marco Nelissen
aac4bfb49b Merge "We should pass null for the album artist if it was not set, instead of a copy of the artist, since the media provider needs to know whether the album artist was actually set." 2010-03-19 10:25:13 -07:00
Marco Nelissen
0096b8d7d1 We should pass null for the album artist if it was not set, instead of a copy
of the artist, since the media provider needs to know whether the album artist
was actually set.

Change-Id: I29b885c8293609299a55babadf9ca2a30e20e5bd
2010-03-19 08:07:26 -07:00
Jean-Michel Trivi
4b55d496dd Fix SDK build Remove links to hidden constant in javadoc.
Change-Id: I21495f0ef64b3dc154ce0e0ca2d44686afd752e9
2010-03-18 21:37:29 -07:00
Eric Laurent
95b88fbe74 Attempt to fix the SDK build.
Change-Id: I024df1b513da117057a21c27e6c0cd134cdd8023
2010-03-18 20:39:38 -07:00
Jean-Michel Trivi
078fd47e91 Support focus requests where ducking of the loser of audio focus
is acceptable for the new audio focus owner.

Change-Id: I965483f12eeb717115a8f6992d8f1ab7fafa4e45
2010-03-18 18:28:27 -07:00
Eric Laurent
c04cfa3596 Unhide AudioManager API to control bluetooth SCO audio connection.
Needed for issue 2416481 in order to allow unbundled applications to play and record
audio to/from a bluetooth SCO headset while not in call.

Change-Id: Ie1f96ded991e65da538c2c4a58bfa1e548d58a01
2010-03-18 18:18:48 -07:00
Marco Nelissen
42a9c53788 Merge "Include "album artist" when inserting items in the media provider." 2010-03-18 17:23:32 -07:00
Marco Nelissen
abc2819328 Include "album artist" when inserting items in the media provider.
Change-Id: Ic34e2d54557409866dc35c29ee397afdfe874762
2010-03-18 17:15:56 -07:00
Eric Laurent
3def1eec2b Issue 2416481: Support Voice Dialer over BT SCO.
Added public methods to AudioManager API so that unbundled applications can use bluetooth
SCO audio when the phone is not incall.
Without this change, the only way to activate and use bluetooth SCO is via the BluetoothHeadset API
which is not public yet.

Change-Id: Ia1680f219ea1d0943092d475d5be7d6638983ebb
2010-03-18 00:26:46 -07:00
Jean-Michel Trivi
308e9a5d09 Fix bug where the ID stored for an OnAudioFocusChangeListener is an
empty string when audio focus is requested or abandonned with a
null listener.

Change-Id: I7709b75c6092aefc002806343298bc679d42d6c6
2010-03-17 15:04:20 -07:00
Jean-Michel Trivi
d1f78767fc Merge "Implementation of the policing of transport control key press events among multiple applications competing for the remote control focus. AudioManager defines a new API for applications to use in order to register their BroadcastReceiver for the media button as the one to receive the corresponding intent, but all applications at the same time (in an ordered broadcast). AudioService handles a stack of remote control focus owners. It traps ACTION_MEDIA_BUTTON intents and sends a new intent to the remote control focus owner." 2010-03-17 14:47:45 -07:00
Jean-Michel Trivi
d327f21626 Implementation of the policing of transport control key press
events among multiple applications competing for the remote control
focus.
AudioManager defines a new API for applications to use in order to
register their BroadcastReceiver for the media button as the one
to receive the corresponding intent, but all applications at the
same time (in an ordered broadcast).
AudioService handles a stack of remote control focus owners. It
traps ACTION_MEDIA_BUTTON intents and sends a new intent to the
remote control focus owner.

Change-Id: I3c109221ecfb160cbb1ec0e40a71b241aad73812
2010-03-17 11:24:15 -07:00
Ray Chen
74d4843641 Fix #2509370 ThumbnailUtils.createThumbnailFromEXIF crashes media provider.
Change-Id: Ia2cd00fb0fbdb32e9fb89b4d33ad3c1410eb40d3
2010-03-15 10:45:35 -07:00
Ray Chen
e208377fba Add GPSProcessingMethod tag to ExifInterface.
Change-Id: I7575ae3195dc510e7020368794a66bb064839104
2010-03-11 17:41:04 -08:00
Ray Chen
b4ca6ef994 Avoid overriding DATE_TAKEN by unreliable file time. MediaProvider will calculate it if needed.
Change-Id: I05cb8628f2333c26de5c05ee1c7676b8f79a5e9a
2010-03-09 14:23:23 -08:00