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

Commit 64714a02 authored by Andrey Epin's avatar Andrey Epin
Browse files

Ignore onPostListReady call if the activity has been destroyed

ResolverActivity#onPostListReady is called asynchronously on the main
thread and it is possible for it to be executed after activity’s
onDestroy call.
A check for activity’s status is added to the method.

Test: atest FrameworksCoreTests:ChooserActivityTest
Fix: 254787909
Change-Id: I96d98a03d86881845868a67e33ea8ee7c9dc6631
parent c1fee021
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1098,6 +1098,9 @@ public class ResolverActivity extends Activity implements
    @Override // ResolverListCommunicator
    public final void onPostListReady(ResolverListAdapter listAdapter, boolean doPostProcessing,
            boolean rebuildCompleted) {
        if (isDestroyed()) {
            return;
        }
        if (isAutolaunching()) {
            return;
        }