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

Commit 6fbd48df authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Android (Google) Code Review
Browse files

Merge changes from topics "footer-actions-fakes", "footer-actions-mad",...

Merge changes from topics "footer-actions-fakes", "footer-actions-mad", "footer-actions-screenshots" into tm-qpr-dev

* changes:
  Enable the new footer actions in team food.
  Add screenshot test for the footer actions (2/2)
  Implement LaunchableView for footer actions Views.
  Wire the new FooterActions implementation behind a flag
  Implementation of the FooterActions following the MAD (1/3)
  Add BroadcastDispatcher.broadcastFlow
  Extract QSSecurityFooterUtils out of QSSecurityFooter
  Make the logic of QSSecurityFooter reusable
  Add some fakes to SystemUI-test-utils
  Allow preventing unrestricted Apps from being Stopped
parents 9e6b8ad6 ba8fd9da
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -548,6 +548,12 @@ public final class SystemUiDeviceConfigFlags {
     */
     */
    public static final String TASK_MANAGER_SHOW_FOOTER_DOT = "task_manager_show_footer_dot";
    public static final String TASK_MANAGER_SHOW_FOOTER_DOT = "task_manager_show_footer_dot";


    /**
     * (boolean) Whether the task manager should show a stop button if the app is allowlisted
     * by the user.
     */
    public static final String TASK_MANAGER_SHOW_STOP_BUTTON_FOR_USER_ALLOWLISTED_APPS =
            "show_stop_button_for_user_allowlisted_apps";


    /**
    /**
     * (boolean) Whether the clipboard overlay is enabled.
     * (boolean) Whether the clipboard overlay is enabled.
+9 −1
Original line number Original line Diff line number Diff line
@@ -7,3 +7,11 @@ packages/SystemUI/src/com/android/systemui/keyguard/dagger
packages/SystemUI/src/com/android/systemui/keyguard/domain
packages/SystemUI/src/com/android/systemui/keyguard/domain
packages/SystemUI/src/com/android/systemui/keyguard/shared
packages/SystemUI/src/com/android/systemui/keyguard/shared
packages/SystemUI/src/com/android/systemui/keyguard/ui
packages/SystemUI/src/com/android/systemui/keyguard/ui
packages/SystemUI/src/com/android/systemui/qs/footer
packages/SystemUI/src/com/android/systemui/security
packages/SystemUI/src/com/android/systemui/common/
packages/SystemUI/tests/utils/src/com/android/systemui/qs/
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/FakeSecurityController.kt
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/FakeUserInfoController.kt
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/MockUserSwitcherControllerWrapper.kt
packages/SystemUI/tests/src/com/android/systemui/qs/footer/
 No newline at end of file
+1 −0
Original line number Original line Diff line number Diff line
@@ -230,6 +230,7 @@ android_library {
    libs: [
    libs: [
        "android.test.runner",
        "android.test.runner",
        "android.test.base",
        "android.test.base",
        "android.test.mock",
    ],
    ],
    kotlincflags: ["-Xjvm-default=enable"],
    kotlincflags: ["-Xjvm-default=enable"],
    aaptflags: [
    aaptflags: [
+1 −2
Original line number Original line Diff line number Diff line
@@ -311,8 +311,7 @@ class ActivityLaunchAnimator(
            @JvmStatic
            @JvmStatic
            fun fromView(view: View, cujType: Int? = null): Controller? {
            fun fromView(view: View, cujType: Int? = null): Controller? {
                if (view.parent !is ViewGroup) {
                if (view.parent !is ViewGroup) {
                    // TODO(b/192194319): Throw instead of just logging.
                    Log.e(
                    Log.wtf(
                        TAG,
                        TAG,
                        "Skipping animation as view $view is not attached to a ViewGroup",
                        "Skipping animation as view $view is not attached to a ViewGroup",
                        Exception()
                        Exception()
+27 −8
Original line number Original line Diff line number Diff line
@@ -113,6 +113,19 @@ constructor(
            }
            }
        val animateFrom = animatedParent?.dialogContentWithBackground ?: view
        val animateFrom = animatedParent?.dialogContentWithBackground ?: view


        if (animatedParent == null && animateFrom !is LaunchableView) {
            // Make sure the View we launch from implements LaunchableView to avoid visibility
            // issues. Given that we don't own dialog decorViews so we can't enforce it for launches
            // from a dialog.
            // TODO(b/243636422): Throw instead of logging to enforce this.
            Log.w(
                TAG,
                "A dialog was launched from a View that does not implement LaunchableView. This " +
                    "can lead to subtle bugs where the visibility of the View we are " +
                    "launching from is not what we expected."
            )
        }

        // Make sure we don't run the launch animation from the same view twice at the same time.
        // Make sure we don't run the launch animation from the same view twice at the same time.
        if (animateFrom.getTag(TAG_LAUNCH_ANIMATION_RUNNING) != null) {
        if (animateFrom.getTag(TAG_LAUNCH_ANIMATION_RUNNING) != null) {
            Log.e(TAG, "Not running dialog launch animation as there is already one running")
            Log.e(TAG, "Not running dialog launch animation as there is already one running")
@@ -156,9 +169,14 @@ constructor(
            openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground
            openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground
                ?: throw IllegalStateException(
                ?: throw IllegalStateException(
                    "The animateFrom dialog was not animated using " +
                    "The animateFrom dialog was not animated using " +
                        "DialogLaunchAnimator.showFrom(View|Dialog)")
                        "DialogLaunchAnimator.showFrom(View|Dialog)"
                )
        showFromView(
        showFromView(
            dialog, view, animateBackgroundBoundsChange = animateBackgroundBoundsChange, cuj = cuj)
            dialog,
            view,
            animateBackgroundBoundsChange = animateBackgroundBoundsChange,
            cuj = cuj
        )
    }
    }


    /**
    /**
@@ -556,7 +574,8 @@ private class AnimatedDialog(
        window.setDecorFitsSystemWindows(false)
        window.setDecorFitsSystemWindows(false)
        val viewWithInsets = (dialogContentWithBackground.parent as ViewGroup)
        val viewWithInsets = (dialogContentWithBackground.parent as ViewGroup)
        viewWithInsets.setOnApplyWindowInsetsListener { view, windowInsets ->
        viewWithInsets.setOnApplyWindowInsetsListener { view, windowInsets ->
            val type = if (wasFittingNavigationBars) {
            val type =
                if (wasFittingNavigationBars) {
                    WindowInsets.Type.displayCutout() or WindowInsets.Type.navigationBars()
                    WindowInsets.Type.displayCutout() or WindowInsets.Type.navigationBars()
                } else {
                } else {
                    WindowInsets.Type.displayCutout()
                    WindowInsets.Type.displayCutout()
Loading