Merge "AppOpsService: Don't log stack traces for isolated processes" am: ffc64ac33e

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

Change-Id: I7486ca952502126ec50a90d9cc7b14219a973735
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hai Zhang
2022-12-17 00:05:09 +00:00
committed by Automerger Merge Worker

View File

@@ -2797,7 +2797,11 @@ public class AppOpsService extends IAppOpsService.Stub {
try {
pvr = verifyAndGetBypass(uid, packageName, null);
} catch (SecurityException e) {
Slog.e(TAG, "Cannot setMode", e);
if (Process.isIsolated(uid)) {
Slog.e(TAG, "Cannot setMode: isolated process");
} else {
Slog.e(TAG, "Cannot setMode", e);
}
return;
}
@@ -3252,7 +3256,11 @@ public class AppOpsService extends IAppOpsService.Stub {
try {
pvr = verifyAndGetBypass(uid, packageName, null);
} catch (SecurityException e) {
Slog.e(TAG, "checkOperation", e);
if (Process.isIsolated(uid)) {
Slog.e(TAG, "Cannot checkOperation: isolated process");
} else {
Slog.e(TAG, "Cannot checkOperation", e);
}
return AppOpsManager.opToDefaultMode(code);
}
@@ -3458,7 +3466,11 @@ public class AppOpsService extends IAppOpsService.Stub {
attributionTag = null;
}
} catch (SecurityException e) {
Slog.e(TAG, "noteOperation", e);
if (Process.isIsolated(uid)) {
Slog.e(TAG, "Cannot noteOperation: isolated process");
} else {
Slog.e(TAG, "Cannot noteOperation", e);
}
return new SyncNotedAppOp(AppOpsManager.MODE_ERRORED, code, attributionTag,
packageName);
}
@@ -3974,7 +3986,11 @@ public class AppOpsService extends IAppOpsService.Stub {
attributionTag = null;
}
} catch (SecurityException e) {
Slog.e(TAG, "startOperation", e);
if (Process.isIsolated(uid)) {
Slog.e(TAG, "Cannot startOperation: isolated process");
} else {
Slog.e(TAG, "Cannot startOperation", e);
}
return new SyncNotedAppOp(AppOpsManager.MODE_ERRORED, code, attributionTag,
packageName);
}
@@ -4148,7 +4164,11 @@ public class AppOpsService extends IAppOpsService.Stub {
attributionTag = null;
}
} catch (SecurityException e) {
Slog.e(TAG, "Cannot finishOperation", e);
if (Process.isIsolated(uid)) {
Slog.e(TAG, "Cannot finishOperation: isolated process");
} else {
Slog.e(TAG, "Cannot finishOperation", e);
}
return;
}