Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 44bfdd88 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Dialog not dismissed when tearing down dialog fragment.

1. The dismiss implementaton in Dialog was posting a message
   on the main thread to perform the real dismiss work. The
   goal of this was to allow calling dismiss() from multiple
   threads. The side effect of this is that when dialog fragment
   is dismissed the dialog is not dimissed until the current
   loop on the main thread is completed. However, during rotation
   of the screen the current activity has to be restarted, hence
   all fragments whould be removed. In the destruction process
   the dialog grament requests from the dialog to dismiss but
   since this is asynchromous, the code in
   ActivityThread#handleDestroyActivity detects a leaking window
   since the dialog window is still not removed and removes that
   window. Now when the dialog removal message is processed on
   the next loop we get an exception that the window has already
   been removed. Now if Dialog#dismiss() is called from the
   main thread the call goes right though otherwise a message is
   posted.

bug:5911682

Change-Id: I449d6dd75a84c0ff29ea13dac7d163219cc38341
parent 3fd4a382
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment