Merge "remove AudioManager.setParameters from bluetooth" am: ec9a8515d7 am: c3be61fbd6 am: 0cc39d8e29 am: f6d9afa480 am: 1dc504cb94
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1859354 Change-Id: I0415e76479ea33e158577bd1352881cae7e48518
This commit is contained in:
@@ -134,6 +134,11 @@ package android.media {
|
||||
public class AudioManager {
|
||||
method public void adjustStreamVolumeForUid(int, int, int, @NonNull String, int, int, int);
|
||||
method public void adjustSuggestedStreamVolumeForUid(int, int, int, @NonNull String, int, int, int);
|
||||
method @RequiresPermission("android.permission.BLUETOOTH_STACK") public void setA2dpSuspended(boolean);
|
||||
method @RequiresPermission("android.permission.BLUETOOTH_STACK") public void setBluetoothHeadsetProperties(@NonNull String, boolean, boolean);
|
||||
method @RequiresPermission("android.permission.BLUETOOTH_STACK") public void setHfpEnabled(boolean);
|
||||
method @RequiresPermission("android.permission.BLUETOOTH_STACK") public void setHfpSamplingRate(int);
|
||||
method @RequiresPermission("android.permission.BLUETOOTH_STACK") public void setHfpVolume(int);
|
||||
method public void setStreamVolumeForUid(int, int, int, @NonNull String, int, int, int);
|
||||
field public static final int FLAG_FROM_KEY = 4096; // 0x1000
|
||||
}
|
||||
|
||||
@@ -3273,6 +3273,54 @@ public class AudioManager {
|
||||
AudioSystem.setParameters(keyValuePairs);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_STACK)
|
||||
public void setHfpEnabled(boolean enable) {
|
||||
AudioSystem.setParameters("hfp_enable=" + enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_STACK)
|
||||
public void setHfpVolume(int volume) {
|
||||
AudioSystem.setParameters("hfp_volume=" + volume);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_STACK)
|
||||
public void setHfpSamplingRate(int rate) {
|
||||
AudioSystem.setParameters("hfp_set_sampling_rate=" + rate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_STACK)
|
||||
public void setBluetoothHeadsetProperties(@NonNull String name, boolean hasNrecEnabled,
|
||||
boolean hasWbsEnabled) {
|
||||
AudioSystem.setParameters("bt_headset_name=" + name
|
||||
+ ";bt_headset_nrec=" + (hasNrecEnabled ? "on" : "off")
|
||||
+ ";bt_wbs=" + (hasWbsEnabled ? "on" : "off"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_STACK)
|
||||
public void setA2dpSuspended(boolean enable) {
|
||||
AudioSystem.setParameters("A2dpSuspended=" + enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a variable number of parameter values from audio hardware.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user