Dismiss error popup safely

Normally, the resident alerting error dialog will be destroyed
along with Activity destroyed after the flag isVisble becomes false
by onStop even error dialog is popped up multiple times, but in
some situations, finishing the activity before onStop won't be
allowed, which will result in reusing the previous Activity instance.
As the dismiss action is pending into the main looper, the new error
alerting dialog instance will be assigned to null by responding the
action on the method onDialogDismissed later, which makes the error
dialog remain still without the possibility of dismissing.

To fix it, the method onDialogDismissed can't make the instance of
the error dialog null.

Change-Id: I252bb85c04b41669f8b69c498ec9dcaea8973bd4
CRs-Fixed: 3249656
1 file changed