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

Commit 4d19b03f authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Fix Gmail undo state.

We forced all notifications to have an expanded
state, but the Gmail undo notification is totally
broken in that case.  This check exempts an obviosuly
bad expanded state from having to exist, fixing
Gmail's undo flow in the process.

Fixes: 173774694
Bug: 163626038
Bug: 173550917
Test: manual
Change-Id: I8973907ceb06ccf06c0a685fc0f2a2d283794fe5
parent 2b95ad43
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -5520,7 +5520,7 @@ public class Notification implements Parcelable
                result = mStyle.makeBigContentView();
                hideLine1Text(result);
            }
            if (result == null) {
            if (result == null && bigContentViewRequired()) {
                result = applyStandardTemplateWithActions(getBigBaseLayoutResource(),
                        StandardTemplateParams.VIEW_TYPE_BIG, null /* result */);
            }
@@ -5528,6 +5528,16 @@ public class Notification implements Parcelable
            return result;
        }

        private boolean bigContentViewRequired() {
            // If the big content view has no content, we can exempt the app from having to show it.
            // TODO(b/173550917): add an UNDO style then force this requirement on apps targeting S
            boolean exempt = mN.contentView != null && mN.bigContentView == null
                    && mStyle == null && mActions.size() == 0
                    && mN.extras.getCharSequence(EXTRA_TITLE) == null
                    && mN.extras.getCharSequence(EXTRA_TEXT) == null;
            return !exempt;
        }

        /**
         * Construct a RemoteViews for the final notification header only. This will not be
         * colorized.