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

Commit 35fe985a authored by Rohan Shah's avatar Rohan Shah
Browse files

Revert "[Notif] Disable "Customize" for blocking helper"

This reverts commit 3cfc9507.

Reason for revert:
Apparently a breakage got through treehugger - I hadn't synced my changes and one of the params was incorrect. Reverting for now and rebasing before resubmit...

Bug: 77321231
Change-Id: Ib306759d6344a69f17331a6c3c9cc78d1345508b
parent 3cfc9507
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -326,15 +326,15 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
            minimize.setVisibility(GONE);
        }

        // Set up app settings link (i.e. Customize)
        // Set up app settings link
        TextView settingsLinkView = findViewById(R.id.app_settings);
        Intent settingsIntent = getAppSettingsIntent(mPm, mPkg, mSingleNotificationChannel,
                mSbn.getId(), mSbn.getTag());
        if (!mIsForBlockingHelper
                && settingsIntent != null
        if (settingsIntent != null
                && !TextUtils.isEmpty(mSbn.getNotification().getSettingsText())) {
            settingsLinkView.setVisibility(VISIBLE);
            settingsLinkView.setText(mContext.getString(R.string.notification_app_settings));
            settingsLinkView.setText(mContext.getString(R.string.notification_app_settings,
                    mSbn.getNotification().getSettingsText()));
            settingsLinkView.setOnClickListener((View view) -> {
                mAppSettingsClickListener.onClick(view, settingsIntent);
            });
+0 −23
Original line number Diff line number Diff line
@@ -699,29 +699,6 @@ public class NotificationInfoTest extends SysuiTestCase {
        assertEquals(GONE, settingsLink.getVisibility());
    }

    @Test
    public void testBindHeader_noSettingsLinkWhenIsForBlockingHelper() throws Exception {
        final String settingsText = "work chats";
        final ResolveInfo ri = new ResolveInfo();
        ri.activityInfo = new ActivityInfo();
        ri.activityInfo.packageName = TEST_PACKAGE_NAME;
        ri.activityInfo.name = "something";
        List<ResolveInfo> ris = new ArrayList<>();
        ris.add(ri);
        when(mMockPackageManager.queryIntentActivities(any(), anyInt())).thenReturn(ris);
        mNotificationChannel.setImportance(IMPORTANCE_LOW);
        Notification n = new Notification.Builder(mContext, mNotificationChannel.getId())
                .setSettingsText(settingsText).build();
        StatusBarNotification sbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME,
                0, null, 0, 0, n, UserHandle.CURRENT, null, 0);

        mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
                TEST_PACKAGE_NAME, mNotificationChannel, 1, sbn, null, null, null, null, true,
                true);
        final TextView settingsLink = mNotificationInfo.findViewById(R.id.app_settings);
        assertEquals(GONE, settingsLink.getVisibility());
    }


    @Test
    public void testWillBeRemovedReturnsFalseBeforeBind() throws Exception {