1452 Commits

Author SHA1 Message Date
Jean-Michel Trivi
11001c344a Merge "Bug 5567648 disassociate audio mode and audio focus" 2012-01-27 14:15:37 -08:00
Jean-Michel Trivi
4dd3674e51 Bug 5567648 disassociate audio mode and audio focus
Don't automatically change the audio focus when
 the audio mode changes. This is best handled by the
 applications that change the audio mode so they
 can address their usecases as they please (for
 instance to define the behavior when switching calls).
Replaced the implicit "mode to focus" behavior with
 two methods to request and abandon audio focus. These
 methods are only to be used by the framework, and maintain
 the logic in AudioService to prevent other apps to request
 audio focus during a call.
A susequent change will update com.android.internal.telephony.CallManager
 to take advantage of these two methods.

Change-Id: If84ebd508e985083e8cac82ece44940c72b5c669
2012-01-27 13:32:45 -08:00
Glenn Kasten
c14639a9a1 Merge "Use audio_source_t consistently" 2012-01-27 09:06:00 -08:00
Glenn Kasten
0f0fbd9441 Use audio_source_t consistently
Was a mix of audio_source_t, uint8_t, and int.

Related fixes:
 - fix comments in MediaRecorder.java
 - AudioPolicyService server side was not checking source parameter at
   all, so if the client wrapper was bypassed, invalid values could be
   passed into audio HAL
 - JNI android_media_AudioRecord_setup was checking source for positive
   values, but not negative values. This test is redundant, since already
   checked at Java and now checked by AudioPolicyService also, but might
   as well make it correct.

Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
2012-01-26 16:50:19 -08:00
Jean-Michel Trivi
a701da8eba Update AudioTrack.stop() javadoc
Add more information on the behavior of
  android.media.AudioTrack.stop()

Change-Id: Id0f968e6bb8fe38765a86c43fc065908ee84edf1
2012-01-24 16:53:57 -08:00
Jason Simmons
db8b292b6d Make AudioManager.adjustMasterVolume public and hidden
Change-Id: Ied4d07c2f67f24d1e1963f4ff30650042334d563
2012-01-24 16:27:19 -08:00
Glenn Kasten
ee7fea9f2f Remove dead setRingerMode(mode, mask)
Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
2012-01-18 15:10:31 -08:00
Eric Laurent
9bc8358dda audio framework: manage stream volume per device
Improve volume management by keeping track of volume for each type
of device independently.
Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained
per device.

The main changes are:
- AudioService now keeps tracks of stream volumes per device:
 volume indexes are kept in a HashMap < device , index>.
 active device is queried from policy manager when a volume change request
 is received
 initalization, mute and unmute happen on all device simultaneously
- Settings: suffixes is added to volume keys to store each device
volume independently.
- AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument
to setStreamVolumeIndex() and getStreamVolumeIndex() to address each
device independently.
- AudioPolicyManagerBase: keep track of stream volumes for each device
and apply volume according to current device selection.

Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
2012-01-17 15:15:04 -08:00
John Grossman
881186c322 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: Id428fb946d6d7676bffd2a597366e8444ebe24f2
Signed-off-by: John Grossman <johngro@google.com>
2012-01-12 14:36:16 -08:00
John Grossman
595d76ee82 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: I50458961992a64d9b3c46db7e5e8e6414a92228f
Signed-off-by: John Grossman <johngro@google.com>
2012-01-12 11:52:39 -08:00
Sungsoo Lim
6c4c155696 MediaScanner: Disable bulk insert for settings
Since the settings (notifications, ringtones, and alarms) request
rowId after inserting into DB, do not use bulk insert for them.
(Bulk insert does not return the rowId)

Change-Id: I8faf993f8ac2da96672594a1c92ddc917f964d6f
2012-01-11 11:34:20 +09:00
Glenn Kasten
b282e08ab6 Fix build
Change-Id: Ia140af1a61edf124ef3d48b60351f850a3475af1
2012-01-09 13:11:07 -08:00
Glenn Kasten
5c17a820f9 Audio Java doc comment typos and minor changes
Change-Id: Id6ea6dccb8054c9f05db9a9c045387ce813659e6
2012-01-09 12:15:18 -08:00
Glenn Kasten
13f94dc5bd Merge "Fix race conditions related to ringer mode" 2012-01-09 12:01:37 -08:00
Mike Lockwood
0b8afdac73 Restore persisted master volume if the media server restarts
Bug: 5755071

Change-Id: I6934276049b4a9d713bb4754aa3bb2cd3b898604
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-01-06 11:58:54 -05:00
Marco Nelissen
18c6afa0c5 Merge "Also accept non-parenthesized genre numbers" 2012-01-06 08:08:15 -08:00
Marco Nelissen
ad35f9165e Also accept non-parenthesized genre numbers
b/5790684

Change-Id: Ia13feebeaadd45d9196486c012538c5b80840163
2012-01-05 15:15:53 -08:00
Mike Lockwood
d10a663be6 Don't allow changing master volume when muted
Bug: 5793021

Change-Id: If93a41c4e61f1bc730759e77ee5b5f8165025c42
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-01-05 13:25:33 -05:00
Dongwon Kang
3993818689 ThumbnailUtils: To fix misuse of FileInputStream.
We need to close it explicitly after using it. Without this, fd will be closed
non-deterministically, and that will break the decode procedure.

Bug: 5808889
Change-Id: Icf9ff9abd6e327b122c6916df9750016b3d1b616
2012-01-05 17:17:48 +09:00
Eric Laurent
afbb047c39 AudioService: simplified handler messages.
For historical reasons, messages to the AudioSystem
handler in AudioService have a complex identifier combining several information.
Messages for a particular stream contain the stream type as part of the message type.
This complexity is not needed as the stream messages also carry a reference to the
VolumeStreamState object which contains all necessary information, including the stream type.

Also grouped parameters of MSG_PERSIST_VOLUME message into a single bit field to make room for
further needs.

Change-Id: Ia27af626b3447541e8f9eaceba21389a824d88e2
2011-12-20 18:07:41 -08:00
Mike Lockwood
c239379c0c AudioService: remove logging from adjustMasterVolume that was left in by mistake
Change-Id: I75c430d2c50c4cab3b6207efab5a6f11aed728d2
Signed-off-by: Mike Lockwood <lockwood@google.com>
2011-12-16 11:26:37 -05:00
Mike Lockwood
f9113d311b Defer persisting master data to avoid excessive database writes
Bug: 5705192

Change-Id: I252bd72ff72ef4a40174d4597059e89691acb34f
Signed-off-by: Mike Lockwood <lockwood@google.com>
2011-12-15 17:26:17 -05:00
Glenn Kasten
25adf47477 Merge "Fix indentation and whitespace" 2011-12-14 17:35:36 -08:00
Glenn Kasten
fb2ab9efc3 Fix indentation and whitespace
Use git diff -w to verify.

Change-Id: Ib65be0a1ecf65d6cad516110604e3855bf68a638
2011-12-14 16:54:05 -08:00
Glenn Kasten
5bb8f80fc4 Fix typo in error message, missing space
Change-Id: Icdddbf2fddb81a1db538dd94fb25cf859e44bfbd
2011-12-14 13:13:13 -08:00
Joe Onorato
b782e8d71e logging
Change-Id: I6fde5617365f479884937615e0d3f0f4ecc2dc14
2011-12-13 22:17:04 -08:00
Glenn Kasten
ba195ebc76 Fix race conditions related to ringer mode
Consistently protect all reads and writes of mRingerMode by mSettingsLock.

Change-Id: I72675ff9009880cc212616f0f79f809a28eb6bff
2011-12-13 10:04:56 -08:00
Mike Lockwood
a8f4e83595 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

Change-Id: I041a112cd39e1c00dcae27e2266a95ce225e9b64
Signed-off-by: Mike Lockwood <lockwood@google.com>
2011-12-07 12:34:31 -08:00
Amith Yamasani
52cb1da2c6 am f3364080: Merge "New and improved silent mode on lockscreen." into ics-mr1
* commit 'f336408000c4be36045401fb4df89528249e7383':
  New and improved silent mode on lockscreen.
2011-12-07 11:02:51 -08:00
James Dong
ca402cdcac Update onVideoSizeChanged() callback method Java doc to explicitly specify the conditions under which the width/height passed
to the callback could be 0.

Change-Id: Ie921f0af8284eccfd02c4a5826ed41fe19f9676f
related-to-bug: 5613451
2011-12-06 17:58:22 -08:00
Amith Yamasani
9c316f3c6a am d49ec62c: am f3364080: Merge "New and improved silent mode on lockscreen." into ics-mr1
* commit 'd49ec62cfb0469c39f2b5d79cbf2a6f69cceb7d7':
  New and improved silent mode on lockscreen.
2011-12-06 16:59:44 -08:00
Amith Yamasani
6243edd818 New and improved silent mode on lockscreen.
3-state item to toggle between Silent/Vibrate/Ringer in long-press power menu.
No volume dialog on lockscreen, unless Power menu is up.

Set VIBRATE_IN_SILENT=1 when upgrading device.

Change-Id: I097d216f96c4abdbd83420e0c477106951b3607d
2011-12-06 14:48:38 -08:00
Mike Lockwood
3309386a1b AudioService: Send broadcasts when master volume and mute state change
Change-Id: I7eb5041f0c14f419317e29ea6fa7faa9159cf165
Signed-off-by: Mike Lockwood <lockwood@google.com>
2011-12-05 18:47:38 -08:00
Amith Yamasani
89972657bd am f8dad0b3: am afd01086: Merge "Further volume improvements." into ics-mr1
* commit 'f8dad0b37d9aa2476ef3ab84b9f4a7a9f4c960e4':
  Further volume improvements.
2011-12-02 17:49:31 -08:00
Hong Teng
29f1c32eea am 5126f1d4: am 613ed4c6: Merge "Fixd for 5490443 Native crash while exporting a video - Add new onError callback to PreviewProgressListener, which is used to indicate video editor application for the error that has occurred during priviewing. With this modification,
* commit '5126f1d413b4fcb0aff5b364e1e5a41c89ca665c':
  Fixd for 5490443 Native crash while exporting a video - Add new onError callback to PreviewProgressListener, which is used to indicate video editor application for the error that has occurred during priviewing. With this modification, the application must implement the onError method, and then VideoEditorPreviewTest.java is changed accordingly.
2011-12-02 13:44:10 -08:00
Mike Lockwood
15cf022c70 am 1a3ece9f: Merge "MTP: Add support for restricting PTP to only certain subdirectories of the storage DO NOT MERGE" into ics-mr1
* commit '1a3ece9f871c94eb524543ae618a2a1c88cab2cd':
  MTP: Add support for restricting PTP to only certain subdirectories of the storage DO NOT MERGE
2011-12-02 13:22:28 -08:00
Mike Lockwood
7944c1b19f MTP: Add support for restricting PTP to only certain subdirectories of the storage DO NOT MERGE
Bug: 5527220

Change-Id: I81d6de590ea3002118ba46eb4b6d5fe9061c998c
Signed-off-by: Mike Lockwood <lockwood@google.com>
2011-12-02 15:12:47 -05:00
Amith Yamasani
54a7962590 am afd01086: Merge "Further volume improvements." into ics-mr1
* commit 'afd01086795c7c1f6950a709180b2361625b8b6a':
  Further volume improvements.
2011-12-02 11:23:50 -08:00
Amith Yamasani
afd0108679 Merge "Further volume improvements." into ics-mr1 2011-12-02 11:22:32 -08:00
Jean-Michel Trivi
d62da2d0da Remove unused variable and imports in AudioManager
Remove unused imports.
Remove private mHandler variable: it was assigned a new Handler
 object but was never accessed.

Change-Id: I63cd08aa38701ea157fef7d3185a58a6e2a95822
2011-12-02 09:54:16 -08:00
Hong Teng
1109fe9d81 am 613ed4c6: Merge "Fixd for 5490443 Native crash while exporting a video - Add new onError callback to PreviewProgressListener, which is used to indicate video editor application for the error that has occurred during priviewing. With this modification, the applicati
* commit '613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0':
  Fixd for 5490443 Native crash while exporting a video - Add new onError callback to PreviewProgressListener, which is used to indicate video editor application for the error that has occurred during priviewing. With this modification, the application must implement the onError method, and then VideoEditorPreviewTest.java is changed accordingly.
2011-12-02 09:33:47 -08:00
Hong Teng
613ed4c69a Merge "Fixd for 5490443 Native crash while exporting a video - Add new onError callback to PreviewProgressListener, which is used to indicate video editor application for the error that has occurred during priviewing. With this modification, the application must implement the onError method, and then VideoEditorPreviewTest.java is changed accordingly." into ics-mr1 2011-12-02 09:32:02 -08:00
Mike Lockwood
6a5c1a9574 Merge "MTP: Add support for restricting PTP to only certain subdirectories of the storage" 2011-12-02 08:17:33 -08:00
Mike Lockwood
73e56d935e MTP: Add support for restricting PTP to only certain subdirectories of the storage
Bug: 5527220

Change-Id: If68e7481617ecb62abd24e2d89e6b7dfdf95ba2b
Signed-off-by: Mike Lockwood <lockwood@google.com>
2011-12-02 11:08:39 -05:00
Eric Laurent
ee07e110d9 am 6cfa9e6c: am 0d3a2e93: Merge "AudioService: strengthen A2DP device detection" into ics-mr1
* commit '6cfa9e6c507a721f647518569c89db9560056079':
  AudioService: strengthen A2DP device detection
2011-12-01 20:38:15 -08:00
Eric Laurent
c1f069bb40 am 0d3a2e93: Merge "AudioService: strengthen A2DP device detection" into ics-mr1
* commit '0d3a2e93394efa4729e5c29ff4515f9f2644b8c3':
  AudioService: strengthen A2DP device detection
2011-12-01 20:35:32 -08:00
Amith Yamasani
2ef6f1bb56 Further volume improvements.
- Remove silent mode from Power menu
- Show volume dialog on lockscreen
- Allow beeps when adjusting volume in lockscreen

Bug: 5586083
Change-Id: I93052a8ec5004c784f20e04488af9382d495e711
2011-12-01 15:05:54 -08:00
Hong Teng
63149c81ad Fixd for 5490443 Native crash while exporting a video
- Add new onError callback to PreviewProgressListener, which is
used to indicate video editor application for the error that has occurred during
priviewing.
With this modification, the application must implement the onError method,
and then VideoEditorPreviewTest.java is changed accordingly.

Change-Id: I15610b8907fcf8bd35a3c69ad7c07b5175a6e309
2011-12-01 09:43:42 -08:00
Eric Laurent
6bc7f2cd30 AudioService: strengthen A2DP device detection
If the intent BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED is broadcast
before AudioService is started, The A2DP device connection is never detected
by the audio framework resulting in audio not being routed to A2DP unless the device
is rebooted or the A2DP headset reconnected.

Make sure that A2DP device connection state is sampled when
boot completed event is received.

Issue 5665159

Change-Id: I04d82020afc00af28c5ea0bb9879ed55bcc9b6f3
2011-11-30 17:08:44 -08:00
dujin.cha
55cadf7eca am 4d592c59: am eabde3d4: am fe464a76: [Prime K] Fix gabage character issue
* commit '4d592c59e684ed3e6f0db4b05c37ba8774b8d410':
  [Prime K] Fix gabage character issue
2011-11-22 13:22:00 -08:00