diff options
| author | 2018-11-21 23:57:15 +0000 | |
|---|---|---|
| committer | 2018-11-21 23:57:15 +0000 | |
| commit | 14c651bb7bd43796d05cdc7deebeca21159e82e9 (patch) | |
| tree | fe371bae3a7c030e8791ded9f2f11b63109e9490 | |
| parent | b08ce064b7c03032b368fd91a50909bb1f24b8f2 (diff) | |
| parent | e579033d768234f9951527ff5be6e7adc29ed1bb (diff) | |
Merge "Notify AutofillManager in onResume() IFF activity was not recreated."
| -rw-r--r-- | core/java/android/app/Activity.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 553acc8dcbd3..83fab7e5a45d 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -1432,7 +1432,15 @@ public class Activity extends ContextThemeWrapper if (mAutoFillResetNeeded) { if (!mAutoFillIgnoreFirstResumePause) { View focus = getCurrentFocus(); - if (focus != null && focus.canNotifyAutofillEnterExitEvent()) { + // On Activity rotation situation (mRestoredFromBundle is true), + // we should not call on AutofillManager in onResume() + // since the next Layout pass will do that. + // However, there are both cases where Activity#getCurrentFocus() + // will return null (window not preserved) and not null (window IS + // preserved), so we need to explicitly check for mRestoredFromBundle + // here. + if (!mRestoredFromBundle && focus != null + && focus.canNotifyAutofillEnterExitEvent()) { // TODO: in Activity killed/recreated case, i.e. SessionLifecycleTest# // testDatasetVisibleWhileAutofilledAppIsLifecycled: the View's initial // window visibility after recreation is INVISIBLE in onResume() and next frame |