Merge "TEMP: trust recognition service providers" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
399a00fff0
@@ -3065,6 +3065,13 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
shouldCollectAsyncNotedOp, message, shouldCollectMessage, skipProxyOperation);
|
shouldCollectAsyncNotedOp, message, shouldCollectMessage, skipProxyOperation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO b/184963112: remove once full blaming is implemented
|
||||||
|
private boolean isRecognitionServiceTemp(int code, String packageName) {
|
||||||
|
return code == OP_RECORD_AUDIO
|
||||||
|
&& (packageName.equals("com.google.android.googlequicksearchbox")
|
||||||
|
|| packageName.equals("com.google.android.tts"));
|
||||||
|
}
|
||||||
|
|
||||||
private SyncNotedAppOp noteProxyOperationImpl(int code, AttributionSource attributionSource,
|
private SyncNotedAppOp noteProxyOperationImpl(int code, AttributionSource attributionSource,
|
||||||
boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage,
|
boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage,
|
||||||
boolean skipProxyOperation) {
|
boolean skipProxyOperation) {
|
||||||
@@ -3092,7 +3099,8 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
final boolean isSelfBlame = Binder.getCallingUid() == proxiedUid;
|
final boolean isSelfBlame = Binder.getCallingUid() == proxiedUid;
|
||||||
final boolean isProxyTrusted = mContext.checkPermission(
|
final boolean isProxyTrusted = mContext.checkPermission(
|
||||||
Manifest.permission.UPDATE_APP_OPS_STATS, -1, proxyUid)
|
Manifest.permission.UPDATE_APP_OPS_STATS, -1, proxyUid)
|
||||||
== PackageManager.PERMISSION_GRANTED || isSelfBlame;
|
== PackageManager.PERMISSION_GRANTED || isSelfBlame
|
||||||
|
|| isRecognitionServiceTemp(code, proxyPackageName);
|
||||||
|
|
||||||
if (!skipProxyOperation) {
|
if (!skipProxyOperation) {
|
||||||
final int proxyFlags = isProxyTrusted ? AppOpsManager.OP_FLAG_TRUSTED_PROXY
|
final int proxyFlags = isProxyTrusted ? AppOpsManager.OP_FLAG_TRUSTED_PROXY
|
||||||
|
|||||||
Reference in New Issue
Block a user