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

Commit 624c02db authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed the public notifications views on the lockscreen

The views were based on a legacy systemUI notification.
We are now creating it in Notification.java in order to
always have the latest visuals and avoiding duplicate work.

Change-Id: I3f544cad069a8eab34d4464404d020e06d7f6626
parent a69f2a64
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -3312,6 +3312,37 @@ public class Notification implements Parcelable
            return applyStandardTemplateWithActions(getBigBaseLayoutResource());
        }

        /**
         * Construct a RemoteViews for the display in public contexts like on the lockscreen.
         *
         * @hide
         */
        public RemoteViews makePublicContentView() {
            if (mN.publicVersion != null) {
                final Builder builder = recoverBuilder(mContext, mN.publicVersion);
                return builder.makeContentView();
            }
            Bundle savedBundle = mN.extras;
            Style style = mStyle;
            mStyle = null;
            Icon largeIcon = mN.mLargeIcon;
            mN.mLargeIcon = null;
            Bundle publicExtras = new Bundle();
            publicExtras.putBoolean(EXTRA_SHOW_WHEN,
                    savedBundle.getBoolean(EXTRA_SHOW_WHEN));
            publicExtras.putBoolean(EXTRA_SHOW_CHRONOMETER,
                    savedBundle.getBoolean(EXTRA_SHOW_CHRONOMETER));
            publicExtras.putCharSequence(EXTRA_TITLE,
                    mContext.getString(R.string.notification_hidden_text));
            mN.extras = publicExtras;
            final RemoteViews publicView = applyStandardTemplate(getBaseLayoutResource());
            mN.extras = savedBundle;
            mN.mLargeIcon = largeIcon;
            mStyle = style;
            return publicView;
        }



        private RemoteViews generateActionButton(Action action) {
            final boolean tombstone = (action.actionIntent == null);
+3 −0
Original line number Diff line number Diff line
@@ -537,6 +537,9 @@
    <!-- The divider symbol between different parts of the notification header. not translatable [CHAR LIMIT=1] -->
    <string name="notification_header_divider_symbol" translatable="false"></string>

    <!-- Text shown in place of notification contents when the notification is hidden on a secure lockscreen -->
    <string name="notification_hidden_text">Contents hidden</string>

    <!-- Displayed to the user to tell them that they have started up the phone in "safe mode" -->
    <string name="safeMode">Safe mode</string>

+1 −0
Original line number Diff line number Diff line
@@ -2362,6 +2362,7 @@
  <java-symbol type="id" name="deleteButton" />

  <java-symbol type="string" name="notification_children_count_bracketed" />
  <java-symbol type="string" name="notification_hidden_text" />
  <java-symbol type="id" name="app_name_text" />
  <java-symbol type="id" name="number_of_children" />
  <java-symbol type="id" name="header_sub_text" />
+0 −3
Original line number Diff line number Diff line
@@ -906,9 +906,6 @@
    <!-- Battery saver notification action text. [CHAR LIMIT=60] -->
    <string name="battery_saver_notification_action_text">Turn off battery saver</string>

    <!-- Text shown in place of notification contents when the notification is hidden on a secure lockscreen -->
    <string name="notification_hidden_text">Contents hidden</string>

    <!-- Media projection permission dialog warning text. [CHAR LIMIT=NONE] -->
    <string name="media_projection_dialog_text"><xliff:g id="app_seeking_permission" example="Hangouts">%s</xliff:g> will start capturing everything that\'s displayed on your screen.</string>

+0 −6
Original line number Diff line number Diff line
@@ -237,12 +237,6 @@
        <item name="android:gravity">center</item>
    </style>

    <style name="TextAppearance.Material.Notification.Parenthetical"
           parent="@*android:style/TextAppearance.Material.Notification">
        <item name="android:textStyle">italic</item>
        <item name="android:textColor">#60000000</item>
    </style>

    <style name="TextAppearance.Material.Notification.HeaderTitle"
        parent="@*android:style/TextAppearance.Material.Notification.Info">
    </style>
Loading