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

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

Merge "Remove package title from notification access confirmation intent" into...

Merge "Remove package title from notification access confirmation intent" into tm-dev am: 75577e94 am: a57a8cc9

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



Change-Id: I6fff009aeb50d409dc240ded3c41567ae6b0e906
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 21bb0353 a57a8cc9
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -28,18 +28,15 @@ import com.android.internal.R;
public final class NotificationAccessConfirmationActivityContract {
    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";

    /**
     * Creates a launcher intent for NotificationAccessConfirmationActivity.
     */
    public static Intent launcherIntent(Context context, int userId, ComponentName component,
            String packageTitle) {
    public static Intent launcherIntent(Context context, int userId, ComponentName component) {
        return new Intent()
                .setComponent(ComponentName.unflattenFromString(context.getString(
                        R.string.config_notificationAccessConfirmationActivity)))
                .putExtra(EXTRA_USER_ID, userId)
                .putExtra(EXTRA_COMPONENT_NAME, component)
                .putExtra(EXTRA_PACKAGE_TITLE, packageTitle);
                .putExtra(EXTRA_COMPONENT_NAME, component);
    }
}
+1 −11
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
import android.content.pm.UserInfo;
@@ -81,7 +80,6 @@ import android.os.ServiceManager;
import android.os.ShellCallback;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.BidiFormatter;
import android.util.ArraySet;
import android.util.Base64;
import android.util.ExceptionUtils;
@@ -553,20 +551,12 @@ public class CompanionDeviceManagerService extends SystemService {
            String callingPackage = component.getPackageName();
            checkCanCallNotificationApi(callingPackage);
            // TODO: check userId.
            String packageTitle = BidiFormatter.getInstance().unicodeWrap(
                    getPackageInfo(getContext(), userId, callingPackage)
                            .applicationInfo
                            .loadSafeLabel(getContext().getPackageManager(),
                                    PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX,
                                    PackageItemInfo.SAFE_LABEL_FLAG_TRIM
                                            | PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE)
                            .toString());
            final long identity = Binder.clearCallingIdentity();
            try {
                return PendingIntent.getActivityAsUser(getContext(),
                        0 /* request code */,
                        NotificationAccessConfirmationActivityContract.launcherIntent(
                                getContext(), userId, component, packageTitle),
                                getContext(), userId, component),
                        PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT
                                | PendingIntent.FLAG_CANCEL_CURRENT,
                        null /* options */,