Merge "Grant CAPTURE_AUDIO_OUTPUT permission for trusted process" into tm-dev am: d2a02887ae

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18629571

Change-Id: I6c91a8564083a80e88303fd6563c2bf7c33b9ed4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-06-09 17:15:32 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 4 deletions

View File

@@ -17,6 +17,7 @@
package com.android.server.pm.permission; package com.android.server.pm.permission;
import static android.Manifest.permission.CAPTURE_AUDIO_HOTWORD; import static android.Manifest.permission.CAPTURE_AUDIO_HOTWORD;
import static android.Manifest.permission.CAPTURE_AUDIO_OUTPUT;
import static android.Manifest.permission.RECORD_AUDIO; import static android.Manifest.permission.RECORD_AUDIO;
import static android.Manifest.permission.UPDATE_APP_OPS_STATS; import static android.Manifest.permission.UPDATE_APP_OPS_STATS;
import static android.app.AppOpsManager.ATTRIBUTION_CHAIN_ID_NONE; import static android.app.AppOpsManager.ATTRIBUTION_CHAIN_ID_NONE;
@@ -1364,8 +1365,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
// the only use case for this, so simply override here. // the only use case for this, so simply override here.
if (!permissionGranted if (!permissionGranted
&& Process.isIsolated(uid) // simple check which fails-fast for the common case && Process.isIsolated(uid) // simple check which fails-fast for the common case
&& (permission.equals(RECORD_AUDIO) && (permission.equals(RECORD_AUDIO) || permission.equals(CAPTURE_AUDIO_HOTWORD)
|| permission.equals(CAPTURE_AUDIO_HOTWORD))) { || permission.equals(CAPTURE_AUDIO_OUTPUT))) {
HotwordDetectionServiceProvider hotwordServiceProvider = HotwordDetectionServiceProvider hotwordServiceProvider =
permissionManagerServiceInt.getHotwordDetectionServiceProvider(); permissionManagerServiceInt.getHotwordDetectionServiceProvider();
permissionGranted = hotwordServiceProvider != null permissionGranted = hotwordServiceProvider != null

View File

@@ -449,8 +449,8 @@ public interface PermissionManagerServiceInternal extends PermissionManagerInter
/** /**
* Provides the uid of the currently active * Provides the uid of the currently active
* {@link android.service.voice.HotwordDetectionService}, which should be granted RECORD_AUDIO * {@link android.service.voice.HotwordDetectionService}, which should be granted RECORD_AUDIO,
* and CAPTURE_AUDIO_HOTWORD permissions. * CAPTURE_AUDIO_HOTWORD and CAPTURE_AUDIO_OUTPUT permissions.
*/ */
interface HotwordDetectionServiceProvider { interface HotwordDetectionServiceProvider {
int getUid(); int getUid();