From 19ba5e67afc0d5322c6410462691b9cd276b5dbc Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Tue, 11 Jun 2013 22:29:02 -0700 Subject: [PATCH] Fix ResearchLogger feedback bug If the logger feedback screen is up and the user hits the home button or the keyboard otherwise closes, the system won't let the user enter feedback again, because it is waiting for the user to finish the first one. With this change, the state associated with the feedback screen is cleared when the user closes the keyboard. b/9398772 Change-Id: I832a82793ad42e31b6b3fdb04fabcea75facde7d --- .../android/inputmethod/research/ResearchLogger.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index aa4a866b8..06bdacf42 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -429,6 +429,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang mMainResearchLog.blockingClose(RESEARCHLOG_CLOSE_TIMEOUT_IN_MS); resetLogBuffers(); + cancelFeedbackDialog(); } public void abort() { @@ -701,13 +702,19 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang mInFeedbackDialog = false; } + private void cancelFeedbackDialog() { + if (isMakingUserRecording()) { + cancelRecording(); + } + mInFeedbackDialog = false; + } + public void initSuggest(final Suggest suggest) { mSuggest = suggest; // MainLogBuffer now has an out-of-date Suggest object. Close down MainLogBuffer and create // a new one. if (mMainLogBuffer != null) { - stop(); - start(); + restart(); } }