diff options
| author | Felipe Leme <felipeal@google.com> | 2017-09-21 17:14:41 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-09-21 17:14:41 +0000 |
| commit | f04ea961a08e482b21b27af254e8ff2aca2fbdca (patch) | |
| tree | be16724cf38f9b2beb1c10f2590c98b87dab4c03 /core/java | |
| parent | 7393cfe326b844ce4a5f6acac515287f60ab2f2e (diff) | |
| parent | 64a6188032b8205a91d390591a0c0b5f7296f236 (diff) | |
Merge "Remove finished sessions on ACTION_CLOSE_SYSTEM_DIALOGS." into oc-mr1-dev am: 56e5c3944b
am: 64a6188032
Change-Id: I568c3a67d43b0a1eb1af4350f523ba291c5ea9f2
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/autofill/AutofillManager.java | 18 | ||||
| -rw-r--r-- | core/java/android/view/autofill/IAutoFillManagerClient.aidl | 7 |
2 files changed, 16 insertions, 9 deletions
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java index f888ba298339..e906a1fa7807 100644 --- a/core/java/android/view/autofill/AutofillManager.java +++ b/core/java/android/view/autofill/AutofillManager.java @@ -1342,11 +1342,17 @@ public final class AutofillManager { } } - private void setSessionFinished() { - if (sVerbose) Log.v(TAG, "setSessionFinished()"); + /** + * Marks the state of the session as finished. + * + * @param newState {@link #STATE_FINISHED} (because the autofill service returned a {@code null} + * FillResponse) or {@link #STATE_UNKNOWN} (because the session was removed). + */ + private void setSessionFinished(int newState) { synchronized (mLock) { + if (sVerbose) Log.v(TAG, "setSessionFinished(): from " + mState + " to " + newState); resetSessionLocked(); - mState = STATE_FINISHED; + mState = newState; } } @@ -1413,7 +1419,7 @@ public final class AutofillManager { if (sessionFinished) { // Callback call was "hijacked" to also update the session state. - setSessionFinished(); + setSessionFinished(STATE_FINISHED); } } @@ -1898,10 +1904,10 @@ public final class AutofillManager { } @Override - public void setSessionFinished() { + public void setSessionFinished(int newState) { final AutofillManager afm = mAfm.get(); if (afm != null) { - afm.post(() -> afm.setSessionFinished()); + afm.post(() -> afm.setSessionFinished(newState)); } } } diff --git a/core/java/android/view/autofill/IAutoFillManagerClient.aidl b/core/java/android/view/autofill/IAutoFillManagerClient.aidl index db6855a4dbf4..3dabcec8636a 100644 --- a/core/java/android/view/autofill/IAutoFillManagerClient.aidl +++ b/core/java/android/view/autofill/IAutoFillManagerClient.aidl @@ -82,8 +82,9 @@ oneway interface IAutoFillManagerClient { void setSaveUiState(int sessionId, boolean shown); /** - * Marks the state of the session as finished (because the AutofillService returned a null - * FillResponse). + * Marks the state of the session as finished. + * @param newState STATE_FINISHED (because the autofill service returned a null + * FillResponse) or STATE_UNKNOWN (because the session was removed). */ - void setSessionFinished(); + void setSessionFinished(int newState); } |
