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

Commit a302415e authored by Atneya Nair's avatar Atneya Nair Committed by Android (Google) Code Review
Browse files

Merge "Add query API for hotword flag support"

parents 7be37f8f eeab0a7d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ java_defaults {
        "modules-utils-uieventlogger-interface",
        "framework-permission-aidl-java",
        "spatializer-aidl-java",
        "audiopolicy-types-aidl-java",
        "audiopolicy-aidl-java",
        "sounddose-aidl-java",
    ],
}
+1 −0
Original line number Diff line number Diff line
@@ -6635,6 +6635,7 @@ package android.media {
    method public boolean isAudioServerRunning();
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean isBluetoothVariableLatencyEnabled();
    method public boolean isHdmiSystemAudioSupported();
    method @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_HOTWORD) public boolean isHotwordStreamSupported(boolean);
    method @RequiresPermission(android.Manifest.permission.CALL_AUDIO_INTERCEPTION) public boolean isPstnCallAudioInterceptable();
    method @RequiresPermission(android.Manifest.permission.ACCESS_ULTRASOUND) public boolean isUltrasoundSupported();
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void muteAwaitConnection(@NonNull int[], @NonNull android.media.AudioDeviceAttributes, long, @NonNull java.util.concurrent.TimeUnit) throws java.lang.IllegalStateException;
+21 −0
Original line number Diff line number Diff line
@@ -7526,6 +7526,27 @@ public class AudioManager {
        }
    }

    /**
     * @hide
     * Indicates whether the platform supports capturing content from the hotword recognition
     * pipeline. To capture content of this type, create an AudioRecord with
     * {@link AudioRecord.Builder.setRequestHotwordStream(boolean, boolean)}.
     * @param lookbackAudio Query if the hotword stream additionally supports providing buffered
     * audio prior to stream open.
     * @return True if the platform supports capturing hotword content, and if lookbackAudio
     * is true, if it additionally supports capturing buffered hotword content prior to stream
     * open. False otherwise.
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_HOTWORD)
    public boolean isHotwordStreamSupported(boolean lookbackAudio) {
        try {
            return getService().isHotwordStreamSupported(lookbackAudio);
        } catch (RemoteException e) {
            return false;
        }
    }

    /**
     * @hide
     * Introspection API to retrieve audio product strategies.
+3 −0
Original line number Diff line number Diff line
@@ -165,6 +165,9 @@ interface IAudioService {
    @EnforcePermission("ACCESS_ULTRASOUND")
    boolean isUltrasoundSupported();

    @EnforcePermission("CAPTURE_AUDIO_HOTWORD")
    boolean isHotwordStreamSupported(boolean lookbackAudio);

    void setMicrophoneMute(boolean on, String callingPackage, int userId, in String attributionTag);

    oneway void setMicrophoneMuteFromSwitch(boolean on);
+0 −1
Original line number Diff line number Diff line
@@ -173,7 +173,6 @@ java_library_static {
        "android.hardware.power.stats-V1-java",
        "android.hardware.power-V4-java",
        "android.hidl.manager-V1.2-java",
        "capture_state_listener-aidl-java",
        "icu4j_calendar_astronomer",
        "netd-client",
        "overlayable_policy_aidl-java",
Loading