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

Commit ec821bed authored by Chilun's avatar Chilun
Browse files

Skip transfer splash screen if activity is destroying or destroyed

Sometimes an activity may be destroyed prematurely before the splash
screen animation begins. We can skip transferring the SplashScreenView
to client if the activity is finishing.

Also add more logs for future investigation.

Bug: 221436171
Bug: 170134300
Test: SplashscreenParametrizedTest
      atest ActivityRecordTests SplashscreenTests
Change-Id: I0b5cdbc3d7ff14ad71139c3c5282a0554c40ea1e
parent de4a9a6a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -64,11 +64,11 @@ public abstract class ActivityTransactionItem extends ClientTransactionItem {
        final ActivityClientRecord r = client.getActivityClient(token);
        if (r == null) {
            throw new IllegalArgumentException("Activity client record must not be null to execute "
                    + "transaction item");
                    + "transaction item: " + this);
        }
        if (client.getActivity(token) == null) {
            throw new IllegalArgumentException("Activity must not be null to execute "
                    + "transaction item");
                    + "transaction item: " + this);
        }
        return r;
    }
+2 −1
Original line number Diff line number Diff line
@@ -2452,7 +2452,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // either way, abort and reset the sequence.
        if (parcelable == null
                || mTransferringSplashScreenState != TRANSFER_SPLASH_SCREEN_COPYING
                || mStartingWindow == null) {
                || mStartingWindow == null
                || finishing) {
            if (parcelable != null) {
                parcelable.clearIfNeeded();
            }