import android.util.Slog;
import android.service.trust.ITrustAgentService;
import android.service.trust.ITrustAgentServiceCallback;
-import android.service.trust.TrustAgentService;
-import java.util.ArrayList;
import java.util.List;
/**
mTrustManagerService.updateTrust(mUserId, false);
break;
case MSG_RESTART_TIMEOUT:
- unbind();
+ destroy();
mTrustManagerService.resetAgent(mName, mUserId);
break;
case MSG_SET_TRUST_AGENT_FEATURES_COMPLETED:
return mMessage;
}
- public void unbind() {
+ public void destroy() {
+ mHandler.removeMessages(MSG_RESTART_TIMEOUT);
+
if (!mBound) {
return;
}
mTrustAgentService = null;
mSetTrustAgentFeaturesToken = null;
mHandler.sendEmptyMessage(MSG_REVOKE_TRUST);
- mHandler.removeMessages(MSG_RESTART_TIMEOUT);
}
public boolean isConnected() {
obsoleteAgents.addAll(mActiveAgents);
for (UserInfo userInfo : userInfos) {
- if (userInfo.partial || !userInfo.isEnabled() || userInfo.guestToRemove) continue;
+ if (userInfo == null || userInfo.partial || !userInfo.isEnabled()
+ || userInfo.guestToRemove) continue;
if (!userInfo.supportsSwitchTo()) continue;
if (!mActivityManager.isUserRunning(userInfo.id)) continue;
if (lockPatternUtils.getKeyguardStoredPasswordQuality(userInfo.id)
if (info.agent.isManagingTrust()) {
trustMayHaveChanged = true;
}
- info.agent.unbind();
+ info.agent.destroy();
mActiveAgents.remove(info);
}
}
if (info.agent.isManagingTrust()) {
trustMayHaveChanged = true;
}
- info.agent.unbind();
+ info.agent.destroy();
mActiveAgents.removeAt(i);
}
}
if (info.agent.isManagingTrust()) {
trustMayHaveChanged = true;
}
- info.agent.unbind();
+ info.agent.destroy();
mActiveAgents.removeAt(i);
}
}