1114 Commits

Author SHA1 Message Date
Eric Laurent
497b3fe725 Issue 5081351: isWiredHeadsetOn() permission.
AudioManager.isWiredHeadsetOn() should not require permission MODIFY_AUDIO_SETTINGS.
Remove permission checks on all getters in audio policy manager as permission enforcement
is really usefull for setters.
Also deprecate AudioManager.isWiredHeadsetOn() which name and implementation are deceptive.

Change-Id: I38f8df7c26c0d417bf0e2b74e4c11c2d143f2ecd
2011-08-12 17:43:35 -07:00
Jean-Michel Trivi
bb04910893 Merge "Pass flags on remote control client information change in intent" 2011-08-12 09:21:27 -07:00
Ted Bonkenburg
1ee60119c4 Remove ParcelSurfaceTexture and update MediaPlayer
This removes the ParcelSurfaceTexture class since that functionality has been
folded into Surface.java. The change also updates the MediaPlayer to get rid
of setParcelSurfaceTexture() and modifies setTexture() to use the new Surface
functionality in order to simplify the code.

Change-Id: Iafa75ea3188263928128325d8a726786971b4de4
2011-08-11 19:58:25 -07:00
Marco Nelissen
bcbddd9342 Only set the ringtones and such if this is the first media scan
b/5126979

Change-Id: Ibef2bd5a3a1a288fc1137694e858d87628d780c0
2011-08-11 15:44:38 -07:00
Jean-Michel Trivi
b5f04d6dbf Pass flags on remote control client information change in intent
Pass the flags about what information changed in the remote
 control client in the intent used by the remote control display.
Also pass the IRemoteControlClient to verify it is still current
 before sending the intent.

Marked some logs as to be removed before release.

Change-Id: Ib3aa22d061e5dfaf80a9c4c78774c931a2cf0fbd
2011-08-11 10:50:43 -07:00
Marco Nelissen
f1ddd51f9c Check pids instead of IBinders
There can be multiple AudioManagers per process (because each Context has
its own cache of services), so AudioService should protect SCO activation
based on whether the pids match, not whether the IBinders match.

b/5044873

Change-Id: Ibec81365f95fec11f34b47becd0e473762bf06ad
2011-08-10 14:32:45 -07:00
Mike Lockwood
bdbe6939ff Merge "Use video/webm mime type for WEBM files" 2011-08-10 10:28:25 -07:00
Mike Lockwood
b33e079aca Merge "MediaScanner: Disable bulk inserts" 2011-08-10 10:28:18 -07:00
Gloria Wang
cd7f0d7f72 Merge "To support for switching from a non-null surface/ surface texture to a null one, and vice versa. Fix for bug 5137445." 2011-08-10 09:28:50 -07:00
Mike Lockwood
ff53591482 Use video/webm mime type for WEBM files
Bug: 5042137

Change-Id: I677af1b4f34c37c78f84229551a8d82f1a7bf245
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-08-10 12:16:40 -04:00
Mike Lockwood
3410b46565 MediaScanner: Disable bulk inserts
We are still finding bugs related to the bulk insert support,
so lets disable it for now.

Bug: 5026233

Change-Id: I436cd8fc5dbe9fcf220a623f1c070cf901c6d38c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-08-10 12:13:30 -04:00
Jean-Michel Trivi
17da769e98 AudioService: don't use a soft reference on IRemoteControlClient
In the remote control stack, don't use a SoftReference to the
 IRemoteControlClient because the client live in a different
 process, which causes the reference to become null at the
 earliest opportunity.

Change-Id: I7f7733f9a1a043825cd5e8769282b535657dd82d
2011-08-09 18:44:00 -07:00
Gloria Wang
91784c996f To support for switching from a non-null surface/ surface texture to
a null one, and vice versa.
Fix for bug 5137445.

Change-Id: Ifca2997f8ad27a843abbdaa7e89a56329bc40fde
2011-08-09 15:31:30 -07:00
Neel Parekh
8d4ed0d8e1 Prevent NPE when registering a remote control client
Change-Id: Ia22b456b1cbdd89736118c7e68b7c68dd6e59c64
2011-08-08 13:25:46 -07:00
Jean-Michel Trivi
7b6198cacc Bug 5045498 API for client to notify remote control info changed
Update to API for a client to notify what type of information
 changed (e.g. playstate, metadata) to optimize small updates
 without the remote control display having to do expensive
 queries such as album art.

When the remote control display retrieves the flags about
 what information changed, the flag gets cleared.

Change-Id: I7d3d8d3eecd1da44695d84905ed9e7b70fe38b86
2011-08-07 17:44:47 -07:00
Jean-Michel Trivi
5d49678841 Merge "Make retrieving remote control client go through binder interface" 2011-08-07 13:48:04 -07:00
Mike Lockwood
43b076bb75 MediaScanner: Fix UnsupportedOperationException when scanning internal media
The media scanner was crashing while tring to insert genre data in the internal
media database, which does not support genres.
This resulted in some or all of the built in ringtones being unavailable

Bug: 5124718

Change-Id: Ib306348dd9808e59477b327b4adcb413957d8d24
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-08-05 19:20:44 -04:00
Neel Parekh
ced110ec59 Make retrieving remote control client go through binder interface
The way the old way worked relied on the process retrieving the
current remote control client to be in the exact same process as
the AudioService.  This removes that dependency.

Change-Id: I1ba8bf32b61ec1e979ef7eee9661ba801aa19690
2011-08-05 14:36:31 -07:00
Jean-Michel Trivi
a30a21cf2e Remove empty remote control client listener methods
Remove non-implemented methods for registering IRemoteControlClient
 listeners.

Rename refreshRemoteControlDisplay() method to follow framework
 conventions.

Change-Id: I9254e8eeea9020a530c9a32f328f0ef7dbd9dd0c
2011-08-04 10:28:07 -07:00
Eric Laurent
045d179ff6 Merge "AudioService: ignore NOTIFICATIONS_USE_RING_VOLUME." 2011-08-03 11:51:55 -07:00
Jean-Michel Trivi
4415629112 Merge "Remote control display API and implementation" 2011-08-03 09:09:43 -07:00
Jean-Michel Trivi
8f619182cb Remote control display API and implementation
Extend the media button event registration AudioManager API to
 enable applications to register as a client of "remote controls"
 and let them provide information meant to be displayed
 by the remotes.
AudioService sends a AudioManager.REMOTE_CONTROL_CLIENT_CHANGED
 intent to let remote controls know when / from whom they can
 retrieve the information to display.
Only application that own audio focus, are the currently
 registered media button event receiver, and have registered
 a remote control client, are eligible to appear on the
 remote control.

To address in future CLs:
- change how a remote control client forces a refresh
- rename methods called under lock to ___Locked()
- make API public

Change-Id: Icca30ab05dac2605ee9246f8acb27a03dcea077a
2011-08-02 17:15:42 -07:00
Eric Laurent
4eb5a57138 AudioService: ignore NOTIFICATIONS_USE_RING_VOLUME.
Do not take NOTIFICATIONS_USE_RING_VOLUME setting into account now
that it has been deprecated. STREAM_NOTIFICATION and STREAM_RING
always use the same volume setting.

Change-Id: Ibf6e5f86133d3781fd9e66455be64582318d93e6
2011-08-02 16:58:10 -07:00
Dianne Hackborn
6311d0a079 Clear the bitmap from the canvas in a lot of places.
Change-Id: I6b2071ac7b348c473b9bdd1b972d095aebbb4fb3
2011-08-02 16:37:58 -07:00
Mike Lockwood
e5d0495d52 MediaScanner: Move genre table management to MediaProvider
Fixes problems introduced with bulk insert support

Bug: 5092877

Change-Id: If3c0c9054d5effe0a1d7a75e85635b41ba1591f5
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-31 17:06:01 -04:00
Glenn Kasten
6ff9b812ab Bug 4599730 Get audio channel count on MediaPlayer
Related changes:
 - Fix bug in get/setParameter* to recycle Parcels when done with them.

Change-Id: Iaff05e91bbd99a14fccb79d816dd873359b6ae65
2011-07-27 10:21:09 -07:00
Pannag Sanketi
85a315b547 Merge "Fixing up Mediarecorder for MFF" 2011-07-26 15:57:17 -07:00
Mike Lockwood
833bfd2ba5 Merge "MediaScanner: Fix problem with duplicate directory entries in the database" 2011-07-26 10:10:28 -07:00
Jean-Michel Trivi
af20eacc21 Merge "Fix bug 4319552 Java to native channel mask translation" 2011-07-26 09:27:53 -07:00
Mike Lockwood
c6eaa713a3 MediaScanner: Fix problem with duplicate directory entries in the database
Bug: 5078643

Change-Id: I8804ff5bbd729f57be7ff0b17a4b134cafe78c18
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-26 10:57:42 -04:00
Pannag Sanketi
cac873bd4a Fixing up Mediarecorder for MFF
For using the MediaRecorder in MFF (Mobile Filter Framework),
getMediaRecorder method in mediarecorder jni was earlier changed to
a non static method. Changed it back to a static method.

Also, added a new source type to MediaRecorder.VideoSource for recording
GRalloc buffers.

Change-Id: I031fad45c12b0ac9602d9e451d4767e95a86234d
2011-07-25 17:38:15 -07:00
Jean-Michel Trivi
d9ae1c573e Fix bug 4319552 Java to native channel mask translation
When creating a new AudioTrack instance, translate from a Java
  channel mask as defined in android.media.AudioFormat to one
  as defined in audio.h which matches industry-standard
  channel mask definitions.

Change-Id: I7eeece8ec2a437977c31f6e82590f9591158144b
2011-07-25 17:06:22 -07:00
Eric Laurent
0f7f4ece1b Added APIs for audio preprocessing
Added APIs to control pre processes applied on captured audio.
Those APIs are still hidden until reviewed by API council.

Three types of standard pre processes are supported:
- Automatic Gain Control (AGC) by AutomaticGainControl class
- Acoustic Echo Cancellation (AEC) by AcousticEchoCanceler class
- Noise Suppression (NS) by NoiseSuppressor class

A method is added to AudioEffect class to query audio pre processings
applied by default by the platform on a given AudioRecord session ID.

Change-Id: I0b9fceeb8c704dd06319c3b52b85c96fe871d51d
2011-07-25 14:39:00 -07:00
Jean-Michel Trivi
d92eb58897 Merge "Fix bug 4211099 channel constants and 7.1 mask" 2011-07-25 11:07:16 -07:00
Ted Bonkenburg
5518dd92d3 Merge "Add support for creating a Surface from a a SurfaceTexture." 2011-07-25 10:24:30 -07:00
Jean-Michel Trivi
ff7656c9de Fix bug 4211099 channel constants and 7.1 mask
Add definitions for the side and elevated channels.

Add new (correct) definition for 7.1 mask which uses
 the side channels rather than the front half-pan channels.

Change-Id: I13d93f99f3b453ce2ab5fdc2da66629ed7f337ef
2011-07-24 16:25:38 -07:00
Ted Bonkenburg
0de171b0d4 Add support for creating a Surface from a a SurfaceTexture.
The Surface is already using SurfaceTexture internally and it is parcelable. This
is intended to replace and phase out ParcelSurfaceTexture in favor of creating a
new Surface.java object from an existing SurfaceTexture.

Change-Id: I8e2dd86614523da6abed6403e1d705a68fa19fdf
2011-07-22 16:36:44 -07:00
James Dong
3ff98beeaf Deprecate two methods in MediaRecorder.java class
Change-Id: I98fbe628fe77867b97c04f44458948ede2f49d22
2011-07-22 11:45:50 -07:00
Hong Teng
432fb8ecbe Merge "fix for issue 4142219 Don't hard code platform-specific limitations-jni/java part" 2011-07-21 11:13:43 -07:00
Eric Laurent
0eecc27714 Merge "AudioRecord JAVA: expose audio session Id" 2011-07-20 19:25:34 -07:00
Hong Teng
600acf14ff fix for issue 4142219
Don't hard code platform-specific limitations-jni/java part

Change-Id: Icde261b1caf29a8cf552884c97f3c9d0b41741a3
2011-07-20 16:51:39 -07:00
Mike Lockwood
a331cdbb40 Merge "MediaScanner: Do separate bulk inserts for different media types" 2011-07-20 12:15:48 -07:00
Eric Laurent
5531a3a3cf Merge "Fix issue 5012047: silent mode mutes music" 2011-07-20 11:04:18 -07:00
Mike Lockwood
e19572ccb5 MediaScanner: Do separate bulk inserts for different media types
This should fix a bunch of problems introduced in the original bulk insert implementation

Also reverted two changes that are no longer necessary:

Revert "MediaScanner: Add virtual NO_MEDIA column to fix support for .nomedia files"

This reverts commit 92e1314ad9ddbacfb806405e9aceeea4a8aae19f.

Revert "MediaScanner: fix breakage in updates"

This reverts commit 45aaa2a345292bb6d600822db602f25e261c0e50.

Change-Id: Ibed66393467761c2c1ce48deb09bcac505b7d221
2011-07-20 10:58:45 -07:00
Eric Laurent
72668b2c04 Fix issue 4499450: Unknown Ringer Mode
Added a validity check on ringer mode values in AudioManager.setRingerMode().

Change-Id: Ie780edc1d347009d90f000018a71520b04e0c4a1
2011-07-19 16:04:27 -07:00
Eric Laurent
c1d4166289 Fix issue 5012047: silent mode mutes music
Implemented different silent mode behaviors for tablets and phones.
The behavior inherited from Honeycomb was for tablets only and
was muting music in silent mode.

Change-Id: Ib053e7b70ca02190debc87648ab8a163f9d39577
2011-07-19 14:46:32 -07:00
Narayan Kamath
06e0333c7e Return the play stayed locked.
I believe the the synchronized block is required to allow
other threads to observe changes to mPlayState in a timely
manner.

Change-Id: I502b7401196c42932c9667ef73eb4cae16c3da16
2011-07-19 15:43:52 +01:00
Eric Laurent
44ff4cd8be AudioRecord JAVA: expose audio session Id
Added getAudioSessionId() method to AudioRecord class so that applications can
retrieve the AudioRecord's session ID and attach audio pre processes.

Change-Id: I1914770f0e54d97c9aef6a9eb36fff69b6d31552
2011-07-18 09:43:23 -07:00
Mike Lockwood
92e1314ad9 MediaScanner: Add virtual NO_MEDIA column to fix support for .nomedia files
Bug: 5025615

Change-Id: Ia910cd1c063292599a03b878755edb2e3cdbbb57
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-15 12:17:33 -04:00
Narayan Kamath
88bde0ce37 Minor documentation updates for the AudioTrack class.
Change-Id: I0c3c220aa433d1917d997a7b1bfa54e61acc26b2
2011-07-14 18:10:47 +01:00