Loading core/java/android/content/pm/verify/domain/DomainSet.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.content.pm.verify.domain; parcelable DomainSet; core/java/android/content/pm/verify/domain/DomainSet.java 0 → 100644 +160 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.content.pm.verify.domain; import android.annotation.NonNull; import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.DataClass; import java.util.Set; /** * Wraps an input set of domains from the client process, to be sent to the server. Handles cases * where the data size is too large by writing data using {@link Parcel#writeBlob(byte[])}. * * @hide */ @DataClass(genParcelable = true, genAidl = true, genEqualsHashCode = true) public class DomainSet implements Parcelable { @NonNull private final Set<String> mDomains; private void parcelDomains(@NonNull Parcel dest, @SuppressWarnings("unused") int flags) { DomainVerificationUtils.writeHostSet(dest, mDomains); } private Set<String> unparcelDomains(@NonNull Parcel in) { return DomainVerificationUtils.readHostSet(in); } // Code below generated by codegen v1.0.22. // // DO NOT MODIFY! // CHECKSTYLE:OFF Generated code // // To regenerate run: // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain // /DomainSet.java // // To exclude the generated code from IntelliJ auto-formatting enable (one-time): // Settings > Editor > Code Style > Formatter Control //@formatter:off @DataClass.Generated.Member public DomainSet( @NonNull Set<String> domains) { this.mDomains = domains; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mDomains); // onConstructed(); // You can define this method to get a callback } @DataClass.Generated.Member public @NonNull Set<String> getDomains() { return mDomains; } @Override @DataClass.Generated.Member public boolean equals(@android.annotation.Nullable Object o) { // You can override field equality logic by defining either of the methods like: // boolean fieldNameEquals(DomainSet other) { ... } // boolean fieldNameEquals(FieldType otherValue) { ... } if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; @SuppressWarnings("unchecked") DomainSet that = (DomainSet) o; //noinspection PointlessBooleanExpression return true && java.util.Objects.equals(mDomains, that.mDomains); } @Override @DataClass.Generated.Member public int hashCode() { // You can override field hashCode logic by defining methods like: // int fieldNameHashCode() { ... } int _hash = 1; _hash = 31 * _hash + java.util.Objects.hashCode(mDomains); return _hash; } @Override @DataClass.Generated.Member public void writeToParcel(@NonNull Parcel dest, int flags) { // You can override field parcelling by defining methods like: // void parcelFieldName(Parcel dest, int flags) { ... } parcelDomains(dest, flags); } @Override @DataClass.Generated.Member public int describeContents() { return 0; } /** @hide */ @SuppressWarnings({"unchecked", "RedundantCast"}) @DataClass.Generated.Member protected DomainSet(@NonNull Parcel in) { // You can override field unparcelling by defining methods like: // static FieldType unparcelFieldName(Parcel in) { ... } Set<String> domains = unparcelDomains(in); this.mDomains = domains; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mDomains); // onConstructed(); // You can define this method to get a callback } @DataClass.Generated.Member public static final @NonNull Parcelable.Creator<DomainSet> CREATOR = new Parcelable.Creator<DomainSet>() { @Override public DomainSet[] newArray(int size) { return new DomainSet[size]; } @Override public DomainSet createFromParcel(@NonNull Parcel in) { return new DomainSet(in); } }; @DataClass.Generated( time = 1613169242020L, codegenVersion = "1.0.22", sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainSet.java", inputSignatures = "private final @android.annotation.NonNull java.util.Set<java.lang.String> mDomains\nprivate void parcelDomains(android.os.Parcel,int)\nprivate java.util.Set<java.lang.String> unparcelDomains(android.os.Parcel)\nclass DomainSet extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genEqualsHashCode=true)") @Deprecated private void __metadata() {} //@formatter:on // End of generated code } core/java/android/content/pm/verify/domain/DomainVerificationInfo.java +52 −44 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ package android.content.pm.verify.domain; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.pm.PackageManager; import android.os.Parcel; import android.os.Parcelable; import android.util.ArrayMap; import com.android.internal.util.DataClass; import com.android.internal.util.Parcelling; Loading @@ -34,12 +36,12 @@ import java.util.UUID; * against the digital asset links response from the server hosting that domain. * <p> * These values for each domain can be modified through * {@link DomainVerificationManager#setDomainVerificationStatus(UUID, Set, int)}. * {@link DomainVerificationManager#setDomainVerificationStatus(UUID, * Set, int)}. * * @hide */ @SystemApi @SuppressWarnings("DefaultAnnotationParam") @DataClass(genAidl = true, genHiddenConstructor = true, genParcelable = true, genToString = true, genEqualsHashCode = true) public final class DomainVerificationInfo implements Parcelable { Loading Loading @@ -71,22 +73,30 @@ public final class DomainVerificationInfo implements Parcelable { private final String mPackageName; /** * Map of host names to their current state. State is an integer, which defaults to * {@link DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the * domain verification agent (the intended consumer of this API), which can be equal * to {@link DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or * greater than {@link DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for * any unsuccessful response. * Map of host names to their current state. State is an integer, which defaults to {@link * DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the domain * verification agent (the intended consumer of this API), which can be equal to {@link * DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or greater than {@link * DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for any unsuccessful response. * <p> * Any value non-inclusive between those 2 values are reserved for use by the system. * The domain verification agent may be able to act on these reserved values, and this * ability can be queried using {@link DomainVerificationManager#isStateModifiable(int)}. * It is expected that the agent attempt to verify all domains that it can modify the * state of, even if it does not understand the meaning of those values. * Any value non-inclusive between those 2 values are reserved for use by the system. The domain * verification agent may be able to act on these reserved values, and this ability can be * queried using {@link DomainVerificationManager#isStateModifiable(int)}. It is expected that * the agent attempt to verify all domains that it can modify the state of, even if it does not * understand the meaning of those values. */ @NonNull private final Map<String, Integer> mHostToStateMap; private void parcelHostToStateMap(Parcel dest, @SuppressWarnings("unused") int flags) { DomainVerificationUtils.writeHostMap(dest, mHostToStateMap); } private Map<String, Integer> unparcelHostToStateMap(Parcel in) { return DomainVerificationUtils.readHostMap(in, new ArrayMap<>(), DomainVerificationUserSelection.class.getClassLoader()); } // Code below generated by codegen v1.0.22. Loading @@ -95,7 +105,8 @@ 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 Loading Loading @@ -123,18 +134,17 @@ public final class DomainVerificationInfo implements Parcelable { * @param packageName * The package name that this data corresponds to. * @param hostToStateMap * Map of host names to their current state. State is an integer, which defaults to * {@link DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the * domain verification agent (the intended consumer of this API), which can be equal * to {@link DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or * greater than {@link DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for * any unsuccessful response. * Map of host names to their current state. State is an integer, which defaults to {@link * DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the domain * verification agent (the intended consumer of this API), which can be equal to {@link * DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or greater than {@link * DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for any unsuccessful response. * <p> * Any value non-inclusive between those 2 values are reserved for use by the system. * The domain verification agent may be able to act on these reserved values, and this * ability can be queried using {@link DomainVerificationManager#isStateModifiable(int)}. * It is expected that the agent attempt to verify all domains that it can modify the * state of, even if it does not understand the meaning of those values. * Any value non-inclusive between those 2 values are reserved for use by the system. The domain * verification agent may be able to act on these reserved values, and this ability can be * queried using {@link DomainVerificationManager#isStateModifiable(int)}. It is expected that * the agent attempt to verify all domains that it can modify the state of, even if it does not * understand the meaning of those values. * @hide */ @DataClass.Generated.Member Loading Loading @@ -185,18 +195,17 @@ public final class DomainVerificationInfo implements Parcelable { } /** * Map of host names to their current state. State is an integer, which defaults to * {@link DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the * domain verification agent (the intended consumer of this API), which can be equal * to {@link DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or * greater than {@link DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for * any unsuccessful response. * Map of host names to their current state. State is an integer, which defaults to {@link * DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the domain * verification agent (the intended consumer of this API), which can be equal to {@link * DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or greater than {@link * DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for any unsuccessful response. * <p> * Any value non-inclusive between those 2 values are reserved for use by the system. * The domain verification agent may be able to act on these reserved values, and this * ability can be queried using {@link DomainVerificationManager#isStateModifiable(int)}. * It is expected that the agent attempt to verify all domains that it can modify the * state of, even if it does not understand the meaning of those values. * Any value non-inclusive between those 2 values are reserved for use by the system. The domain * verification agent may be able to act on these reserved values, and this ability can be * queried using {@link DomainVerificationManager#isStateModifiable(int)}. It is expected that * the agent attempt to verify all domains that it can modify the state of, even if it does not * understand the meaning of those values. */ @DataClass.Generated.Member public @NonNull Map<String,Integer> getHostToStateMap() { Loading Loading @@ -260,13 +269,13 @@ public final class DomainVerificationInfo implements Parcelable { @Override @DataClass.Generated.Member public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { // You can override field parcelling by defining methods like: // void parcelFieldName(Parcel dest, int flags) { ... } sParcellingForIdentifier.parcel(mIdentifier, dest, flags); dest.writeString(mPackageName); dest.writeMap(mHostToStateMap); parcelHostToStateMap(dest, flags); } @Override Loading @@ -276,14 +285,13 @@ public final class DomainVerificationInfo implements Parcelable { /** @hide */ @SuppressWarnings({"unchecked", "RedundantCast"}) @DataClass.Generated.Member /* package-private */ DomainVerificationInfo(@NonNull android.os.Parcel in) { /* package-private */ DomainVerificationInfo(@NonNull Parcel in) { // You can override field unparcelling by defining methods like: // static FieldType unparcelFieldName(Parcel in) { ... } UUID identifier = sParcellingForIdentifier.unparcel(in); String packageName = in.readString(); Map<String,Integer> hostToStateMap = new java.util.LinkedHashMap<>(); in.readMap(hostToStateMap, Integer.class.getClassLoader()); Map<String,Integer> hostToStateMap = unparcelHostToStateMap(in); this.mIdentifier = identifier; com.android.internal.util.AnnotationValidations.validate( Loading @@ -307,16 +315,16 @@ public final class DomainVerificationInfo implements Parcelable { } @Override public DomainVerificationInfo createFromParcel(@NonNull android.os.Parcel in) { public DomainVerificationInfo createFromParcel(@NonNull Parcel in) { return new DomainVerificationInfo(in); } }; @DataClass.Generated( time = 1611862790369L, time = 1613002530369L, 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\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)") 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)") @Deprecated private void __metadata() {} Loading core/java/android/content/pm/verify/domain/DomainVerificationManagerImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ public class DomainVerificationManagerImpl implements DomainVerificationManager int state) throws IllegalArgumentException, NameNotFoundException { try { mDomainVerificationManager.setDomainVerificationStatus(domainSetId.toString(), new ArrayList<>(domains), state); new DomainSet(domains), state); } catch (Exception e) { Exception converted = rethrow(e, domainSetId); if (converted instanceof NameNotFoundException) { Loading Loading @@ -126,7 +126,7 @@ public class DomainVerificationManagerImpl implements DomainVerificationManager throws IllegalArgumentException, NameNotFoundException { try { mDomainVerificationManager.setDomainVerificationUserSelection(domainSetId.toString(), new ArrayList<>(domains), enabled, mContext.getUserId()); new DomainSet(domains), enabled, mContext.getUserId()); } catch (Exception e) { Exception converted = rethrow(e, domainSetId); if (converted instanceof NameNotFoundException) { Loading core/java/android/content/pm/verify/domain/DomainVerificationRequest.java +31 −21 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.content.pm.verify.domain; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.Intent; import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.DataClass; Loading @@ -27,11 +28,11 @@ import com.android.internal.util.Parcelling; import java.util.Set; /** * Request object sent in the {@link Intent} that's broadcast to the domain verification * agent, retrieved through {@link DomainVerificationManager#EXTRA_VERIFICATION_REQUEST}. * Request object sent in the {@link Intent} that's broadcast to the domain verification agent, * retrieved through {@link DomainVerificationManager#EXTRA_VERIFICATION_REQUEST}. * <p> * This contains the set of packages which have been invalidated and will require * re-verification. The exact domains can be retrieved with * This contains the set of packages which have been invalidated and will require re-verification. * The exact domains can be retrieved with * {@link DomainVerificationManager#getDomainVerificationInfo(String)} * * @hide Loading @@ -42,14 +43,22 @@ import java.util.Set; public final class DomainVerificationRequest implements Parcelable { /** * The package names of the apps that need to be verified. The receiver should call * {@link DomainVerificationManager#getDomainVerificationInfo(String)} with each of * these values to get the actual set of domains that need to be acted on. * The package names of the apps that need to be verified. The receiver should call {@link * DomainVerificationManager#getDomainVerificationInfo(String)} with each of these values to get * the actual set of domains that need to be acted on. */ @NonNull @DataClass.ParcelWith(Parcelling.BuiltIn.ForStringSet.class) private final Set<String> mPackageNames; private void parcelPackageNames(@NonNull Parcel dest, @SuppressWarnings("unused") int flags) { DomainVerificationUtils.writeHostSet(dest, mPackageNames); } private Set<String> unparcelPackageNames(@NonNull Parcel in) { return DomainVerificationUtils.readHostSet(in); } // Code below generated by codegen v1.0.22. Loading @@ -58,7 +67,8 @@ public final class DomainVerificationRequest implements Parcelable { // CHECKSTYLE:OFF Generated code // // To regenerate run: // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationRequest.java // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain // /DomainVerificationRequest.java // // To exclude the generated code from IntelliJ auto-formatting enable (one-time): // Settings > Editor > Code Style > Formatter Control Loading @@ -69,9 +79,9 @@ public final class DomainVerificationRequest implements Parcelable { * Creates a new DomainVerificationRequest. * * @param packageNames * The package names of the apps that need to be verified. The receiver should call * {@link DomainVerificationManager#getDomainVerificationInfo(String)} with each of * these values to get the actual set of domains that need to be acted on. * The package names of the apps that need to be verified. The receiver should call {@link * DomainVerificationManager#getDomainVerificationInfo(String)} with each of these values to get * the actual set of domains that need to be acted on. * @hide */ @DataClass.Generated.Member Loading @@ -85,9 +95,9 @@ public final class DomainVerificationRequest implements Parcelable { } /** * The package names of the apps that need to be verified. The receiver should call * {@link DomainVerificationManager#getDomainVerificationInfo(String)} with each of * these values to get the actual set of domains that need to be acted on. * The package names of the apps that need to be verified. The receiver should call {@link * DomainVerificationManager#getDomainVerificationInfo(String)} with each of these values to get * the actual set of domains that need to be acted on. */ @DataClass.Generated.Member public @NonNull Set<String> getPackageNames() { Loading Loading @@ -134,11 +144,11 @@ public final class DomainVerificationRequest implements Parcelable { @Override @DataClass.Generated.Member public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { // You can override field parcelling by defining methods like: // void parcelFieldName(Parcel dest, int flags) { ... } sParcellingForPackageNames.parcel(mPackageNames, dest, flags); parcelPackageNames(dest, flags); } @Override Loading @@ -148,11 +158,11 @@ public final class DomainVerificationRequest implements Parcelable { /** @hide */ @SuppressWarnings({"unchecked", "RedundantCast"}) @DataClass.Generated.Member /* package-private */ DomainVerificationRequest(@NonNull android.os.Parcel in) { /* package-private */ DomainVerificationRequest(@NonNull Parcel in) { // You can override field unparcelling by defining methods like: // static FieldType unparcelFieldName(Parcel in) { ... } Set<String> packageNames = sParcellingForPackageNames.unparcel(in); Set<String> packageNames = unparcelPackageNames(in); this.mPackageNames = packageNames; com.android.internal.util.AnnotationValidations.validate( Loading @@ -170,16 +180,16 @@ public final class DomainVerificationRequest implements Parcelable { } @Override public DomainVerificationRequest createFromParcel(@NonNull android.os.Parcel in) { public DomainVerificationRequest createFromParcel(@NonNull Parcel in) { return new DomainVerificationRequest(in); } }; @DataClass.Generated( time = 1611862814990L, time = 1613169505495L, codegenVersion = "1.0.22", sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationRequest.java", inputSignatures = "private final @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForStringSet.class) java.util.Set<java.lang.String> mPackageNames\nclass DomainVerificationRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true, genAidl=false, genEqualsHashCode=true)") inputSignatures = "private final @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForStringSet.class) java.util.Set<java.lang.String> mPackageNames\nprivate void parcelPackageNames(android.os.Parcel,int)\nprivate java.util.Set<java.lang.String> unparcelPackageNames(android.os.Parcel)\nclass DomainVerificationRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true, genAidl=false, genEqualsHashCode=true)") @Deprecated private void __metadata() {} Loading Loading
core/java/android/content/pm/verify/domain/DomainSet.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.content.pm.verify.domain; parcelable DomainSet;
core/java/android/content/pm/verify/domain/DomainSet.java 0 → 100644 +160 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.content.pm.verify.domain; import android.annotation.NonNull; import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.DataClass; import java.util.Set; /** * Wraps an input set of domains from the client process, to be sent to the server. Handles cases * where the data size is too large by writing data using {@link Parcel#writeBlob(byte[])}. * * @hide */ @DataClass(genParcelable = true, genAidl = true, genEqualsHashCode = true) public class DomainSet implements Parcelable { @NonNull private final Set<String> mDomains; private void parcelDomains(@NonNull Parcel dest, @SuppressWarnings("unused") int flags) { DomainVerificationUtils.writeHostSet(dest, mDomains); } private Set<String> unparcelDomains(@NonNull Parcel in) { return DomainVerificationUtils.readHostSet(in); } // Code below generated by codegen v1.0.22. // // DO NOT MODIFY! // CHECKSTYLE:OFF Generated code // // To regenerate run: // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain // /DomainSet.java // // To exclude the generated code from IntelliJ auto-formatting enable (one-time): // Settings > Editor > Code Style > Formatter Control //@formatter:off @DataClass.Generated.Member public DomainSet( @NonNull Set<String> domains) { this.mDomains = domains; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mDomains); // onConstructed(); // You can define this method to get a callback } @DataClass.Generated.Member public @NonNull Set<String> getDomains() { return mDomains; } @Override @DataClass.Generated.Member public boolean equals(@android.annotation.Nullable Object o) { // You can override field equality logic by defining either of the methods like: // boolean fieldNameEquals(DomainSet other) { ... } // boolean fieldNameEquals(FieldType otherValue) { ... } if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; @SuppressWarnings("unchecked") DomainSet that = (DomainSet) o; //noinspection PointlessBooleanExpression return true && java.util.Objects.equals(mDomains, that.mDomains); } @Override @DataClass.Generated.Member public int hashCode() { // You can override field hashCode logic by defining methods like: // int fieldNameHashCode() { ... } int _hash = 1; _hash = 31 * _hash + java.util.Objects.hashCode(mDomains); return _hash; } @Override @DataClass.Generated.Member public void writeToParcel(@NonNull Parcel dest, int flags) { // You can override field parcelling by defining methods like: // void parcelFieldName(Parcel dest, int flags) { ... } parcelDomains(dest, flags); } @Override @DataClass.Generated.Member public int describeContents() { return 0; } /** @hide */ @SuppressWarnings({"unchecked", "RedundantCast"}) @DataClass.Generated.Member protected DomainSet(@NonNull Parcel in) { // You can override field unparcelling by defining methods like: // static FieldType unparcelFieldName(Parcel in) { ... } Set<String> domains = unparcelDomains(in); this.mDomains = domains; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mDomains); // onConstructed(); // You can define this method to get a callback } @DataClass.Generated.Member public static final @NonNull Parcelable.Creator<DomainSet> CREATOR = new Parcelable.Creator<DomainSet>() { @Override public DomainSet[] newArray(int size) { return new DomainSet[size]; } @Override public DomainSet createFromParcel(@NonNull Parcel in) { return new DomainSet(in); } }; @DataClass.Generated( time = 1613169242020L, codegenVersion = "1.0.22", sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainSet.java", inputSignatures = "private final @android.annotation.NonNull java.util.Set<java.lang.String> mDomains\nprivate void parcelDomains(android.os.Parcel,int)\nprivate java.util.Set<java.lang.String> unparcelDomains(android.os.Parcel)\nclass DomainSet extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genEqualsHashCode=true)") @Deprecated private void __metadata() {} //@formatter:on // End of generated code }
core/java/android/content/pm/verify/domain/DomainVerificationInfo.java +52 −44 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ package android.content.pm.verify.domain; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.pm.PackageManager; import android.os.Parcel; import android.os.Parcelable; import android.util.ArrayMap; import com.android.internal.util.DataClass; import com.android.internal.util.Parcelling; Loading @@ -34,12 +36,12 @@ import java.util.UUID; * against the digital asset links response from the server hosting that domain. * <p> * These values for each domain can be modified through * {@link DomainVerificationManager#setDomainVerificationStatus(UUID, Set, int)}. * {@link DomainVerificationManager#setDomainVerificationStatus(UUID, * Set, int)}. * * @hide */ @SystemApi @SuppressWarnings("DefaultAnnotationParam") @DataClass(genAidl = true, genHiddenConstructor = true, genParcelable = true, genToString = true, genEqualsHashCode = true) public final class DomainVerificationInfo implements Parcelable { Loading Loading @@ -71,22 +73,30 @@ public final class DomainVerificationInfo implements Parcelable { private final String mPackageName; /** * Map of host names to their current state. State is an integer, which defaults to * {@link DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the * domain verification agent (the intended consumer of this API), which can be equal * to {@link DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or * greater than {@link DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for * any unsuccessful response. * Map of host names to their current state. State is an integer, which defaults to {@link * DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the domain * verification agent (the intended consumer of this API), which can be equal to {@link * DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or greater than {@link * DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for any unsuccessful response. * <p> * Any value non-inclusive between those 2 values are reserved for use by the system. * The domain verification agent may be able to act on these reserved values, and this * ability can be queried using {@link DomainVerificationManager#isStateModifiable(int)}. * It is expected that the agent attempt to verify all domains that it can modify the * state of, even if it does not understand the meaning of those values. * Any value non-inclusive between those 2 values are reserved for use by the system. The domain * verification agent may be able to act on these reserved values, and this ability can be * queried using {@link DomainVerificationManager#isStateModifiable(int)}. It is expected that * the agent attempt to verify all domains that it can modify the state of, even if it does not * understand the meaning of those values. */ @NonNull private final Map<String, Integer> mHostToStateMap; private void parcelHostToStateMap(Parcel dest, @SuppressWarnings("unused") int flags) { DomainVerificationUtils.writeHostMap(dest, mHostToStateMap); } private Map<String, Integer> unparcelHostToStateMap(Parcel in) { return DomainVerificationUtils.readHostMap(in, new ArrayMap<>(), DomainVerificationUserSelection.class.getClassLoader()); } // Code below generated by codegen v1.0.22. Loading @@ -95,7 +105,8 @@ 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 Loading Loading @@ -123,18 +134,17 @@ public final class DomainVerificationInfo implements Parcelable { * @param packageName * The package name that this data corresponds to. * @param hostToStateMap * Map of host names to their current state. State is an integer, which defaults to * {@link DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the * domain verification agent (the intended consumer of this API), which can be equal * to {@link DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or * greater than {@link DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for * any unsuccessful response. * Map of host names to their current state. State is an integer, which defaults to {@link * DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the domain * verification agent (the intended consumer of this API), which can be equal to {@link * DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or greater than {@link * DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for any unsuccessful response. * <p> * Any value non-inclusive between those 2 values are reserved for use by the system. * The domain verification agent may be able to act on these reserved values, and this * ability can be queried using {@link DomainVerificationManager#isStateModifiable(int)}. * It is expected that the agent attempt to verify all domains that it can modify the * state of, even if it does not understand the meaning of those values. * Any value non-inclusive between those 2 values are reserved for use by the system. The domain * verification agent may be able to act on these reserved values, and this ability can be * queried using {@link DomainVerificationManager#isStateModifiable(int)}. It is expected that * the agent attempt to verify all domains that it can modify the state of, even if it does not * understand the meaning of those values. * @hide */ @DataClass.Generated.Member Loading Loading @@ -185,18 +195,17 @@ public final class DomainVerificationInfo implements Parcelable { } /** * Map of host names to their current state. State is an integer, which defaults to * {@link DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the * domain verification agent (the intended consumer of this API), which can be equal * to {@link DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or * greater than {@link DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for * any unsuccessful response. * Map of host names to their current state. State is an integer, which defaults to {@link * DomainVerificationManager#STATE_NO_RESPONSE}. State can be modified by the domain * verification agent (the intended consumer of this API), which can be equal to {@link * DomainVerificationManager#STATE_SUCCESS} when verified, or equal to or greater than {@link * DomainVerificationManager#STATE_FIRST_VERIFIER_DEFINED} for any unsuccessful response. * <p> * Any value non-inclusive between those 2 values are reserved for use by the system. * The domain verification agent may be able to act on these reserved values, and this * ability can be queried using {@link DomainVerificationManager#isStateModifiable(int)}. * It is expected that the agent attempt to verify all domains that it can modify the * state of, even if it does not understand the meaning of those values. * Any value non-inclusive between those 2 values are reserved for use by the system. The domain * verification agent may be able to act on these reserved values, and this ability can be * queried using {@link DomainVerificationManager#isStateModifiable(int)}. It is expected that * the agent attempt to verify all domains that it can modify the state of, even if it does not * understand the meaning of those values. */ @DataClass.Generated.Member public @NonNull Map<String,Integer> getHostToStateMap() { Loading Loading @@ -260,13 +269,13 @@ public final class DomainVerificationInfo implements Parcelable { @Override @DataClass.Generated.Member public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { // You can override field parcelling by defining methods like: // void parcelFieldName(Parcel dest, int flags) { ... } sParcellingForIdentifier.parcel(mIdentifier, dest, flags); dest.writeString(mPackageName); dest.writeMap(mHostToStateMap); parcelHostToStateMap(dest, flags); } @Override Loading @@ -276,14 +285,13 @@ public final class DomainVerificationInfo implements Parcelable { /** @hide */ @SuppressWarnings({"unchecked", "RedundantCast"}) @DataClass.Generated.Member /* package-private */ DomainVerificationInfo(@NonNull android.os.Parcel in) { /* package-private */ DomainVerificationInfo(@NonNull Parcel in) { // You can override field unparcelling by defining methods like: // static FieldType unparcelFieldName(Parcel in) { ... } UUID identifier = sParcellingForIdentifier.unparcel(in); String packageName = in.readString(); Map<String,Integer> hostToStateMap = new java.util.LinkedHashMap<>(); in.readMap(hostToStateMap, Integer.class.getClassLoader()); Map<String,Integer> hostToStateMap = unparcelHostToStateMap(in); this.mIdentifier = identifier; com.android.internal.util.AnnotationValidations.validate( Loading @@ -307,16 +315,16 @@ public final class DomainVerificationInfo implements Parcelable { } @Override public DomainVerificationInfo createFromParcel(@NonNull android.os.Parcel in) { public DomainVerificationInfo createFromParcel(@NonNull Parcel in) { return new DomainVerificationInfo(in); } }; @DataClass.Generated( time = 1611862790369L, time = 1613002530369L, 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\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)") 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)") @Deprecated private void __metadata() {} Loading
core/java/android/content/pm/verify/domain/DomainVerificationManagerImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ public class DomainVerificationManagerImpl implements DomainVerificationManager int state) throws IllegalArgumentException, NameNotFoundException { try { mDomainVerificationManager.setDomainVerificationStatus(domainSetId.toString(), new ArrayList<>(domains), state); new DomainSet(domains), state); } catch (Exception e) { Exception converted = rethrow(e, domainSetId); if (converted instanceof NameNotFoundException) { Loading Loading @@ -126,7 +126,7 @@ public class DomainVerificationManagerImpl implements DomainVerificationManager throws IllegalArgumentException, NameNotFoundException { try { mDomainVerificationManager.setDomainVerificationUserSelection(domainSetId.toString(), new ArrayList<>(domains), enabled, mContext.getUserId()); new DomainSet(domains), enabled, mContext.getUserId()); } catch (Exception e) { Exception converted = rethrow(e, domainSetId); if (converted instanceof NameNotFoundException) { Loading
core/java/android/content/pm/verify/domain/DomainVerificationRequest.java +31 −21 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.content.pm.verify.domain; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.Intent; import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.DataClass; Loading @@ -27,11 +28,11 @@ import com.android.internal.util.Parcelling; import java.util.Set; /** * Request object sent in the {@link Intent} that's broadcast to the domain verification * agent, retrieved through {@link DomainVerificationManager#EXTRA_VERIFICATION_REQUEST}. * Request object sent in the {@link Intent} that's broadcast to the domain verification agent, * retrieved through {@link DomainVerificationManager#EXTRA_VERIFICATION_REQUEST}. * <p> * This contains the set of packages which have been invalidated and will require * re-verification. The exact domains can be retrieved with * This contains the set of packages which have been invalidated and will require re-verification. * The exact domains can be retrieved with * {@link DomainVerificationManager#getDomainVerificationInfo(String)} * * @hide Loading @@ -42,14 +43,22 @@ import java.util.Set; public final class DomainVerificationRequest implements Parcelable { /** * The package names of the apps that need to be verified. The receiver should call * {@link DomainVerificationManager#getDomainVerificationInfo(String)} with each of * these values to get the actual set of domains that need to be acted on. * The package names of the apps that need to be verified. The receiver should call {@link * DomainVerificationManager#getDomainVerificationInfo(String)} with each of these values to get * the actual set of domains that need to be acted on. */ @NonNull @DataClass.ParcelWith(Parcelling.BuiltIn.ForStringSet.class) private final Set<String> mPackageNames; private void parcelPackageNames(@NonNull Parcel dest, @SuppressWarnings("unused") int flags) { DomainVerificationUtils.writeHostSet(dest, mPackageNames); } private Set<String> unparcelPackageNames(@NonNull Parcel in) { return DomainVerificationUtils.readHostSet(in); } // Code below generated by codegen v1.0.22. Loading @@ -58,7 +67,8 @@ public final class DomainVerificationRequest implements Parcelable { // CHECKSTYLE:OFF Generated code // // To regenerate run: // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationRequest.java // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/verify/domain // /DomainVerificationRequest.java // // To exclude the generated code from IntelliJ auto-formatting enable (one-time): // Settings > Editor > Code Style > Formatter Control Loading @@ -69,9 +79,9 @@ public final class DomainVerificationRequest implements Parcelable { * Creates a new DomainVerificationRequest. * * @param packageNames * The package names of the apps that need to be verified. The receiver should call * {@link DomainVerificationManager#getDomainVerificationInfo(String)} with each of * these values to get the actual set of domains that need to be acted on. * The package names of the apps that need to be verified. The receiver should call {@link * DomainVerificationManager#getDomainVerificationInfo(String)} with each of these values to get * the actual set of domains that need to be acted on. * @hide */ @DataClass.Generated.Member Loading @@ -85,9 +95,9 @@ public final class DomainVerificationRequest implements Parcelable { } /** * The package names of the apps that need to be verified. The receiver should call * {@link DomainVerificationManager#getDomainVerificationInfo(String)} with each of * these values to get the actual set of domains that need to be acted on. * The package names of the apps that need to be verified. The receiver should call {@link * DomainVerificationManager#getDomainVerificationInfo(String)} with each of these values to get * the actual set of domains that need to be acted on. */ @DataClass.Generated.Member public @NonNull Set<String> getPackageNames() { Loading Loading @@ -134,11 +144,11 @@ public final class DomainVerificationRequest implements Parcelable { @Override @DataClass.Generated.Member public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { // You can override field parcelling by defining methods like: // void parcelFieldName(Parcel dest, int flags) { ... } sParcellingForPackageNames.parcel(mPackageNames, dest, flags); parcelPackageNames(dest, flags); } @Override Loading @@ -148,11 +158,11 @@ public final class DomainVerificationRequest implements Parcelable { /** @hide */ @SuppressWarnings({"unchecked", "RedundantCast"}) @DataClass.Generated.Member /* package-private */ DomainVerificationRequest(@NonNull android.os.Parcel in) { /* package-private */ DomainVerificationRequest(@NonNull Parcel in) { // You can override field unparcelling by defining methods like: // static FieldType unparcelFieldName(Parcel in) { ... } Set<String> packageNames = sParcellingForPackageNames.unparcel(in); Set<String> packageNames = unparcelPackageNames(in); this.mPackageNames = packageNames; com.android.internal.util.AnnotationValidations.validate( Loading @@ -170,16 +180,16 @@ public final class DomainVerificationRequest implements Parcelable { } @Override public DomainVerificationRequest createFromParcel(@NonNull android.os.Parcel in) { public DomainVerificationRequest createFromParcel(@NonNull Parcel in) { return new DomainVerificationRequest(in); } }; @DataClass.Generated( time = 1611862814990L, time = 1613169505495L, codegenVersion = "1.0.22", sourceFile = "frameworks/base/core/java/android/content/pm/verify/domain/DomainVerificationRequest.java", inputSignatures = "private final @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForStringSet.class) java.util.Set<java.lang.String> mPackageNames\nclass DomainVerificationRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true, genAidl=false, genEqualsHashCode=true)") inputSignatures = "private final @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForStringSet.class) java.util.Set<java.lang.String> mPackageNames\nprivate void parcelPackageNames(android.os.Parcel,int)\nprivate java.util.Set<java.lang.String> unparcelPackageNames(android.os.Parcel)\nclass DomainVerificationRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true, genAidl=false, genEqualsHashCode=true)") @Deprecated private void __metadata() {} Loading