Methods Summary |
---|
private void | onError(java.lang.Exception e)
Log.e(TAG, "Error while calling TrustManagerService", e);
|
public void | registerTrustListener(android.app.trust.TrustManager$TrustListener trustListener)Registers a listener for trust events.
Requires the {@link android.Manifest.permission#TRUST_LISTENER} permission.
try {
ITrustListener.Stub iTrustListener = new ITrustListener.Stub() {
@Override
public void onTrustChanged(boolean enabled, int userId, boolean initiatedByUser) {
Message m = mHandler.obtainMessage(MSG_TRUST_CHANGED, (enabled ? 1 : 0), userId,
trustListener);
if (initiatedByUser) {
m.getData().putBoolean(DATA_INITIATED_BY_USER, initiatedByUser);
}
m.sendToTarget();
}
@Override
public void onTrustManagedChanged(boolean managed, int userId) {
mHandler.obtainMessage(MSG_TRUST_MANAGED_CHANGED, (managed ? 1 : 0), userId,
trustListener).sendToTarget();
}
};
mService.registerTrustListener(iTrustListener);
mTrustListeners.put(trustListener, iTrustListener);
} catch (RemoteException e) {
onError(e);
}
|
public void | reportEnabledTrustAgentsChanged(int userId)Reports that the list of enabled trust agents changed for user {@param userId}.
Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission.
try {
mService.reportEnabledTrustAgentsChanged(userId);
} catch (RemoteException e) {
onError(e);
}
|
public void | reportKeyguardShowingChanged()Reports that the visibility of the keyguard has changed.
Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission.
try {
mService.reportKeyguardShowingChanged();
} catch (RemoteException e) {
onError(e);
}
|
public void | reportRequireCredentialEntry(int userId)Reports that trust is disabled until credentials have been entered for user {@param userId}.
Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission.
try {
mService.reportRequireCredentialEntry(userId);
} catch (RemoteException e) {
onError(e);
}
|
public void | reportUnlockAttempt(boolean successful, int userId)Reports that user {@param userId} has tried to unlock the device.
try {
mService.reportUnlockAttempt(successful, userId);
} catch (RemoteException e) {
onError(e);
}
|
public void | unregisterTrustListener(android.app.trust.TrustManager$TrustListener trustListener)Unregisters a listener for trust events.
Requires the {@link android.Manifest.permission#TRUST_LISTENER} permission.
ITrustListener iTrustListener = mTrustListeners.remove(trustListener);
if (iTrustListener != null) {
try {
mService.unregisterTrustListener(iTrustListener);
} catch (RemoteException e) {
onError(e);
}
}
|