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

Commit e61758ad authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Track sent conversations better

Include all notifications that appear in the conversation
space, not just messaging style ones

And then I decided to fix a user vs uid issue in the tests
which means many of them have been touched

Test: atest
Fixes: 158610806
Change-Id: I0bb3f0415845b44ae3e3f9d7b2af836be00ceb24
parent ab0ffd1d
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2048,12 +2048,15 @@ public class NotificationManagerService extends SystemService {
        mStripRemoteViewsSizeBytes = getContext().getResources().getInteger(
                com.android.internal.R.integer.config_notificationStripRemoteViewSizeBytes);

        mMsgPkgsAllowedAsConvos = Set.of(
                getContext().getResources().getStringArray(
        mMsgPkgsAllowedAsConvos = Set.of(getStringArrayResource(
                com.android.internal.R.array.config_notificationMsgPkgsAllowedAsConvos));
        mStatsManager = statsManager;
    }

    protected String[] getStringArrayResource(int key) {
        return getContext().getResources().getStringArray(key);
    }

    @Override
    public void onStart() {
        SnoozeHelper snoozeHelper = new SnoozeHelper(getContext(), (userId, r, muteOnReturn) -> {
@@ -2741,10 +2744,7 @@ public class NotificationManagerService extends SystemService {
    }

    protected void maybeRegisterMessageSent(NotificationRecord r) {
        Context appContext = r.getSbn().getPackageContext(getContext());
        Notification.Builder nb =
                Notification.Builder.recoverBuilder(appContext, r.getNotification());
        if (nb.getStyle() instanceof Notification.MessagingStyle) {
        if (r.isConversation()) {
            if (r.getShortcutInfo() != null) {
                if (mPreferencesHelper.setValidMessageSent(
                        r.getSbn().getPackageName(), r.getUid())) {
+138 −84

File changed.

Preview size limit exceeded, changes collapsed.