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

Commit 9a72bca4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Bug fix in OriginTransitionSession." into main

parents 99369100 ed3db6d4
Loading
Loading
Loading
Loading
+29 −14
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ public class OriginTransitionSession {
            throw new IllegalArgumentException(
                    "Entry transition must be supplied if you want to play an exit transition!");
        }

    }

    /**
@@ -97,8 +96,6 @@ public class OriginTransitionSession {
            return false;
        }

        setupTransactionQueues();

        RemoteTransition remoteTransition = null;
        if (hasEntryTransition() && hasExitTransition()) {
            logD("start: starting with entry and exit transition.");
@@ -108,25 +105,43 @@ public class OriginTransitionSession {
                                mOriginTransitions.makeOriginTransition(
                                        new RemoteTransition(mEntryTransition, mName + "-entry"),
                                        new RemoteTransition(mExitTransition, mName + "-exit"));
            } catch (RemoteException e) {
            } catch (Exception e) {
                logE("Unable to create origin transition!", e);
            }
        } else if (hasEntryTransition()) {
        }
        if (remoteTransition == null && hasEntryTransition()) {
            // If we failed to create a full origin transition (entry + exit), fallback to use the
            // entry transition only.
            logD("start: starting with entry transition.");
            remoteTransition = new RemoteTransition(mEntryTransition, mName + "-entry");
        }

        } else {
        if (remoteTransition == null) {
            // If both entry and exit transitions are not provided, we will fallback to start the
            // activity without transition.
            logD("start: starting without transition.");
        }

        try {
            if (mIntentStarter.test(remoteTransition)) {
                logD("start: intent launched!");
                if (remoteTransition != null) {
                    // If the intent is successfully launched with a remote transition, setup the
                    // transaction queues for the entry and exit transitions.
                    setupTransactionQueues();
                }
                return true;
            } else {
                // Animation is cancelled by intent starter.
                logD("start: cancelled by intent starter!");
            }
        } catch (Exception e) {
            logE("Unable to launch intent!", e);
        }
        // Cancel the session since the intent was not launched.
        cancel();
        return false;
    }
    }

    /**
     * Cancel the current transition and the registered exit transition if it exists. After this
@@ -167,7 +182,7 @@ public class OriginTransitionSession {
        final IBinder shellApplyToken;
        try {
            shellApplyToken = mOriginTransitions.getDefaultTransactionApplyToken();
        } catch (RemoteException e) {
        } catch (Exception e) {
            Log.e(TAG, "Error getting server side (shell) apply token", e);
            return;
        }