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

Commit 29e2d306 authored by mpodolian's avatar mpodolian
Browse files

Moved broadcast receiver blocking call to the background thread.

According to documentation :

Executes the given runnable. If the caller is running on the same looper
as this executor, the runnable must be executed immediately.

The caller was a UI thread, so the method was executed blocking the main
thread.

Introduced change that force-post the runnable to be executed later.

Fixes: 441416105
Flag: EXEMPT bugfix
Test: TreeHugger
Add log after changed line to check that broadcast execution completes
before collapseStack() is invoked in the main thread.

Change-Id: I6f4f292cd8e6a880721b31fcf8e11fb8d3546765
parent 07d74c4c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1245,7 +1245,8 @@ public class BubbleController implements ConfigurationChangeListener,
                // if we're converting the bubble to a different mode, don't collapse since we want
                // the bubble to stay expanded.
                if (!isSelectedBubbleConvertingMode()) {
                    mMainExecutor.execute(() -> collapseStack());
                    // force-post the runnable, so broadcast receiver completes faster
                    mMainExecutor.executeDelayed(() -> collapseStack(), 0);
                }
            }
        }