Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc09d61b authored by Hai Zhang's avatar Hai Zhang Committed by Android (Google) Code Review
Browse files

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

parents 84b062e9 ea82335c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
  }
+8 −1
Original line number Diff line number Diff line
@@ -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;
    }

    /**