diff options
author | twyen <twyen@google.com> | 2017-09-26 16:06:32 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-09-27 08:35:11 -0700 |
commit | bd73e9d14c3d336b59b6b3f880433465a5e80ce3 (patch) | |
tree | cf54d32e5eccfd7aa8c11abb422f1d0d3db8bcc0 /java | |
parent | f838726676381241f578f7d21d660d28410469e7 (diff) |
Force dialpad to hide on resume if it should be hidden
On M the framework does not retain the hidden state of a fragment properly when restoring it from a savedInstanceState. This appears to be fixed in N, but the exact cause and fix are unknown. This behavior will cause a fragment previously hidden coming back as visible when the device is rotated or going through any save/restore life cycle.
Previously whether to show the dialpad is stored in a separate flag, and the dialpad will be hidden when it is reattached. This was regresed in cl/169614750
In this CL, if the saved mIsDialpadShown indicate the dialpad should not be shown, but the dialpad is not hidden, it will be hidden on resume.
Bug: 66893723
Test: DialtactsActivityTest
PiperOrigin-RevId: 170124711
Change-Id: I6f8ed21fb970d6f688cb75f854442115a6803f3c
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/dialer/app/DialtactsActivity.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 00d28fe68..04f1431e4 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -517,6 +517,14 @@ public class DialtactsActivity extends TransactionSafeActivity PostCall.promptUserForMessageIfNecessary(this, mParentLayout); } + // On M the fragment manager does not restore the hidden state of a fragment from + // savedInstanceState so it must be hidden again. + if (!mIsDialpadShown && mDialpadFragment != null && !mDialpadFragment.isHidden()) { + LogUtil.i( + "DialtactsActivity.onResume", "mDialpadFragment attached but not hidden, forcing hide"); + getFragmentManager().beginTransaction().hide(mDialpadFragment).commit(); + } + // If there was a voice query result returned in the {@link #onActivityResult} callback, it // will have been stashed in mVoiceSearchQuery since the search results fragment cannot be // shown until onResume has completed. Active the search UI and set the search term now. |