From b8488603d6932262e652b740cbf75b9d580caffb Mon Sep 17 00:00:00 2001 From: Guojing Yuan Date: Tue, 18 May 2021 18:12:40 +0000 Subject: Avoid a SecurityExcetion crash 1. Instead of throwing SecurityException, log the error. 2. Set isAttributionTagNotFound to true when the attributionTag is not null but not found in the package attributions. Fix: 188549667 Test: N/A Change-Id: I75a217893353ee5fe5d191e2b78ccf391847adb6 --- core/java/android/app/AppOpsManager.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/java/android') diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index 010f4e4c9951..5e64d095c9c3 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -3058,11 +3058,24 @@ public class AppOpsManager { */ public boolean isRecordAudioRestrictionExcept; + /** + * Is attribution tag not null and not contained in the package attributions + */ + public boolean isAttributionTagNotFound = false; + public RestrictionBypass(boolean isPrivileged, boolean isRecordAudioRestrictionExcept) { this.isPrivileged = isPrivileged; this.isRecordAudioRestrictionExcept = isRecordAudioRestrictionExcept; } + public void setIsAttributionTagNotFound(boolean isAttributionTagNotFound) { + this.isAttributionTagNotFound = isAttributionTagNotFound; + } + + public boolean getIsAttributionTagNotFound() { + return this.isAttributionTagNotFound; + } + public static RestrictionBypass UNRESTRICTED = new RestrictionBypass(true, true); } -- cgit v1.2.3