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

Commit 56a64389 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Make DecoratedCustomViewStyle notifications consistent.

Until now, we showed the collapsed state of DecoratedCustomViewStyle in two different ways depending on the target of the app.  In particular, we forced an awkward top line of views above the custom view for apps that didn't target S to ensure the context of the "subtext" was not lost from those notifications.  However, that context is available on expansion, and we think it's better if all apps get the same, more visually consistent behavior, regardless of the targeted SDK. 

Bug: 163626038
Change-Id: Ie50320566a97c8c05148857a6c4283a8870a833d
Test: manual
parent 36df85a2
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -9050,22 +9050,9 @@ public class Notification implements Parcelable
            return remoteViews;
        }

        // This code is executed on behalf of other apps' notifications, sometimes even by 3p apps,
        // a use case that is not supported by the Compat Framework library.  Workarounds to resolve
        // the change's state in NotificationManagerService were very complex. While it's possible
        // apps can detect the change, it's most likely that the changes will simply result in
        // visual regressions.
        @SuppressWarnings("AndroidFrameworkCompatChange")
        private int getDecorationType() {
            ContentResolver contentResolver = mBuilder.mContext.getContentResolver();
            if (mBuilder.mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.S
                    || DevFlags.shouldBackportSNotifRules(contentResolver)) {
            return DevFlags.getDecoratedCustomViewNotifDecoration(contentResolver);
            } else {
                // For apps that don't target S, this decoration provides the closest behavior to R,
                // but doesn't fit with the design guidelines for S.
                return DevFlags.DECORATION_FULL_COMPATIBLE;
            }
        }

        /**