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

Commit 8bc1a141 authored by Jason Chiu's avatar Jason Chiu
Browse files

[Safer intents] Notifications

To avoid implicit intents, make intents launch explicitly.

Test: build
Bug: 323061508
Change-Id: I68624ca7c913c473490f371409ae35acbb4f6fb2
parent 37f992ae
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ public class BubbleCategoryPreferenceController extends NotificationPreferenceCo

        if (mAppRow != null) {
            final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS);
            intent.setPackage(mContext.getPackageName());
            intent.putExtra(Settings.EXTRA_APP_PACKAGE, mAppRow.pkg);
            intent.putExtra(Settings.EXTRA_APP_UID, mAppRow.uid);
            preference.setIntent(intent);
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ public class BubbleLinkPreferenceController extends NotificationPreferenceContro

        if (mAppRow != null) {
            final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS);
            intent.setPackage(mContext.getPackageName());
            intent.putExtra(Settings.EXTRA_APP_PACKAGE, mAppRow.pkg);
            intent.putExtra(Settings.EXTRA_APP_UID, mAppRow.uid);
            preference.setIntent(intent);
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ public class BubbleSummaryPreferenceController extends NotificationPreferenceCon

        if (mAppRow != null) {
            final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS);
            intent.setPackage(mContext.getPackageName());
            intent.putExtra(Settings.EXTRA_APP_PACKAGE, mAppRow.pkg);
            intent.putExtra(Settings.EXTRA_APP_UID, mAppRow.uid);
            preference.setIntent(intent);
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import androidx.recyclerview.widget.RecyclerView;

import com.android.internal.logging.UiEventLogger;
import com.android.settings.R;
import com.android.settings.Utils;

import java.util.ArrayList;
import java.util.List;
@@ -87,6 +88,7 @@ public class NotificationHistoryAdapter extends
            mUiEventLogger.logWithPosition(NotificationHistoryActivity.NotificationHistoryEvent
                    .NOTIFICATION_HISTORY_OLDER_ITEM_CLICK, hn.getUid(), hn.getPackage(), position);
            Intent intent =  new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
                    .setPackage(Utils.SETTINGS_PACKAGE_NAME)
                    .putExtra(EXTRA_APP_PACKAGE, hn.getPackage())
                    .putExtra(EXTRA_CHANNEL_ID, hn.getChannelId())
                    .putExtra(EXTRA_CONVERSATION_ID, hn.getConversationId());
+1 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ public class NotificationSbnAdapter extends
                    mUiEventLogger);
            holder.itemView.setOnLongClickListener(v -> {
                Intent intent =  new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
                        .setPackage(mContext.getPackageName())
                        .putExtra(EXTRA_APP_PACKAGE, sbn.getPackageName())
                        .putExtra(EXTRA_CHANNEL_ID, sbn.getNotification().getChannelId())
                        .putExtra(EXTRA_CONVERSATION_ID, sbn.getNotification().getShortcutId());
Loading