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

Commit 15900d8a authored by shawnlin's avatar shawnlin
Browse files

Add a new method to notify system to detach the nav bar

For the attaching the nav bar to the app during quick switch, we
reparent the leash of the nav bar to the app the user swipes from and
restore it back when the quick switch gesture is finished.

There is a callback IRecentsAnimationController.finish() which seems to
be a good timing to restore the nav bar. However, it doesn't work well
in the live tile mode.

In the live tile mode, the overview won't call
IRecentsAnimationController.finish() until a new task is started and
this is why we need to add this API.

Bug: 139273001
Test: make
Change-Id: Iabea2fb222a2dacd57207b74d1778f93237268ea
parent 0d4064bd
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -136,4 +136,13 @@ interface IRecentsAnimationController {
     * @return {@code true} when target removed successfully, {@code false} otherwise.
     */
    boolean removeTask(int taskId);

    /**
     * Detach navigation bar from app.
     *
     * The system reparents the leash of navigation bar to the app when the recents animation starts
     * and Launcher should call this method to let system restore the navigation bar to its
     * original position when the quick switch gesture is finished.
     */
    void detachNavigationBarFromApp();
}
+11 −0
Original line number Diff line number Diff line
@@ -137,4 +137,15 @@ public class RecentsAnimationControllerCompat {
            return false;
        }
    }

    /**
     * @see IRecentsAnimationController#detachNavigationBarFromApp
     */
    public void detachNavigationBarFromApp() {
        try {
            mAnimationController.detachNavigationBarFromApp();
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to detach the navigation bar from app", e);
        }
    }
}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -364,6 +364,9 @@ public class RecentsAnimationController implements DeathRecipient {
                Binder.restoreCallingIdentity(token);
            }
        }

        @Override
        public void detachNavigationBarFromApp() {}
    };

    /**