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

Commit a9e89031 authored by jasonwshsu's avatar jasonwshsu Committed by Jason Hsu
Browse files

[HA Audio Output] Change category according to the audio definition

Root Cause: According to the audio definition, system sounds are UI touch sounds, unlock sounds, etc., so they are controlled by Media strategy.

Solution: Move system sounds, accessibility sounds, DTMF sounds into Media category. Notification category contains notification sounds only.

Bug: 293251163
Test: manual test
Change-Id: Ied3db95dacbd2c0985bdbfccec5575bb5988fc5b
parent 28bbbf78
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -160,10 +160,10 @@
    <string name="bluetooth_ringtone_title">Ringtone and alarms</string>
    <!-- Bluetooth audio output settings. Title of the option managing call audio path. [CHAR LIMIT=30] -->
    <string name="bluetooth_call_title">Audio during calls</string>
    <!-- Bluetooth audio output settings. Title of the option managing media audio path. [CHAR LIMIT=30] -->
    <string name="bluetooth_media_title">Media</string>
    <!-- Bluetooth audio output settings. Title of the option managing system sounds related audio path. [CHAR LIMIT=60] -->
    <string name="bluetooth_system_sounds_title">Notifications and other system sounds</string>
    <!-- Bluetooth audio output settings. Title of the option managing media and system sounds related audio path. [CHAR LIMIT=30] -->
    <string name="bluetooth_media_title">Media and system sounds</string>
    <!-- Bluetooth audio output settings. Title of the option managing notification audio path. [CHAR LIMIT=60] -->
    <string name="bluetooth_notification_title">Notifications</string>
    <!-- Description for text in accessibility hearing aids footer. [CHAR LIMIT=NONE] -->
    <string name="bluetooth_audio_routing_footer_summary">By default, audio output is determined by individual apps</string>
+3 −3
Original line number Diff line number Diff line
@@ -46,10 +46,10 @@
        android:entries="@array/bluetooth_audio_routing_titles"
        android:entryValues="@array/bluetooth_audio_routing_values"
        android:summary="%s"
        android:key="audio_routing_system_sounds"
        android:key="audio_routing_notification"
        android:persistent="false"
        android:title="@string/bluetooth_system_sounds_title"
        settings:controller="com.android.settings.accessibility.HearingDeviceSystemSoundsRoutingPreferenceController" />
        android:title="@string/bluetooth_notification_title"
        settings:controller="com.android.settings.accessibility.HearingDeviceNotificationRoutingPreferenceController" />

    <com.android.settings.accessibility.AccessibilityFooterPreference
        android:key="hearing_device_footer"
+0 −4
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.content.Context;
import android.provider.Settings;

import com.android.settings.Utils;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;

/**
@@ -28,9 +27,6 @@ import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
 */
public class HearingDeviceCallRoutingPreferenceController extends
        HearingDeviceAudioRoutingBasePreferenceController {

    private CachedBluetoothDevice mHearingDevice;

    public HearingDeviceCallRoutingPreferenceController(Context context, String preferenceKey) {
        super(context, preferenceKey);
    }
+0 −4
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.settings.accessibility;
import android.content.Context;
import android.provider.Settings;

import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;

/**
@@ -27,9 +26,6 @@ import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
 */
public class HearingDeviceMediaRoutingPreferenceController extends
        HearingDeviceAudioRoutingBasePreferenceController {

    private CachedBluetoothDevice mHearingDevice;

    public HearingDeviceMediaRoutingPreferenceController(Context context, String preferenceKey) {
        super(context, preferenceKey);
    }
+6 −9
Original line number Diff line number Diff line
@@ -19,39 +19,36 @@ package com.android.settings.accessibility;
import android.content.Context;
import android.provider.Settings;

import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;

/**
 * The controller of the hearing device system sounds routing list preference.
 * The controller of the hearing device notification routing list preference.
 */
public class HearingDeviceSystemSoundsRoutingPreferenceController extends
public class HearingDeviceNotificationRoutingPreferenceController extends
        HearingDeviceAudioRoutingBasePreferenceController {

    private CachedBluetoothDevice mHearingDevice;

    public HearingDeviceSystemSoundsRoutingPreferenceController(Context context,
    public HearingDeviceNotificationRoutingPreferenceController(Context context,
            String preferenceKey) {
        super(context, preferenceKey);
    }

    @Override
    protected int[] getSupportedAttributeList() {
        return HearingAidAudioRoutingConstants.SYSTEM_SOUNDS_ROUTING_ATTRIBUTES;
        return HearingAidAudioRoutingConstants.NOTIFICATION_ROUTING_ATTRIBUTES;

    }

    @Override
    protected void saveRoutingValue(Context context, int routingValue) {
        Settings.Secure.putInt(context.getContentResolver(),
                Settings.Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING, routingValue);
                Settings.Secure.HEARING_AID_NOTIFICATION_ROUTING, routingValue);

    }

    @Override
    protected int restoreRoutingValue(Context context) {
        return Settings.Secure.getInt(context.getContentResolver(),
                Settings.Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING,
                Settings.Secure.HEARING_AID_NOTIFICATION_ROUTING,
                HearingAidAudioRoutingConstants.RoutingValue.AUTO);
    }
}
Loading