diff options
| author | Joanne Chung <joannechung@google.com> | 2021-01-14 19:39:34 +0800 |
|---|---|---|
| committer | Joanne Chung <joannechung@google.com> | 2021-01-18 10:18:58 +0000 |
| commit | dccdd68c5d7d7161b520cd576d3ba5bad977d9b4 (patch) | |
| tree | 5a17f4bd1239bdcd703132d68cdea7262ca2af0c /core/java/android/app/AppOpsManager.java | |
| parent | c91a0f9491cff6c609c659e9fdd6d06e723c5d69 (diff) | |
Get value from setting provider using user id.
If the API calls from system server, we will get the value of user 0,
we should get the value for correct user.
Bug: 177628417
Test: manual. Switch user and check the value is correct.
Test: atest RecognitionServiceMicIndicatorTest#\
testRecognitionServiceNoteProxyOpNoExceptionThrown \
--user-type secondary_user
Change-Id: Ie100613d360b93c99de134c566990c73a80156d8
Diffstat (limited to 'core/java/android/app/AppOpsManager.java')
| -rw-r--r-- | core/java/android/app/AppOpsManager.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index a23dd35fa55f..3cb85e8dfbdd 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -7689,8 +7689,8 @@ public class AppOpsManager { if (code != OP_RECORD_AUDIO) { return false; } - final String voiceRecognitionComponent = Settings.Secure.getString( - context.getContentResolver(), Settings.Secure.VOICE_RECOGNITION_SERVICE); + final String voiceRecognitionComponent = Settings.Secure.getStringForUser( + context.getContentResolver(), Settings.Secure.VOICE_RECOGNITION_SERVICE, userId); final String voiceRecognitionServicePackageName = getComponentPackageNameFromString(voiceRecognitionComponent); |
