summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Atneya Nair <atneya@google.com> 2024-10-23 17:35:17 -0700
committer Atneya Nair <atneya@google.com> 2024-10-23 17:46:22 -0700
commit4c4778a675b4027f5aa53227199e52beaee4f237 (patch)
tree5adcd8bf1329c869f2be38da4764a89bbc43f861
parentf6002bc0c0e5df8302fd695fc4c65f84434b3551 (diff)
audio: Fix incorrect userId for setMicMute
Within the manager class, we should be using the context userId, not a binder callingUserId. While this works if we are not in a binder context, it could break if we get a binder call from another user id. Test: Compiles Bug: trivial Flag: EXEMPT trivial Change-Id: I442111b2acd01b55096baa7daa170a3df8199a24
-rw-r--r--media/java/android/media/AudioManager.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index cdb517b3fd3e..29907e30af0b 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1136,7 +1136,7 @@ public class AudioManager {
final IAudioService service = getService();
try {
service.setMasterMute(mute, flags, getContext().getOpPackageName(),
- UserHandle.getCallingUserId(), getContext().getAttributionTag());
+ getContext().getUserId(), getContext().getAttributionTag());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -3246,7 +3246,7 @@ public class AudioManager {
final IAudioService service = getService();
try {
service.setMicrophoneMute(on, getContext().getOpPackageName(),
- UserHandle.getCallingUserId(), getContext().getAttributionTag());
+ getContext().getUserId(), getContext().getAttributionTag());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}