Merge "Allow Android Auto to move to trusted." into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2022-10-07 19:29:58 +00:00
committed by Android (Google) Code Review

View File

@@ -602,9 +602,12 @@ public class TrustManagerService extends SystemService {
synchronized (mUserTrustState) {
wasTrusted = (mUserTrustState.get(userId) == TrustState.TRUSTED);
wasTrustable = (mUserTrustState.get(userId) == TrustState.TRUSTABLE);
boolean isAutomotive = getContext().getPackageManager().hasSystemFeature(
PackageManager.FEATURE_AUTOMOTIVE);
boolean renewingTrust = wasTrustable && (
(flags & TrustAgentService.FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE) != 0);
boolean canMoveToTrusted = alreadyUnlocked || isFromUnlock || renewingTrust;
boolean canMoveToTrusted =
alreadyUnlocked || isFromUnlock || renewingTrust || isAutomotive;
boolean upgradingTrustForCurrentUser = (userId == mCurrentUser);
if (trustedByAtLeastOneAgent && wasTrusted) {