Methods Summary |
---|
public void | addSufficientVerifier(int uid)Add a verifier which is added to our sufficient list.
mSufficientVerifierUids.put(uid, true);
|
public void | extendTimeout()Extend the timeout for this Package to be verified.
if (!mExtendedTimeout) {
mExtendedTimeout = true;
}
|
public com.android.server.pm.PackageManagerService.InstallArgs | getInstallArgs()
return mArgs;
|
public boolean | isInstallAllowed()Returns whether installation should be allowed. This should only be
called after {@link #isVerificationComplete()} returns {@code true}.
if (!mRequiredVerificationPassed) {
return false;
}
if (mSufficientVerificationComplete) {
return mSufficientVerificationPassed;
}
return true;
|
public boolean | isVerificationComplete()Returns whether verification is considered complete. This means that the
required verifier and at least one of the sufficient verifiers has
returned a positive verification.
if (!mRequiredVerificationComplete) {
return false;
}
if (mSufficientVerifierUids.size() == 0) {
return true;
}
return mSufficientVerificationComplete;
|
public boolean | setVerifierResponse(int uid, int code)Should be called when a verification is received from an agent so the
state of the package verification can be tracked.
if (uid == mRequiredVerifierUid) {
mRequiredVerificationComplete = true;
switch (code) {
case PackageManager.VERIFICATION_ALLOW_WITHOUT_SUFFICIENT:
mSufficientVerifierUids.clear();
// fall through
case PackageManager.VERIFICATION_ALLOW:
mRequiredVerificationPassed = true;
break;
default:
mRequiredVerificationPassed = false;
}
return true;
} else {
if (mSufficientVerifierUids.get(uid)) {
if (code == PackageManager.VERIFICATION_ALLOW) {
mSufficientVerificationComplete = true;
mSufficientVerificationPassed = true;
}
mSufficientVerifierUids.delete(uid);
if (mSufficientVerifierUids.size() == 0) {
mSufficientVerificationComplete = true;
}
return true;
}
}
return false;
|
public boolean | timeoutExtended()Returns whether the timeout was extended for verification.
return mExtendedTimeout;
|