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

Commit a232661f authored by Yunfan Chen's avatar Yunfan Chen Committed by Android (Google) Code Review
Browse files

Merge "Hook up TaskDescription into set bar color calls (6/N)"

parents 0ad8fe3b 91b3a1bd
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -3930,6 +3930,26 @@ public class Activity extends ContextThemeWrapper
        ActivityTaskManager.getService().toggleFreeformWindowingMode(mToken);
    }

    /**
     * Update the forced status bar color.
     * @hide
     */
    @Override
    public void updateStatusBarColor(int color) {
        mTaskDescription.setStatusBarColor(color);
        setTaskDescription(mTaskDescription);
    }

    /**
     * Update the forced navigation bar color.
     * @hide
     */
    @Override
    public void updateNavigationBarColor(int color) {
        mTaskDescription.setNavigationBarColor(color);
        setTaskDescription(mTaskDescription);
    }

    /**
     * Puts the activity in picture-in-picture mode if the activity supports.
     * @see android.R.attr#supportsPictureInPicture
+10 −0
Original line number Diff line number Diff line
@@ -636,6 +636,16 @@ public abstract class Window {

        /** Returns whether the window belongs to the task root. */
        boolean isTaskRoot();

        /**
         * Update the status bar color to a forced one.
         */
        void updateStatusBarColor(int color);

        /**
         * Update the navigation bar color to a forced one.
         */
        void updateNavigationBarColor(int color);
    }

    /**
+8 −0
Original line number Diff line number Diff line
@@ -3829,6 +3829,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        if (mDecor != null) {
            mDecor.updateColorViews(null, false /* animate */);
        }
        final WindowControllerCallback callback = getWindowControllerCallback();
        if (callback != null) {
            getWindowControllerCallback().updateStatusBarColor(color);
        }
    }

    @Override
@@ -3843,6 +3847,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        if (mDecor != null) {
            mDecor.updateColorViews(null, false /* animate */);
        }
        final WindowControllerCallback callback = getWindowControllerCallback();
        if (callback != null) {
            getWindowControllerCallback().updateNavigationBarColor(color);
        }
    }

    @Override