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

Commit b37d5d47 authored by Raphael Kim's avatar Raphael Kim Committed by Automerger Merge Worker
Browse files

Remove package title from notification access confirmation intent am:...

Remove package title from notification access confirmation intent am: 51d47ec7 am: c1b4cacc am: 963c9f8b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18670434



Change-Id: I7b76141852d2314dd8a37d4a4ceb50f169dd8640
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents aa456df7 963c9f8b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.notification;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;

public final class NotificationAccessConfirmationActivityContract {
@@ -25,13 +26,14 @@ public final class NotificationAccessConfirmationActivityContract {
            "com.android.settings.notification.NotificationAccessConfirmationActivity");
    public static final String EXTRA_USER_ID = "user_id";
    public static final String EXTRA_COMPONENT_NAME = "component_name";
    public static final String EXTRA_PACKAGE_TITLE = "package_title";

    public static Intent launcherIntent(int userId, ComponentName component, String packageTitle) {
    /**
     * Creates a launcher intent for NotificationAccessConfirmationActivity.
     */
    public static Intent launcherIntent(Context context, int userId, ComponentName component) {
        return new Intent()
                .setComponent(COMPONENT_NAME)
                .putExtra(EXTRA_USER_ID, userId)
                .putExtra(EXTRA_COMPONENT_NAME, component)
                .putExtra(EXTRA_PACKAGE_TITLE, packageTitle);
                .putExtra(EXTRA_COMPONENT_NAME, component);
    }
}
+2 −11
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.FeatureInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.net.NetworkPolicyManager;
import android.os.Binder;
@@ -385,20 +384,12 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
            String callingPackage = component.getPackageName();
            checkCanCallNotificationApi(callingPackage);
            int userId = getCallingUserId();
            String packageTitle = BidiFormatter.getInstance().unicodeWrap(
                    getPackageInfo(callingPackage, userId)
                            .applicationInfo
                            .loadSafeLabel(getContext().getPackageManager(),
                                    PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX,
                                    PackageItemInfo.SAFE_LABEL_FLAG_TRIM
                                            | PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE)
                            .toString());
            long identity = Binder.clearCallingIdentity();
            final long identity = Binder.clearCallingIdentity();
            try {
                return PendingIntent.getActivity(getContext(),
                        0 /* request code */,
                        NotificationAccessConfirmationActivityContract.launcherIntent(
                                userId, component, packageTitle),
                                getContext(), userId, component),
                        PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT
                                | PendingIntent.FLAG_CANCEL_CURRENT);
            } finally {