summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt2
-rw-r--r--media/java/android/media/AudioManager.java7
-rw-r--r--services/audioflinger/AudioPolicyService.cpp9
3 files changed, 6 insertions, 12 deletions
diff --git a/api/current.txt b/api/current.txt
index fee4df6a6967..051fef624b61 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -10253,7 +10253,7 @@ package android.media {
method public boolean isMicrophoneMute();
method public boolean isMusicActive();
method public boolean isSpeakerphoneOn();
- method public boolean isWiredHeadsetOn();
+ method public deprecated boolean isWiredHeadsetOn();
method public void loadSoundEffects();
method public void playSoundEffect(int);
method public void playSoundEffect(int, float);
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index da7a050d1275..56a993398874 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1061,10 +1061,13 @@ public class AudioManager {
}
/**
- * Checks whether audio routing to the wired headset is on or off.
+ * Checks whether a wired headset is connected or not.
+ * <p>This is not a valid indication that audio playback is
+ * actually over the wired headset as audio routing depends on other conditions.
*
- * @return true if audio is being routed to/from wired headset;
+ * @return true if a wired headset is connected.
* false if otherwise
+ * @deprecated Use only to check is a headset is connected or not.
*/
public boolean isWiredHeadsetOn() {
if (AudioSystem.getDeviceConnectionState(DEVICE_OUT_WIRED_HEADSET,"")
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index d747b5adf3e2..8da5ca14dd74 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -182,9 +182,6 @@ audio_policy_dev_state_t AudioPolicyService::getDeviceConnectionState(
if (mpAudioPolicy == NULL) {
return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE;
}
- if (!checkPermission()) {
- return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE;
- }
return mpAudioPolicy->get_device_connection_state(mpAudioPolicy, device,
device_address);
}
@@ -250,9 +247,6 @@ audio_policy_forced_cfg_t AudioPolicyService::getForceUse(audio_policy_force_use
if (mpAudioPolicy == NULL) {
return AUDIO_POLICY_FORCE_NONE;
}
- if (!checkPermission()) {
- return AUDIO_POLICY_FORCE_NONE;
- }
if (usage < 0 || usage >= AUDIO_POLICY_FORCE_USE_CNT) {
return AUDIO_POLICY_FORCE_NONE;
}
@@ -434,9 +428,6 @@ status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, in
if (mpAudioPolicy == NULL) {
return NO_INIT;
}
- if (!checkPermission()) {
- return PERMISSION_DENIED;
- }
if (stream < 0 || stream >= AUDIO_STREAM_CNT) {
return BAD_VALUE;
}