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

Commit c6eb5c91 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "audio: Add volume/mute, audio mode, and screen state to IModule"

parents 85ee679e 3b125b76
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -91,12 +91,14 @@ aidl_interface {
    name: "android.hardware.audio.core",
    vendor_available: true,
    srcs: [
        "android/hardware/audio/core/AudioMode.aidl",
        "android/hardware/audio/core/AudioPatch.aidl",
        "android/hardware/audio/core/AudioRoute.aidl",
        "android/hardware/audio/core/IConfig.aidl",
        "android/hardware/audio/core/IModule.aidl",
        "android/hardware/audio/core/IStreamIn.aidl",
        "android/hardware/audio/core/IStreamOut.aidl",
        "android/hardware/audio/core/ITelephony.aidl",
        "android/hardware/audio/core/MmapBufferDescriptor.aidl",
        "android/hardware/audio/core/ModuleDebug.aidl",
        "android/hardware/audio/core/StreamDescriptor.aidl",
+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.audio.core;
@Backing(type="int") @VintfStability
enum AudioMode {
  NORMAL = 0,
  RINGTONE = 1,
  IN_CALL = 2,
  IN_COMMUNICATION = 3,
  CALL_SCREEN = 4,
}
+17 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ package android.hardware.audio.core;
@VintfStability
interface IModule {
  void setModuleDebug(in android.hardware.audio.core.ModuleDebug debug);
  @nullable android.hardware.audio.core.ITelephony getTelephony();
  android.media.audio.common.AudioPort connectExternalDevice(in android.media.audio.common.AudioPort templateIdAndAdditionalData);
  void disconnectExternalDevice(int portId);
  android.hardware.audio.core.AudioPatch[] getAudioPatches();
@@ -49,6 +50,15 @@ interface IModule {
  boolean setAudioPortConfig(in android.media.audio.common.AudioPortConfig requested, out android.media.audio.common.AudioPortConfig suggested);
  void resetAudioPatch(int patchId);
  void resetAudioPortConfig(int portConfigId);
  boolean getMasterMute();
  void setMasterMute(boolean mute);
  float getMasterVolume();
  void setMasterVolume(float volume);
  boolean getMicMute();
  void setMicMute(boolean mute);
  void updateAudioMode(android.hardware.audio.core.AudioMode mode);
  void updateScreenRotation(android.hardware.audio.core.IModule.ScreenRotation rotation);
  void updateScreenState(boolean isTurnedOn);
  @VintfStability
  parcelable OpenInputStreamArguments {
    int portConfigId;
@@ -72,4 +82,11 @@ interface IModule {
    android.hardware.audio.core.IStreamOut stream;
    android.hardware.audio.core.StreamDescriptor desc;
  }
  @Backing(type="int") @VintfStability
  enum ScreenRotation {
    DEG_0 = 0,
    DEG_90 = 1,
    DEG_180 = 2,
    DEG_270 = 3,
  }
}
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.audio.core;
@VintfStability
interface ITelephony {
  android.hardware.audio.core.AudioMode[] getSupportedAudioModes();
  void switchAudioMode(android.hardware.audio.core.AudioMode mode);
}
+38 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.hardware.audio.core;

/**
 * The audio mode describes states of the audio system of the device that
 * can significantly affect the rules of audio routing, volume control, etc.
 * The audio mode is controlled by the framework, however the HAL has some
 * flexibility in the choice of modes to support, see 'IModule.updateAudioMode'.
 */
@VintfStability
@Backing(type="int")
enum AudioMode {
    /** No active calls. */
    NORMAL = 0,
    /** The device is playing the ringtone. */
    RINGTONE = 1,
    /** The call is handled by the telephony stack ("voice call"). */
    IN_CALL = 2,
    /** The call is handled by an application ("VoIP call"). */
    IN_COMMUNICATION = 3,
    /** Call screening is in progress. */
    CALL_SCREEN = 4,
}
Loading