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

Commit 08d66893 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by android-build-merger
Browse files

Immediately deliver new intent to paused activities.

am: 03f7e9e9

Change-Id: I962edc54a173b204a5b24fb3d1871500852d35c2
parents 157b98c1 03f7e9e9
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -954,22 +954,18 @@ final class ActivityRecord {
                stack != null && stack.topRunningActivityLocked() == this;
                stack != null && stack.topRunningActivityLocked() == this;
        final boolean isTopActivityWhileSleeping =
        final boolean isTopActivityWhileSleeping =
                service.isSleepingLocked() && isTopActivityInStack;
                service.isSleepingLocked() && isTopActivityInStack;
        final boolean isTopActivityInMinimizedDockedStack = isTopActivityInStack
                && stack.mStackId == DOCKED_STACK_ID && mStackSupervisor.mIsDockMinimized
                && state == ActivityState.PAUSED;


        // We want to immediately deliver the intent to the activity if:
        // We want to immediately deliver the intent to the activity if:
        // - It is the resumed activity.
        // - It is currently resumed or paused. i.e. it is currently visible to the user and we want
        //   the user to see the visual effects caused by the intent delivery now.
        // - The device is sleeping and it is the top activity behind the lock screen (b/6700897).
        // - The device is sleeping and it is the top activity behind the lock screen (b/6700897).
        // - It is the top activity in a minimized docked stack. In this case the activity will be
        if ((state == ActivityState.RESUMED || state == ActivityState.PAUSED
        //   temporarily resumed then paused again on the client side.
                || isTopActivityWhileSleeping) && app != null && app.thread != null) {
        if ((state == ActivityState.RESUMED || isTopActivityWhileSleeping
                || isTopActivityInMinimizedDockedStack) && app != null && app.thread != null) {
            try {
            try {
                ArrayList<ReferrerIntent> ar = new ArrayList<>(1);
                ArrayList<ReferrerIntent> ar = new ArrayList<>(1);
                ar.add(rintent);
                ar.add(rintent);
                app.thread.scheduleNewIntent(
                app.thread.scheduleNewIntent(
                        ar, appToken, isTopActivityInMinimizedDockedStack /* andPause */);
                        ar, appToken, state == ActivityState.PAUSED /* andPause */);
                unsent = false;
                unsent = false;
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Slog.w(TAG, "Exception thrown sending new intent to " + this, e);
                Slog.w(TAG, "Exception thrown sending new intent to " + this, e);