Rename to DomainVerificationUserState
Better reflects the fact that the map no longer contains only the selection state, but the domain state in general for the user. Bug: 181637637 Test: none, naming refactor Change-Id: I28bc73906f764d83c258fa10e23f2821e9482419
This commit is contained in:
@@ -7029,7 +7029,7 @@ public abstract class PackageManager {
|
||||
* domain to an application, use
|
||||
* {@link DomainVerificationManager#setDomainVerificationUserSelection(UUID, Set, boolean)},
|
||||
* passing in all of the domains returned inside
|
||||
* {@link DomainVerificationManager#getDomainVerificationUserSelection(String)}.
|
||||
* {@link DomainVerificationManager#getDomainVerificationUserState(String)}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
|
||||
@@ -66,16 +66,7 @@ public final class DomainOwner implements Parcelable {
|
||||
* @param packageName
|
||||
* Package name of that owns the domain.
|
||||
* @param overrideable
|
||||
* Whether or not this owner can be automatically overridden. If all owners for a domain are
|
||||
* overrideable, then calling
|
||||
* {@link DomainVerificationManager#setDomainVerificationUserSelection(UUID,
|
||||
* Set, boolean)} to enable the domain will disable all other owners. On the other hand, if any
|
||||
* of the owners are non-overrideable, then
|
||||
* {@link DomainVerificationManager#setDomainVerificationLinkHandlingAllowed(String,
|
||||
* boolean)} must be called with false to disable all of the other owners before this domain can
|
||||
* be taken by a new owner through
|
||||
* {@link DomainVerificationManager#setDomainVerificationUserSelection(UUID,
|
||||
* Set, boolean)}.
|
||||
* Whether or not this owner can be automatically overridden.
|
||||
*/
|
||||
@DataClass.Generated.Member
|
||||
public DomainOwner(
|
||||
@@ -98,16 +89,9 @@ public final class DomainOwner implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not this owner can be automatically overridden. If all owners for a domain are
|
||||
* overrideable, then calling
|
||||
* {@link DomainVerificationManager#setDomainVerificationUserSelection(UUID,
|
||||
* Set, boolean)} to enable the domain will disable all other owners. On the other hand, if any
|
||||
* of the owners are non-overrideable, then
|
||||
* {@link DomainVerificationManager#setDomainVerificationLinkHandlingAllowed(String,
|
||||
* boolean)} must be called with false to disable all of the other owners before this domain can
|
||||
* be taken by a new owner through
|
||||
* {@link DomainVerificationManager#setDomainVerificationUserSelection(UUID,
|
||||
* Set, boolean)}.
|
||||
* Whether or not this owner can be automatically overridden.
|
||||
*
|
||||
* @see DomainVerificationManager#setDomainVerificationUserSelection(UUID, Set, boolean)
|
||||
*/
|
||||
@DataClass.Generated.Member
|
||||
public boolean isOverrideable() {
|
||||
@@ -205,7 +189,7 @@ public final class DomainOwner implements Parcelable {
|
||||
};
|
||||
|
||||
@DataClass.Generated(
|
||||
time = 1614119379978L,
|
||||
time = 1614721802044L,
|
||||
codegenVersion = "1.0.22",
|
||||
sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainOwner.java",
|
||||
inputSignatures = "private final @android.annotation.NonNull java.lang.String mPackageName\nprivate final boolean mOverrideable\nclass DomainOwner extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genEqualsHashCode=true, genAidl=true, genToString=true)")
|
||||
|
||||
@@ -94,7 +94,7 @@ public final class DomainVerificationInfo implements Parcelable {
|
||||
|
||||
private Map<String, Integer> unparcelHostToStateMap(Parcel in) {
|
||||
return DomainVerificationUtils.readHostMap(in, new ArrayMap<>(),
|
||||
DomainVerificationUserSelection.class.getClassLoader());
|
||||
DomainVerificationUserState.class.getClassLoader());
|
||||
}
|
||||
|
||||
|
||||
@@ -105,8 +105,7 @@ public final class DomainVerificationInfo implements Parcelable {
|
||||
// CHECKSTYLE:OFF Generated code
|
||||
//
|
||||
// To regenerate run:
|
||||
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain
|
||||
// /DomainVerificationInfo.java
|
||||
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationInfo.java
|
||||
//
|
||||
// To exclude the generated code from IntelliJ auto-formatting enable (one-time):
|
||||
// Settings > Editor > Code Style > Formatter Control
|
||||
@@ -321,7 +320,7 @@ public final class DomainVerificationInfo implements Parcelable {
|
||||
};
|
||||
|
||||
@DataClass.Generated(
|
||||
time = 1613002530369L,
|
||||
time = 1614721812023L,
|
||||
codegenVersion = "1.0.22",
|
||||
sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationInfo.java",
|
||||
inputSignatures = "private final @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForUUID.class) java.util.UUID mIdentifier\nprivate final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull java.util.Map<java.lang.String,java.lang.Integer> mHostToStateMap\nprivate void parcelHostToStateMap(android.os.Parcel,int)\nprivate java.util.Map<java.lang.String,java.lang.Integer> unparcelHostToStateMap(android.os.Parcel)\nclass DomainVerificationInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genAidl=true, genHiddenConstructor=true, genParcelable=true, genToString=true, genEqualsHashCode=true)")
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.UUID;
|
||||
/**
|
||||
* System service to access domain verification APIs.
|
||||
*
|
||||
* Applications should use {@link #getDomainVerificationUserSelection(String)} if necessary to
|
||||
* Applications should use {@link #getDomainVerificationUserState(String)} if necessary to
|
||||
* check if/how they are verified for a domain, which is required starting from platform
|
||||
* {@link android.os.Build.VERSION_CODES#S} in order to open {@link Intent}s which declare
|
||||
* {@link Intent#CATEGORY_BROWSABLE} or no category and also match against
|
||||
@@ -222,7 +222,7 @@ public final class DomainVerificationManager {
|
||||
* {@link android.Manifest.permission#UPDATE_DOMAIN_VERIFICATION_USER_SELECTION})
|
||||
* to update the preferences of the user, when they have chosen to explicitly allow an
|
||||
* application to open links. This is done through querying
|
||||
* {@link #getDomainVerificationUserSelection(String)} and calling
|
||||
* {@link #getDomainVerificationUserState(String)} and calling
|
||||
* {@link #setDomainVerificationUserSelection(UUID, Set, boolean)} and
|
||||
* {@link #setDomainVerificationLinkHandlingAllowed(String, boolean)}.
|
||||
*
|
||||
@@ -408,10 +408,10 @@ public final class DomainVerificationManager {
|
||||
* null if the package does not declare any HTTP/HTTPS domains.
|
||||
*/
|
||||
@Nullable
|
||||
public DomainVerificationUserSelection getDomainVerificationUserSelection(
|
||||
public DomainVerificationUserState getDomainVerificationUserState(
|
||||
@NonNull String packageName) throws NameNotFoundException {
|
||||
try {
|
||||
return mDomainVerificationManager.getDomainVerificationUserSelection(packageName,
|
||||
return mDomainVerificationManager.getDomainVerificationUserState(packageName,
|
||||
mContext.getUserId());
|
||||
} catch (Exception e) {
|
||||
Exception converted = rethrow(e, packageName);
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
package android.content.pm.verify.domain;
|
||||
|
||||
parcelable DomainVerificationUserSelection;
|
||||
parcelable DomainVerificationUserState;
|
||||
@@ -30,7 +30,6 @@ import com.android.internal.util.DataClass;
|
||||
import com.android.internal.util.Parcelling;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -60,7 +59,7 @@ import java.util.UUID;
|
||||
@SuppressWarnings("DefaultAnnotationParam")
|
||||
@DataClass(genAidl = true, genHiddenConstructor = true, genParcelable = true, genToString = true,
|
||||
genEqualsHashCode = true, genHiddenConstDefs = true)
|
||||
public final class DomainVerificationUserSelection implements Parcelable {
|
||||
public final class DomainVerificationUserState implements Parcelable {
|
||||
|
||||
/**
|
||||
* The domain is unverified and unselected, and the application is unable to open web links
|
||||
@@ -117,7 +116,7 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
@NonNull
|
||||
private Map<String, Integer> unparcelHostToStateMap(Parcel in) {
|
||||
return DomainVerificationUtils.readHostMap(in, new ArrayMap<>(),
|
||||
DomainVerificationUserSelection.class.getClassLoader());
|
||||
DomainVerificationUserState.class.getClassLoader());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +136,7 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
// CHECKSTYLE:OFF Generated code
|
||||
//
|
||||
// To regenerate run:
|
||||
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationUserSelection.java
|
||||
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationUserState.java
|
||||
//
|
||||
// To exclude the generated code from IntelliJ auto-formatting enable (one-time):
|
||||
// Settings > Editor > Code Style > Formatter Control
|
||||
@@ -169,7 +168,7 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new DomainVerificationUserSelection.
|
||||
* Creates a new DomainVerificationUserState.
|
||||
*
|
||||
* @param packageName
|
||||
* The package name that this data corresponds to.
|
||||
@@ -182,7 +181,7 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
* @hide
|
||||
*/
|
||||
@DataClass.Generated.Member
|
||||
public DomainVerificationUserSelection(
|
||||
public DomainVerificationUserState(
|
||||
@NonNull UUID identifier,
|
||||
@NonNull String packageName,
|
||||
@NonNull UserHandle user,
|
||||
@@ -245,7 +244,7 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
// You can override field toString logic by defining methods like:
|
||||
// String fieldNameToString() { ... }
|
||||
|
||||
return "DomainVerificationUserSelection { " +
|
||||
return "DomainVerificationUserState { " +
|
||||
"identifier = " + mIdentifier + ", " +
|
||||
"packageName = " + mPackageName + ", " +
|
||||
"user = " + mUser + ", " +
|
||||
@@ -258,13 +257,13 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
@DataClass.Generated.Member
|
||||
public boolean equals(@Nullable Object o) {
|
||||
// You can override field equality logic by defining either of the methods like:
|
||||
// boolean fieldNameEquals(DomainVerificationUserSelection other) { ... }
|
||||
// boolean fieldNameEquals(DomainVerificationUserState other) { ... }
|
||||
// boolean fieldNameEquals(FieldType otherValue) { ... }
|
||||
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
@SuppressWarnings("unchecked")
|
||||
DomainVerificationUserSelection that = (DomainVerificationUserSelection) o;
|
||||
DomainVerificationUserState that = (DomainVerificationUserState) o;
|
||||
//noinspection PointlessBooleanExpression
|
||||
return true
|
||||
&& java.util.Objects.equals(mIdentifier, that.mIdentifier)
|
||||
@@ -322,7 +321,7 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
/** @hide */
|
||||
@SuppressWarnings({"unchecked", "RedundantCast"})
|
||||
@DataClass.Generated.Member
|
||||
/* package-private */ DomainVerificationUserSelection(@NonNull Parcel in) {
|
||||
/* package-private */ DomainVerificationUserState(@NonNull Parcel in) {
|
||||
// You can override field unparcelling by defining methods like:
|
||||
// static FieldType unparcelFieldName(Parcel in) { ... }
|
||||
|
||||
@@ -353,24 +352,24 @@ public final class DomainVerificationUserSelection implements Parcelable {
|
||||
}
|
||||
|
||||
@DataClass.Generated.Member
|
||||
public static final @NonNull Parcelable.Creator<DomainVerificationUserSelection> CREATOR
|
||||
= new Parcelable.Creator<DomainVerificationUserSelection>() {
|
||||
public static final @NonNull Parcelable.Creator<DomainVerificationUserState> CREATOR
|
||||
= new Parcelable.Creator<DomainVerificationUserState>() {
|
||||
@Override
|
||||
public DomainVerificationUserSelection[] newArray(int size) {
|
||||
return new DomainVerificationUserSelection[size];
|
||||
public DomainVerificationUserState[] newArray(int size) {
|
||||
return new DomainVerificationUserState[size];
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainVerificationUserSelection createFromParcel(@NonNull Parcel in) {
|
||||
return new DomainVerificationUserSelection(in);
|
||||
public DomainVerificationUserState createFromParcel(@NonNull Parcel in) {
|
||||
return new DomainVerificationUserState(in);
|
||||
}
|
||||
};
|
||||
|
||||
@DataClass.Generated(
|
||||
time = 1614649708937L,
|
||||
time = 1614721840152L,
|
||||
codegenVersion = "1.0.22",
|
||||
sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationUserSelection.java",
|
||||
inputSignatures = "public static final int DOMAIN_STATE_NONE\npublic static final int DOMAIN_STATE_SELECTED\npublic static final int DOMAIN_STATE_VERIFIED\nprivate final @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForUUID.class) java.util.UUID mIdentifier\nprivate final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull android.os.UserHandle mUser\nprivate final @android.annotation.NonNull boolean mLinkHandlingAllowed\nprivate final @android.annotation.NonNull java.util.Map<java.lang.String,java.lang.Integer> mHostToStateMap\nprivate void parcelHostToStateMap(android.os.Parcel,int)\nprivate @android.annotation.NonNull java.util.Map<java.lang.String,java.lang.Integer> unparcelHostToStateMap(android.os.Parcel)\npublic @android.annotation.SystemApi @android.annotation.NonNull java.util.UUID getIdentifier()\nclass DomainVerificationUserSelection extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genAidl=true, genHiddenConstructor=true, genParcelable=true, genToString=true, genEqualsHashCode=true, genHiddenConstDefs=true)")
|
||||
sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationUserState.java",
|
||||
inputSignatures = "public static final int DOMAIN_STATE_NONE\npublic static final int DOMAIN_STATE_SELECTED\npublic static final int DOMAIN_STATE_VERIFIED\nprivate final @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForUUID.class) java.util.UUID mIdentifier\nprivate final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull android.os.UserHandle mUser\nprivate final @android.annotation.NonNull boolean mLinkHandlingAllowed\nprivate final @android.annotation.NonNull java.util.Map<java.lang.String,java.lang.Integer> mHostToStateMap\nprivate void parcelHostToStateMap(android.os.Parcel,int)\nprivate @android.annotation.NonNull java.util.Map<java.lang.String,java.lang.Integer> unparcelHostToStateMap(android.os.Parcel)\npublic @android.annotation.SystemApi @android.annotation.NonNull java.util.UUID getIdentifier()\nclass DomainVerificationUserState extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genAidl=true, genHiddenConstructor=true, genParcelable=true, genToString=true, genEqualsHashCode=true, genHiddenConstDefs=true)")
|
||||
@Deprecated
|
||||
private void __metadata() {}
|
||||
|
||||
@@ -19,7 +19,7 @@ package android.content.pm.verify.domain;
|
||||
import android.content.pm.verify.domain.DomainOwner;
|
||||
import android.content.pm.verify.domain.DomainSet;
|
||||
import android.content.pm.verify.domain.DomainVerificationInfo;
|
||||
import android.content.pm.verify.domain.DomainVerificationUserSelection;
|
||||
import android.content.pm.verify.domain.DomainVerificationUserState;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ interface IDomainVerificationManager {
|
||||
DomainVerificationInfo getDomainVerificationInfo(String packageName);
|
||||
|
||||
@nullable
|
||||
DomainVerificationUserSelection getDomainVerificationUserSelection(String packageName,
|
||||
DomainVerificationUserState getDomainVerificationUserState(String packageName,
|
||||
int userId);
|
||||
|
||||
@nullable
|
||||
|
||||
Reference in New Issue
Block a user