am 4e9e6cd1: Fix IllegalStateException of KeyDetector

* commit '4e9e6cd1544f59be2ae02536af62fe5301e0cebb':
  Fix IllegalStateException of KeyDetector