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

Commit b64fac77 authored by Kim Baekgyeong's avatar Kim Baekgyeong Committed by Mikhail Naganov
Browse files

Add audio stream and usage for virtual assistant

New stream type: AUDIO_STREAM_ASSISTANT
This is intended to be used by a virtual assistant like
Google Assistant, Bixby, etc.

The audio stream has own volume alias and the volume
does not change by volume changes of other streams.

Bug: 123745215
Test: make
Change-Id: Iad07d9f0b25ea35c6d565be677af7815bf2f6bd7
parent 7084521a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3970,6 +3970,7 @@ package android.media {
    field public static final int AUDIOFOCUS_FLAG_DELAY_OK = 1; // 0x1
    field public static final int AUDIOFOCUS_FLAG_LOCK = 4; // 0x4
    field public static final int AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS = 2; // 0x2
    field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int STREAM_ASSISTANT = 11; // 0xb
    field public static final int SUCCESS = 0; // 0x0
  }
+8 −1
Original line number Diff line number Diff line
@@ -3868,6 +3868,12 @@ public final class Settings {
         */
        public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
        /**
         * @hide
         * Volume index for virtual assistant.
         */
        public static final String VOLUME_ASSISTANT = "volume_assistant";
        /**
         * Master volume (float in the range 0.0f to 1.0f).
         *
@@ -3946,7 +3952,7 @@ public final class Settings {
                "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
                "" /*STREAM_DTMF, no setting for this stream*/,
                "" /*STREAM_TTS, no setting for this stream*/,
                VOLUME_ACCESSIBILITY
                VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT
            };
        /**
@@ -4493,6 +4499,7 @@ public final class Settings {
            PUBLIC_SETTINGS.add(VOLUME_ALARM);
            PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
            PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
            PUBLIC_SETTINGS.add(VOLUME_ASSISTANT);
            PUBLIC_SETTINGS.add(RINGTONE);
            PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
            PUBLIC_SETTINGS.add(ALARM_ALERT);
+3 −0
Original line number Diff line number Diff line
@@ -4194,4 +4194,7 @@
         value is left empty.  When this is non-empty then config_rawContactsLocalAccountName
         should also be non-empty.-->
    <string name="config_rawContactsLocalAccountType" translatable="false"></string>

    <!-- Whether or not to use assistant stream volume separately from music volume -->
    <bool name="config_useAssistantVolume">false</bool>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -458,6 +458,7 @@
  <java-symbol type="string" name="config_deviceSpecificAudioService" />
  <java-symbol type="integer" name="config_num_physical_slots" />
  <java-symbol type="array" name="config_integrityRuleProviderPackages" />
  <java-symbol type="bool" name="config_useAssistantVolume" />

  <java-symbol type="color" name="tab_indicator_text_v4" />

+4 −0
Original line number Diff line number Diff line
@@ -374,6 +374,10 @@ public class AudioManager {
    public static final int STREAM_TTS = AudioSystem.STREAM_TTS;
    /** Used to identify the volume of audio streams for accessibility prompts */
    public static final int STREAM_ACCESSIBILITY = AudioSystem.STREAM_ACCESSIBILITY;
    /** @hide Used to identify the volume of audio streams for virtual assistant */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING)
    public static final int STREAM_ASSISTANT = AudioSystem.STREAM_ASSISTANT;

    /** Number of audio streams */
    /**
Loading