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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user