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

Commit 569ffc7f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add prepareToDisconnectExternalDevice." into udc-dev

parents a64c3661 c004863d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -304,6 +304,7 @@ aidl_interface {
        "aidl/android/media/AudioTimestampInternal.aidl",
        "aidl/android/media/AudioUniqueIdUse.aidl",
        "aidl/android/media/AudioVibratorInfo.aidl",
        "aidl/android/media/DeviceConnectedState.aidl",
        "aidl/android/media/EffectDescriptor.aidl",
        "aidl/android/media/TrackSecondaryOutputInfo.aidl",
        "aidl/android/media/SurroundSoundConfig.aidl",
+4 −4
Original line number Diff line number Diff line
@@ -810,10 +810,10 @@ int32_t AudioFlingerClientAdapter::getAAudioHardwareBurstMinUsec() {
}

status_t AudioFlingerClientAdapter::setDeviceConnectedState(
        const struct audio_port_v7 *port, bool connected) {
        const struct audio_port_v7 *port, media::DeviceConnectedState state) {
    media::AudioPortFw aidlPort = VALUE_OR_RETURN_STATUS(
            legacy2aidl_audio_port_v7_AudioPortFw(*port));
    return statusTFromBinderStatus(mDelegate->setDeviceConnectedState(aidlPort, connected));
    return statusTFromBinderStatus(mDelegate->setDeviceConnectedState(aidlPort, state));
}

status_t AudioFlingerClientAdapter::setSimulateDeviceConnections(bool enabled) {
@@ -1369,9 +1369,9 @@ Status AudioFlingerServerAdapter::getAAudioHardwareBurstMinUsec(int32_t* _aidl_r
}

Status AudioFlingerServerAdapter::setDeviceConnectedState(
        const media::AudioPortFw& port, bool connected) {
        const media::AudioPortFw& port, media::DeviceConnectedState state) {
    audio_port_v7 portLegacy = VALUE_OR_RETURN_BINDER(aidl2legacy_AudioPortFw_audio_port_v7(port));
    return Status::fromStatusT(mDelegate->setDeviceConnectedState(&portLegacy, connected));
    return Status::fromStatusT(mDelegate->setDeviceConnectedState(&portLegacy, state));
}

Status AudioFlingerServerAdapter::setSimulateDeviceConnections(bool enabled) {
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.media;

/**
 * {@hide}
 */
@Backing(type="int")
enum DeviceConnectedState {
    CONNECTED = 0,
    DISCONNECTED = 1,
    PREPARE_TO_DISCONNECT = 2,
}
+2 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.media.CreateRecordRequest;
import android.media.CreateRecordResponse;
import android.media.CreateTrackRequest;
import android.media.CreateTrackResponse;
import android.media.DeviceConnectedState;
import android.media.OpenInputRequest;
import android.media.OpenInputResponse;
import android.media.OpenOutputRequest;
@@ -227,7 +228,7 @@ interface IAudioFlingerService {

    int getAAudioHardwareBurstMinUsec();

    void setDeviceConnectedState(in AudioPortFw devicePort, boolean connected);
    void setDeviceConnectedState(in AudioPortFw devicePort, DeviceConnectedState state);

    // Used for tests only. Requires AIDL HAL to work.
    void setSimulateDeviceConnections(boolean enabled);
+6 −3
Original line number Diff line number Diff line
@@ -361,7 +361,8 @@ public:

    virtual int32_t getAAudioHardwareBurstMinUsec() = 0;

    virtual status_t setDeviceConnectedState(const struct audio_port_v7 *port, bool connected) = 0;
    virtual status_t setDeviceConnectedState(const struct audio_port_v7 *port,
                                             media::DeviceConnectedState state) = 0;

    virtual status_t setSimulateDeviceConnections(bool enabled) = 0;

@@ -481,7 +482,8 @@ public:
            std::vector<media::audio::common::AudioMMapPolicyInfo> *policyInfos) override;
    int32_t getAAudioMixerBurstCount() override;
    int32_t getAAudioHardwareBurstMinUsec() override;
    status_t setDeviceConnectedState(const struct audio_port_v7 *port, bool connected) override;
    status_t setDeviceConnectedState(const struct audio_port_v7 *port,
                                     media::DeviceConnectedState state) override;
    status_t setSimulateDeviceConnections(bool enabled) override;
    status_t setRequestedLatencyMode(audio_io_handle_t output,
            audio_latency_mode_t mode) override;
@@ -711,7 +713,8 @@ public:
            std::vector<media::audio::common::AudioMMapPolicyInfo> *_aidl_return) override;
    Status getAAudioMixerBurstCount(int32_t* _aidl_return) override;
    Status getAAudioHardwareBurstMinUsec(int32_t* _aidl_return) override;
    Status setDeviceConnectedState(const media::AudioPortFw& port, bool connected) override;
    Status setDeviceConnectedState(const media::AudioPortFw& port,
                                   media::DeviceConnectedState state) override;
    Status setSimulateDeviceConnections(bool enabled) override;
    Status setRequestedLatencyMode(
            int output, media::audio::common::AudioLatencyMode mode) override;
Loading