DozeView disappears when rotating screen after whitelisting Briar
Steps to reproduce:
- Use a device with Android 6+
- Ensure Briar isn't whitelisted for doze
- Create a new account
- In the power management setup screen, tap "Allow Connections" and accept the dialog
- Rotate the screen
- Expected: The layout stays the same
- Actual: The "Allow Connections" button (with its check mark and help button) disappears
- Use the back button to return to the password setup screen
- Expected: The layout is the same as before
- Actual: The "Next" button changes to "Create Account"
The unexpected layout changes happen because we re-check whether we're whitelisted.
If the fragment instances are retained across rotations, perhaps the password and doze fragments could remember the whitelisting state when they were first created, and use that to control the text of the password fragment's "Next" / "Create Account" button and the visibilty of DozeView, so that they stay the same after we're whitelisted, while using the current whitelisting state to show/hide the "Allow Connections" button's check mark and enable/disable the power management fragment's "Create Account" button, which are the bits that are supposed to change when we're whitelisted.