Clear mDialogFragment when it's detached
and re-associate it when it's re-created.
Before this CL, the association is gone when fragment goes through the pause-resume
cycle.
Similarly, restore onDismiss and onCancel listeners in VpnSettings.onCreateDialog(),
restore states in onCreate() instead of onActivityCreated() so that screen rotation
can be handled correctly.
Now that profiles are shared between Settings instances, always handle state change
in VpnSettings.changeState() so that state changed in one instance can be conveyed
to the other and preferences can be correctly enabled/disabled.
In additions, fix some trivial mistakes in VpnSettings.
Bug: 3396394
Change-Id: I242e1ed6c6d410b4dfefb373d8f98266fc9b46d0
3 files changed