Merge "CSD: rename get/setOutputRs2 to include upper bound" into udc-dev

This commit is contained in:
Vlad Popa
2023-03-16 23:17:49 +00:00
committed by Android (Google) Code Review
4 changed files with 17 additions and 17 deletions

View File

@@ -6752,7 +6752,7 @@ public class AudioManager {
/**
* @hide
* Lower media volume to RS1
* Lower media volume to RS1 interval
*/
public void lowerVolumeToRs1() {
try {
@@ -6764,13 +6764,13 @@ public class AudioManager {
/**
* @hide
* @return the RS2 value used for momentary exposure warnings
* @return the RS2 upper bound used for momentary exposure warnings
*/
@TestApi
@RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
public float getRs2Value() {
try {
return getService().getRs2Value();
return getService().getOutputRs2UpperBound();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -6778,13 +6778,13 @@ public class AudioManager {
/**
* @hide
* Sets the RS2 value used for momentary exposure warnings
* Sets the RS2 upper bound used for momentary exposure warnings
*/
@TestApi
@RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
public void setRs2Value(float rs2Value) {
try {
getService().setRs2Value(rs2Value);
getService().setOutputRs2UpperBound(rs2Value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}

View File

@@ -296,10 +296,10 @@ interface IAudioService {
void lowerVolumeToRs1(String callingPackage);
@EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
float getRs2Value();
float getOutputRs2UpperBound();
@EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
oneway void setRs2Value(float rs2Value);
oneway void setOutputRs2UpperBound(float rs2Value);
@EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
float getCsd();

View File

@@ -10471,16 +10471,16 @@ public class AudioService extends IAudioService.Stub
@Override
@android.annotation.EnforcePermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
public float getRs2Value() {
super.getRs2Value_enforcePermission();
return mSoundDoseHelper.getRs2Value();
public float getOutputRs2UpperBound() {
super.getOutputRs2UpperBound_enforcePermission();
return mSoundDoseHelper.getOutputRs2UpperBound();
}
@Override
@android.annotation.EnforcePermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
public void setRs2Value(float rs2Value) {
super.setRs2Value_enforcePermission();
mSoundDoseHelper.setRs2Value(rs2Value);
public void setOutputRs2UpperBound(float rs2Value) {
super.setOutputRs2UpperBound_enforcePermission();
mSoundDoseHelper.setOutputRs2UpperBound(rs2Value);
}
@Override

View File

@@ -300,7 +300,7 @@ public class SoundDoseHelper {
SAFE_MEDIA_VOLUME_UNINITIALIZED);
}
float getRs2Value() {
float getOutputRs2UpperBound() {
if (!mEnableCsd) {
return 0.f;
}
@@ -312,14 +312,14 @@ public class SoundDoseHelper {
}
try {
return soundDose.getOutputRs2();
return soundDose.getOutputRs2UpperBound();
} catch (RemoteException e) {
Log.e(TAG, "Exception while getting the RS2 exposure value", e);
return 0.f;
}
}
void setRs2Value(float rs2Value) {
void setOutputRs2UpperBound(float rs2Value) {
if (!mEnableCsd) {
return;
}
@@ -331,7 +331,7 @@ public class SoundDoseHelper {
}
try {
soundDose.setOutputRs2(rs2Value);
soundDose.setOutputRs2UpperBound(rs2Value);
} catch (RemoteException e) {
Log.e(TAG, "Exception while setting the RS2 exposure value", e);
}