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

Commit 8a63b09f authored by Michal Karpinski's avatar Michal Karpinski
Browse files

Create a new reference of r.curApp to post for the delayed job

We were nulling out this field later, resulting in
the token not being removed.

Bug: 129255292
Test: manual
Change-Id: I365b34ead153ab1f5f96ac71387535b44dad6c4d
parent 9db25fcf
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -460,10 +460,9 @@ public final class BroadcastQueue {
                // that request - we don't want the token to be swept from under our feet...
                mHandler.removeCallbacksAndMessages(msgToken);
                // ...then schedule the removal of the token after the extended timeout
                final ProcessRecord app = r.curApp;
                mHandler.postAtTime(() -> {
                    if (r.curApp != null) {
                        r.curApp.removeAllowBackgroundActivityStartsToken(r);
                    }
                    app.removeAllowBackgroundActivityStartsToken(r);
                }, msgToken, (r.receiverTime + mConstants.ALLOW_BG_ACTIVITY_START_TIMEOUT));
            }
        }