Loading core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -9974,6 +9974,13 @@ public final class Settings { */ public static final String AUDIO_DEVICE_INVENTORY = "audio_device_inventory"; /** * Stores a boolean that defines whether the CSD as a feature is enabled or not. * @hide */ public static final String AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED = "audio_safe_csd_as_a_feature_enabled"; /** * Indicates whether notification display on the lock screen is enabled. * <p> Loading core/res/res/values/config.xml +7 −6 Original line number Diff line number Diff line Loading @@ -3013,14 +3013,15 @@ on the headphone/microphone jack. When false use the older uevent framework. --> <bool name="config_useDevInputEventForAudioJack">false</bool> <!-- Whether safe headphone volume is enabled or not (country specific). --> <!-- Whether safe headphone hearing is enforced by any regulation (e.g. EN50332-3, EN50332-2) or not (country specific). --> <bool name="config_safe_media_volume_enabled">true</bool> <!-- Whether safe headphone sound dosage warning is enabled or not (country specific). This value should only be overlaid to true when a vendor supports offload and has the HAL sound dose interfaces implemented. Otherwise, this can lead to a compliance issue with the safe hearing standards EN50332-3 and IEC62368-1. <!-- Whether safe headphone sound dosage warning is enabled or not. This value should only be overlaid to true when a vendor supports offload and has the HAL sound dose interfaces implemented. Otherwise, this can lead to a compliance issue with the safe hearing standards EN50332-3 and IEC62368-1. --> <bool name="config_safe_sound_dosage_enabled">false</bool> Loading media/java/android/media/AudioManager.java +47 −1 Original line number Diff line number Diff line Loading @@ -6915,7 +6915,10 @@ public class AudioManager { /** * @hide * Returns whether CSD is enabled and supported by the HAL on this device. * Returns whether CSD is enabled and supported by the current active audio module HAL. * This method will return {@code false) for setups in which CSD as a feature is available * (see {@link AudioManager#isCsdAsAFeatureAvailable()}) and not enabled (see * {@link AudioManager#isCsdAsAFeatureEnabled()}). */ @TestApi @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) Loading @@ -6927,6 +6930,49 @@ public class AudioManager { } } /** * @hide * Returns whether CSD as a feature can be manipulated by a client. This method * returns {@code true} in countries where there isn't a safe hearing regulation * enforced. */ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public boolean isCsdAsAFeatureAvailable() { try { return getService().isCsdAsAFeatureAvailable(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Returns {@code true} if the client has enabled CSD. This function should only * be called if {@link AudioManager#isCsdAsAFeatureAvailable()} returns {@code true}. */ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public boolean isCsdAsAFeatureEnabled() { try { return getService().isCsdAsAFeatureEnabled(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Enables/disables the CSD feature. This function should only be called if * {@link AudioManager#isCsdAsAFeatureAvailable()} returns {@code true}. */ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public void setCsdAsAFeatureEnabled(boolean csdToggleValue) { try { getService().setCsdAsAFeatureEnabled(csdToggleValue); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Describes an audio device that has not been categorized with a specific Loading media/java/android/media/IAudioService.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,15 @@ interface IAudioService { @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") boolean isCsdEnabled(); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") boolean isCsdAsAFeatureAvailable(); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") boolean isCsdAsAFeatureEnabled(); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") oneway void setCsdAsAFeatureEnabled(boolean csdToggleValue); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") oneway void setBluetoothAudioDeviceCategory(in String address, boolean isBle, int deviceType); Loading packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -703,7 +703,8 @@ public class SettingsBackupTest { Settings.Secure.ASSIST_SCREENSHOT_ENABLED, Settings.Secure.ASSIST_STRUCTURE_ENABLED, Settings.Secure.ATTENTIVE_TIMEOUT, Settings.Secure.AUDIO_DEVICE_INVENTORY, // setting not controllable by user Settings.Secure.AUDIO_DEVICE_INVENTORY, // not controllable by user Settings.Secure.AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED, // not controllable by user Settings.Secure.AUTOFILL_FEATURE_FIELD_CLASSIFICATION, Settings.Secure.AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT, Settings.Secure.AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE, Loading Loading
core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -9974,6 +9974,13 @@ public final class Settings { */ public static final String AUDIO_DEVICE_INVENTORY = "audio_device_inventory"; /** * Stores a boolean that defines whether the CSD as a feature is enabled or not. * @hide */ public static final String AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED = "audio_safe_csd_as_a_feature_enabled"; /** * Indicates whether notification display on the lock screen is enabled. * <p> Loading
core/res/res/values/config.xml +7 −6 Original line number Diff line number Diff line Loading @@ -3013,14 +3013,15 @@ on the headphone/microphone jack. When false use the older uevent framework. --> <bool name="config_useDevInputEventForAudioJack">false</bool> <!-- Whether safe headphone volume is enabled or not (country specific). --> <!-- Whether safe headphone hearing is enforced by any regulation (e.g. EN50332-3, EN50332-2) or not (country specific). --> <bool name="config_safe_media_volume_enabled">true</bool> <!-- Whether safe headphone sound dosage warning is enabled or not (country specific). This value should only be overlaid to true when a vendor supports offload and has the HAL sound dose interfaces implemented. Otherwise, this can lead to a compliance issue with the safe hearing standards EN50332-3 and IEC62368-1. <!-- Whether safe headphone sound dosage warning is enabled or not. This value should only be overlaid to true when a vendor supports offload and has the HAL sound dose interfaces implemented. Otherwise, this can lead to a compliance issue with the safe hearing standards EN50332-3 and IEC62368-1. --> <bool name="config_safe_sound_dosage_enabled">false</bool> Loading
media/java/android/media/AudioManager.java +47 −1 Original line number Diff line number Diff line Loading @@ -6915,7 +6915,10 @@ public class AudioManager { /** * @hide * Returns whether CSD is enabled and supported by the HAL on this device. * Returns whether CSD is enabled and supported by the current active audio module HAL. * This method will return {@code false) for setups in which CSD as a feature is available * (see {@link AudioManager#isCsdAsAFeatureAvailable()}) and not enabled (see * {@link AudioManager#isCsdAsAFeatureEnabled()}). */ @TestApi @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) Loading @@ -6927,6 +6930,49 @@ public class AudioManager { } } /** * @hide * Returns whether CSD as a feature can be manipulated by a client. This method * returns {@code true} in countries where there isn't a safe hearing regulation * enforced. */ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public boolean isCsdAsAFeatureAvailable() { try { return getService().isCsdAsAFeatureAvailable(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Returns {@code true} if the client has enabled CSD. This function should only * be called if {@link AudioManager#isCsdAsAFeatureAvailable()} returns {@code true}. */ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public boolean isCsdAsAFeatureEnabled() { try { return getService().isCsdAsAFeatureEnabled(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Enables/disables the CSD feature. This function should only be called if * {@link AudioManager#isCsdAsAFeatureAvailable()} returns {@code true}. */ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public void setCsdAsAFeatureEnabled(boolean csdToggleValue) { try { getService().setCsdAsAFeatureEnabled(csdToggleValue); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Describes an audio device that has not been categorized with a specific Loading
media/java/android/media/IAudioService.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,15 @@ interface IAudioService { @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") boolean isCsdEnabled(); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") boolean isCsdAsAFeatureAvailable(); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") boolean isCsdAsAFeatureEnabled(); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") oneway void setCsdAsAFeatureEnabled(boolean csdToggleValue); @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED") oneway void setBluetoothAudioDeviceCategory(in String address, boolean isBle, int deviceType); Loading
packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -703,7 +703,8 @@ public class SettingsBackupTest { Settings.Secure.ASSIST_SCREENSHOT_ENABLED, Settings.Secure.ASSIST_STRUCTURE_ENABLED, Settings.Secure.ATTENTIVE_TIMEOUT, Settings.Secure.AUDIO_DEVICE_INVENTORY, // setting not controllable by user Settings.Secure.AUDIO_DEVICE_INVENTORY, // not controllable by user Settings.Secure.AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED, // not controllable by user Settings.Secure.AUTOFILL_FEATURE_FIELD_CLASSIFICATION, Settings.Secure.AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT, Settings.Secure.AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE, Loading