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

Commit 7f05a696 authored by Christoph Studer's avatar Christoph Studer Committed by Android (Google) Code Review
Browse files

Merge "SysUI: Uprank current media notification" into lmp-dev

parents f196e3fe 2e731b5d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -518,6 +518,11 @@ public abstract class BaseStatusBar extends SystemUI implements
        }
    }

    @Override
    public String getCurrentMediaNotificationKey() {
        return null;
    }

    /**
     * Takes the necessary steps to prepare the status bar for starting an activity, then starts it.
     * @param action A dismiss action that is called if it's safe to start the activity.
+11 −0
Original line number Diff line number Diff line
@@ -98,6 +98,16 @@ public class NotificationData {

        @Override
        public int compare(Entry a, Entry b) {
            String mediaNotification = mEnvironment.getCurrentMediaNotificationKey();

            // Upsort current media notification.
            boolean aMedia = a.key.equals(mediaNotification);
            boolean bMedia = b.key.equals(mediaNotification);
            if (aMedia != bMedia) {
                return aMedia ? -1 : 1;
            }

            // RankingMap as received from NoMan.
            if (mRankingMap != null) {
                mRankingMap.getRanking(a.key, mRankingA);
                mRankingMap.getRanking(b.key, mRankingB);
@@ -291,5 +301,6 @@ public class NotificationData {
        public boolean shouldHideSensitiveContents(int userId);
        public boolean isDeviceProvisioned();
        public boolean isNotificationForCurrentProfiles(StatusBarNotification sbn);
        public String getCurrentMediaNotificationKey();
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -2053,6 +2053,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        return mNotificationPanel.isQsExpanded();
    }

    @Override  // NotificationData.Environment
    public String getCurrentMediaNotificationKey() {
        return mMediaNotificationKey;
    }

    /**
     * All changes to the status bar and notifications funnel through here and are batched.
     */