diff options
Diffstat (limited to 'services/core/java/com/android/server/trust/TrustAgentWrapper.java')
-rw-r--r-- | services/core/java/com/android/server/trust/TrustAgentWrapper.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/trust/TrustAgentWrapper.java b/services/core/java/com/android/server/trust/TrustAgentWrapper.java index 4906bd1..57b204d 100644 --- a/services/core/java/com/android/server/trust/TrustAgentWrapper.java +++ b/services/core/java/com/android/server/trust/TrustAgentWrapper.java @@ -232,6 +232,12 @@ public class TrustAgentWrapper { mTrustManagerService.mArchive.logAgentConnected(mUserId, name); setCallback(mCallback); updateDevicePolicyFeatures(); + + if (mTrustManagerService.isDeviceLockedInner(mUserId)) { + onDeviceLocked(); + } else { + onDeviceUnlocked(); + } } @Override @@ -287,6 +293,7 @@ public class TrustAgentWrapper { onError(e); } } + /** * @see android.service.trust.TrustAgentService#onUnlockAttempt(boolean) */ @@ -298,6 +305,28 @@ public class TrustAgentWrapper { } } + /** + * @see android.service.trust.TrustAgentService#onDeviceLocked() + */ + public void onDeviceLocked() { + try { + if (mTrustAgentService != null) mTrustAgentService.onDeviceLocked(); + } catch (RemoteException e) { + onError(e); + } + } + + /** + * @see android.service.trust.TrustAgentService#onDeviceUnlocked() + */ + public void onDeviceUnlocked() { + try { + if (mTrustAgentService != null) mTrustAgentService.onDeviceUnlocked(); + } catch (RemoteException e) { + onError(e); + } + } + private void setCallback(ITrustAgentServiceCallback callback) { try { if (mTrustAgentService != null) { |