summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-06-15 19:41:24 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-06-15 19:41:24 +0000
commitb3c8d6d2e0cd7175c743bd991ff8fe7e43bb7ac8 (patch)
treef372f74dade0caa5a4fe4d6b6007f69259b5f8c1
parentfce88b4e6850a1a898b4946747e91ba3f658bd4a (diff)
parent050f400b3f4bb054250506f398078fdf45bdd7bb (diff)
Merge "Properly check for SDK before nullifying attribution tag" into sc-dev
-rw-r--r--core/java/android/speech/RecognitionService.java1
-rw-r--r--services/core/java/com/android/server/appop/AppOpsService.java12
2 files changed, 7 insertions, 6 deletions
diff --git a/core/java/android/speech/RecognitionService.java b/core/java/android/speech/RecognitionService.java
index 055e71f0077b..8b4c0d9e21f5 100644
--- a/core/java/android/speech/RecognitionService.java
+++ b/core/java/android/speech/RecognitionService.java
@@ -229,6 +229,7 @@ public abstract class RecognitionService extends Service {
protected abstract void onStopListening(Callback listener);
@Override
+ @SuppressLint("MissingNullability")
public Context createContext(@NonNull ContextParams contextParams) {
if (contextParams.getNextAttributionSource() != null) {
if (mHandler.getLooper().equals(Looper.myLooper())) {
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index d3a7752dc351..104bc9b2c8d1 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -4558,15 +4558,15 @@ public class AppOpsService extends IAppOpsService.Stub {
}
try {
- if (mPlatformCompat.isChangeEnabledByPackageName(
+ if (!mPlatformCompat.isChangeEnabledByPackageName(
SECURITY_EXCEPTION_ON_INVALID_ATTRIBUTION_TAG_CHANGE, packageName,
- userId) && mPlatformCompat.isChangeEnabledByUid(
+ userId) || !mPlatformCompat.isChangeEnabledByUid(
SECURITY_EXCEPTION_ON_INVALID_ATTRIBUTION_TAG_CHANGE,
- callingUid) && !isAttributionTagValid) {
- Slog.e(TAG, msg);
- } else {
- Slog.e(TAG, msg);
+ callingUid)) {
+ // Do not override tags if overriding is not enabled for this package
+ isAttributionTagValid = true;
}
+ Slog.e(TAG, msg);
} catch (RemoteException neverHappens) {
}
}