Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54074fe3 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "Issue 5081351: isWiredHeadsetOn() permission."

parents f9ef0db8 497b3fe7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+5 −2
Original line number Diff line number Diff line
@@ -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,"")
+0 −9
Original line number Diff line number Diff line
@@ -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;
    }