FileDocCategorySizeDatePackage
VerificationParams.javaAPI DocAndroid 5.1 API7568Thu Mar 12 22:22:10 GMT 2015android.content.pm

VerificationParams

public class VerificationParams extends Object implements android.os.Parcelable
Represents verification parameters used to verify packages to be installed.
deprecated
callers should migrate to {@link PackageInstaller}.
hide

Fields Summary
public static final int
NO_UID
A constant used to indicate that a uid value is not present.
private static final String
TO_STRING_PREFIX
What we print out first when toString() is called.
private final android.net.Uri
mVerificationURI
The location of the supplementary verification file.
private final android.net.Uri
mOriginatingURI
URI referencing where the package was downloaded from.
private final android.net.Uri
mReferrer
HTTP referrer URI associated with the originatingURI.
private final int
mOriginatingUid
UID of the application that the install request originated from.
private int
mInstallerUid
UID of application requesting the install
private final android.content.pm.ManifestDigest
mManifestDigest
An object that holds the digest of the package which can be used to verify ownership.
public static final Parcelable.Creator
CREATOR
Constructors Summary
public VerificationParams(android.net.Uri verificationURI, android.net.Uri originatingURI, android.net.Uri referrer, int originatingUid, android.content.pm.ManifestDigest manifestDigest)
Creates verification specifications for installing with application verification.

param
verificationURI The location of the supplementary verification file. This can be a 'file:' or a 'content:' URI. May be {@code null}.
param
originatingURI URI referencing where the package was downloaded from. May be {@code null}.
param
referrer HTTP referrer URI associated with the originatingURI. May be {@code null}.
param
originatingUid UID of the application that the install request originated from, or NO_UID if not present
param
manifestDigest an object that holds the digest of the package which can be used to verify ownership. May be {@code null}.


                                                                                                                                                                
          
                
        mVerificationURI = verificationURI;
        mOriginatingURI = originatingURI;
        mReferrer = referrer;
        mOriginatingUid = originatingUid;
        mManifestDigest = manifestDigest;
        mInstallerUid = NO_UID;
    
private VerificationParams(android.os.Parcel source)

        mVerificationURI = source.readParcelable(Uri.class.getClassLoader());
        mOriginatingURI = source.readParcelable(Uri.class.getClassLoader());
        mReferrer = source.readParcelable(Uri.class.getClassLoader());
        mOriginatingUid = source.readInt();
        mManifestDigest = source.readParcelable(ManifestDigest.class.getClassLoader());
        mInstallerUid = source.readInt();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public booleanequals(java.lang.Object o)

        if (this == o) {
            return true;
        }

        if (!(o instanceof VerificationParams)) {
            return false;
        }

        final VerificationParams other = (VerificationParams) o;

        if (mVerificationURI == null) {
            if (other.mVerificationURI != null) {
                return false;
            }
        } else if (!mVerificationURI.equals(other.mVerificationURI)) {
            return false;
        }

        if (mOriginatingURI == null) {
            if (other.mOriginatingURI != null) {
                return false;
            }
        } else if (!mOriginatingURI.equals(other.mOriginatingURI)) {
            return false;
        }

        if (mReferrer == null) {
            if (other.mReferrer != null) {
                return false;
            }
        } else if (!mReferrer.equals(other.mReferrer)) {
            return false;
        }

        if (mOriginatingUid != other.mOriginatingUid) {
            return false;
        }

        if (mManifestDigest == null) {
            if (other.mManifestDigest != null) {
                return false;
            }
        } else if (!mManifestDigest.equals(other.mManifestDigest)) {
            return false;
        }

        if (mInstallerUid != other.mInstallerUid) {
            return false;
        }

        return true;
    
public intgetInstallerUid()

return
NO_UID when not set

        return mInstallerUid;
    
public android.content.pm.ManifestDigestgetManifestDigest()

        return mManifestDigest;
    
public android.net.UrigetOriginatingURI()

        return mOriginatingURI;
    
public intgetOriginatingUid()
return NO_UID if not available

        return mOriginatingUid;
    
public android.net.UrigetReferrer()

        return mReferrer;
    
public android.net.UrigetVerificationURI()

        return mVerificationURI;
    
public inthashCode()

        int hash = 3;

        hash += 5 * (mVerificationURI == null ? 1 : mVerificationURI.hashCode());
        hash += 7 * (mOriginatingURI == null ? 1 : mOriginatingURI.hashCode());
        hash += 11 * (mReferrer == null ? 1 : mReferrer.hashCode());
        hash += 13 * mOriginatingUid;
        hash += 17 * (mManifestDigest == null ? 1 : mManifestDigest.hashCode());
        hash += 19 * mInstallerUid;

        return hash;
    
public voidsetInstallerUid(int uid)

        mInstallerUid = uid;
    
public java.lang.StringtoString()

        final StringBuilder sb = new StringBuilder(TO_STRING_PREFIX);

        sb.append("mVerificationURI=");
        sb.append(mVerificationURI.toString());
        sb.append(",mOriginatingURI=");
        sb.append(mOriginatingURI.toString());
        sb.append(",mReferrer=");
        sb.append(mReferrer.toString());
        sb.append(",mOriginatingUid=");
        sb.append(mOriginatingUid);
        sb.append(",mManifestDigest=");
        sb.append(mManifestDigest.toString());
        sb.append(",mInstallerUid=");
        sb.append(mInstallerUid);
        sb.append('}");

        return sb.toString();
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeParcelable(mVerificationURI, 0);
        dest.writeParcelable(mOriginatingURI, 0);
        dest.writeParcelable(mReferrer, 0);
        dest.writeInt(mOriginatingUid);
        dest.writeParcelable(mManifestDigest, 0);
        dest.writeInt(mInstallerUid);