@@ -39,6 +39,9 @@ public class VerificationParams implements Parcelable {
3939 /** HTTP referrer URI associated with the originatingURI. */
4040 private final Uri mReferrer ;
4141
42+ /** UID of application requesting the install */
43+ private int mInstallerUid ;
44+
4245 /**
4346 * An object that holds the digest of the package which can be used to
4447 * verify ownership.
@@ -63,6 +66,7 @@ public VerificationParams(Uri verificationURI, Uri originatingURI, Uri referrer,
6366 mOriginatingURI = originatingURI ;
6467 mReferrer = referrer ;
6568 mManifestDigest = manifestDigest ;
69+ mInstallerUid = -1 ;
6670 }
6771
6872 public Uri getVerificationURI () {
@@ -81,6 +85,15 @@ public ManifestDigest getManifestDigest() {
8185 return mManifestDigest ;
8286 }
8387
88+ /** @return -1 when not set */
89+ public int getInstallerUid () {
90+ return mInstallerUid ;
91+ }
92+
93+ public void setInstallerUid (int uid ) {
94+ mInstallerUid = uid ;
95+ }
96+
8497 @ Override
8598 public int describeContents () {
8699 return 0 ;
@@ -126,6 +139,10 @@ public boolean equals(Object o) {
126139 return false ;
127140 }
128141
142+ if (mInstallerUid != other .mInstallerUid ) {
143+ return false ;
144+ }
145+
129146 return true ;
130147 }
131148
@@ -137,6 +154,7 @@ public int hashCode() {
137154 hash += 7 * (mOriginatingURI ==null ?1 :mOriginatingURI .hashCode ());
138155 hash += 11 * (mReferrer ==null ?1 :mReferrer .hashCode ());
139156 hash += 13 * (mManifestDigest ==null ?1 :mManifestDigest .hashCode ());
157+ hash += 17 * mInstallerUid ;
140158
141159 return hash ;
142160 }
@@ -153,6 +171,8 @@ public String toString() {
153171 sb .append (mReferrer .toString ());
154172 sb .append (",mManifestDigest=" );
155173 sb .append (mManifestDigest .toString ());
174+ sb .append (",mInstallerUid=" );
175+ sb .append (mInstallerUid );
156176 sb .append ('}' );
157177
158178 return sb .toString ();
@@ -164,6 +184,7 @@ public void writeToParcel(Parcel dest, int flags) {
164184 dest .writeParcelable (mOriginatingURI , 0 );
165185 dest .writeParcelable (mReferrer , 0 );
166186 dest .writeParcelable (mManifestDigest , 0 );
187+ dest .writeInt (mInstallerUid );
167188 }
168189
169190
@@ -172,6 +193,7 @@ private VerificationParams(Parcel source) {
172193 mOriginatingURI = source .readParcelable (Uri .class .getClassLoader ());
173194 mReferrer = source .readParcelable (Uri .class .getClassLoader ());
174195 mManifestDigest = source .readParcelable (ManifestDigest .class .getClassLoader ());
196+ mInstallerUid = source .readInt ();
175197 }
176198
177199 public static final Parcelable .Creator <VerificationParams > CREATOR =
0 commit comments