diff options
author | Your Name <jacobhobbie@google.com> | 2022-10-06 00:48:19 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-10-12 19:47:51 +0000 |
commit | 88b9e2b92b5c4d58de97241a2ab6c9c08a129073 (patch) | |
tree | 124fbca55efd1d280b61ac635846b1bf4a434b62 | |
parent | 852b53ccb3aefbb635b6f179e57e8b3be97b8f6e (diff) | |
download | base-88b9e2b92b5c4d58de97241a2ab6c9c08a129073.tar.gz |
Allow Android Auto to move to trusted.
Seems like there is a bug with how TrustManagerService deals with
automotive now that there is the possibility for renewable trust,
preventing the automotive companion from being unlocked by the phone. To
fix this, we'll update canMoveToTrusted to also allow automotive
trustagents to automatically move to trusted (if the right other
conditions are met).
Test: Manually for automotive
Fixes: 250703401
Change-Id: I906be77a2f09582095d24797aebdb0eda420eee6
(cherry picked from commit 2fa61e04624ec9ccbfb9945b7b911ca564b6b6fb)
Merged-In: I906be77a2f09582095d24797aebdb0eda420eee6
-rw-r--r-- | services/core/java/com/android/server/trust/TrustManagerService.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java index 7170773edca4..2888b9a2d3cc 100644 --- a/services/core/java/com/android/server/trust/TrustManagerService.java +++ b/services/core/java/com/android/server/trust/TrustManagerService.java @@ -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) { |