Merge "Add knownCerts to system API and copy constructor."

This commit is contained in:
Hai Zhang
2022-11-05 21:02:51 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 1 deletions

View File

@@ -3617,6 +3617,7 @@ package android.content.pm {
field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000
field @Deprecated public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000
field @Nullable public final String backgroundPermission;
field @NonNull public java.util.Set<java.lang.String> knownCerts;
field @StringRes public int requestRes;
}

View File

@@ -20,6 +20,7 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StringRes;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
@@ -33,6 +34,7 @@ import com.android.internal.util.Parcelling.BuiltIn.ForStringSet;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Collections;
import java.util.Set;
/**
@@ -486,7 +488,10 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
*
* @hide
*/
public @Nullable Set<String> knownCerts;
// Already being used as mutable and most other fields in this class are also mutable.
@SuppressLint("MutableBareField")
@SystemApi
public @NonNull Set<String> knownCerts = Collections.emptySet();
/** @hide */
public static int fixProtectionLevel(int level) {
@@ -620,6 +625,8 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
descriptionRes = orig.descriptionRes;
requestRes = orig.requestRes;
nonLocalizedDescription = orig.nonLocalizedDescription;
// Note that knownCerts wasn't properly copied before Android U.
knownCerts = orig.knownCerts;
}
/**