Fix TpmIsReady regression.

To test:
1. Clear the TPM, reboot.  Run cryptohome --action=tpm_status.  It will return not ready until the TPM is owned, at which point it should show the TPM as enabled, owned, and ready.
2. Reboot after owning the TPM, run cryptohome --action=tpm_status.  It should show the TPM as enabled, owned, and ready.
3. Reboot after clearing the TPM in the bios, but not activating it.  It should show the TPM as not enabled, owned, or ready.

Change-Id: I352cc049866fa10c7b902f1de934d99394c904cc

BUG=none
TEST=manual

Review URL: http://codereview.chromium.org/3674006
diff --git a/tpm_init.cc b/tpm_init.cc
index 3178790..ae02592 100644
--- a/tpm_init.cc
+++ b/tpm_init.cc
@@ -83,22 +83,10 @@
 }
 
 bool TpmInit::IsTpmReady() {
-  // The TPM is not "ready" if the init call has not completed.  It may be in
-  // the middle of taking ownership.
-  if (!task_done_) {
-    return false;
-  }
-  // If initialize_took_ownership_ is true, then the TPM went through a full
-  // succesful ownership cycle in InitializeTpm()
-  if (initialize_took_ownership_) {
-    return true;
-  }
-  // If we get here, then the call to InitializeTpm() is complete and it
-  // returned false.  That merely means that it did not successfully take
-  // ownership, which is the common case after ownership is established on OOBE.
-  // In that case, the TPM is ready if it is enabled and owned.
+  // The TPM is "ready" if it is enabled, owned, and not being owned.
   return (tpm_init_task_->get_tpm()->IsEnabled() &&
-          tpm_init_task_->get_tpm()->IsOwned());
+          tpm_init_task_->get_tpm()->IsOwned() &&
+          !tpm_init_task_->get_tpm()->IsBeingOwned());
 }
 
 bool TpmInit::IsTpmEnabled() {