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

Commit b9e8dcdc authored by Nicolò Mazzucato's avatar Nicolò Mazzucato Committed by Android (Google) Code Review
Browse files

Merge changes I469ab15e,I02ba5884 into main

* changes:
  Wider notifications on landscape lockscreen
  is_small_screen_landscape resource
parents 7f9d72ca bdf9641f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19,4 +19,7 @@
    <!-- Only use small clock on lockscreen.
     True here because only small clock used on small devices in landscape -->
    <bool name="force_small_clock_on_lockscreen">true</bool>

    <!--  True when small screen (<sw600dp) is landscape. -->
    <bool name="is_small_screen_landscape">true</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -19,4 +19,7 @@
    <!-- Only use small clock on lockscreen.
     False here because large clock is allowed on large devices in landscape -->
    <bool name="force_small_clock_on_lockscreen">false</bool>

    <!--  True when small screen (<sw600dp) is landscape. -->
    <bool name="is_small_screen_landscape">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -63,4 +63,7 @@
    <!-- Only use small clock on lockscreen.
     False here because large clock used by default, unless otherwise specified -->
    <bool name="force_small_clock_on_lockscreen">false</bool>

    <!--  True when small screen (<sw600dp) is landscape. -->
    <bool name="is_small_screen_landscape">false</bool>
</resources>
+14 −1
Original line number Diff line number Diff line
@@ -569,6 +569,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private boolean mShouldUseSplitNotificationShade;
    private boolean mHasFilteredOutSeenNotifications;
    @Nullable private SplitShadeStateController mSplitShadeStateController = null;
    private boolean mIsSmallLandscapeLockscreenEnabled = false;

    /** Pass splitShadeStateController to view and update split shade */
    public void passSplitShadeStateController(SplitShadeStateController splitShadeStateController) {
@@ -628,6 +629,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        super(context, attrs, 0, 0);
        Resources res = getResources();
        FeatureFlags featureFlags = Dependency.get(FeatureFlags.class);
        mIsSmallLandscapeLockscreenEnabled = featureFlags.isEnabled(
                Flags.LOCKSCREEN_ENABLE_LANDSCAPE);
        mDebugLines = featureFlags.isEnabled(Flags.NSSL_DEBUG_LINES);
        mDebugRemoveAnimation = featureFlags.isEnabled(Flags.NSSL_DEBUG_REMOVE_ANIMATION);
        mSensitiveRevealAnimEndabled = featureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM);
@@ -1054,6 +1057,17 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mOverflingDistance = configuration.getScaledOverflingDistance();

        Resources res = context.getResources();
        boolean useSmallLandscapeLockscreenResources = mIsSmallLandscapeLockscreenEnabled
                && res.getBoolean(R.bool.is_small_screen_landscape);
        // TODO (b/293252410) remove condition here when flag is launched
        //  Instead update the config_skinnyNotifsInLandscape to be false whenever
        //  is_small_screen_landscape is true. Then, only use the config_skinnyNotifsInLandscape.
        if (useSmallLandscapeLockscreenResources) {
            mSkinnyNotifsInLandscape = false;
        } else {
            mSkinnyNotifsInLandscape = res.getBoolean(
                    R.bool.config_skinnyNotifsInLandscape);
        }
        mGapHeight = res.getDimensionPixelSize(R.dimen.notification_section_divider_height);
        mStackScrollAlgorithm.initView(context);
        mAmbientState.reload(context);
@@ -1065,7 +1079,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mBottomPadding = res.getDimensionPixelSize(R.dimen.notification_panel_padding_bottom);
        mMinimumPaddings = res.getDimensionPixelSize(R.dimen.notification_side_paddings);
        mQsTilePadding = res.getDimensionPixelOffset(R.dimen.qs_tile_margin_horizontal);
        mSkinnyNotifsInLandscape = res.getBoolean(R.bool.config_skinnyNotifsInLandscape);
        mSidePaddings = mMinimumPaddings;  // Updated in onMeasure by updateSidePadding()
        mMinInteractionHeight = res.getDimensionPixelSize(
                R.dimen.notification_min_interaction_height);
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        assertFalse(Flags.NSSL_DEBUG_REMOVE_ANIMATION.getDefault());
        mFeatureFlags.set(Flags.NSSL_DEBUG_LINES, false);
        mFeatureFlags.set(Flags.NSSL_DEBUG_REMOVE_ANIMATION, false);
        mFeatureFlags.set(Flags.LOCKSCREEN_ENABLE_LANDSCAPE, false);

        // Register the feature flags we use
        // TODO: Ideally we wouldn't need to set these unless a test actually reads them,