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

Commit 7da94475 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by Automerger Merge Worker
Browse files

Merge "New API for comparing two intents of PendingIntent object." into sc-dev am: 92d9a9a7

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If92fdbbe308383b58c6b22242203b68601c3913f
parents 355f75df 92d9a9a7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ package android.app {
  }

  public final class PendingIntent implements android.os.Parcelable {
    method @RequiresPermission(android.Manifest.permission.GET_INTENT_SENDER_INTENT) public boolean intentFilterEquals(@Nullable android.app.PendingIntent);
    method @NonNull @RequiresPermission(android.Manifest.permission.GET_INTENT_SENDER_INTENT) public java.util.List<android.content.pm.ResolveInfo> queryIntentComponents(int);
  }

+1 −0
Original line number Diff line number Diff line
@@ -302,6 +302,7 @@ package android.app {
  }

  public final class PendingIntent implements android.os.Parcelable {
    method @RequiresPermission("android.permission.GET_INTENT_SENDER_INTENT") public boolean intentFilterEquals(@Nullable android.app.PendingIntent);
    method @NonNull @RequiresPermission("android.permission.GET_INTENT_SENDER_INTENT") public java.util.List<android.content.pm.ResolveInfo> queryIntentComponents(int);
    field @Deprecated public static final int FLAG_MUTABLE_UNAUDITED = 33554432; // 0x2000000
  }
+24 −0
Original line number Diff line number Diff line
@@ -1256,6 +1256,30 @@ public final class PendingIntent implements Parcelable {
        }
    }

    /**
     * Comparison operator on two PendingIntent objects, such that true is returned when they
     * represent {@link Intent}s that are equal as per {@link Intent#filterEquals}.
     *
     * @param other The other PendingIntent to compare against.
     * @return True if action, data, type, class, and categories on two intents are the same.
     *
     * @hide
     */
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    @TestApi
    @RequiresPermission(android.Manifest.permission.GET_INTENT_SENDER_INTENT)
    public boolean intentFilterEquals(@Nullable PendingIntent other) {
        if (other == null) {
            return false;
        }
        try {
            return ActivityManager.getService().getIntentForIntentSender(other.mTarget)
                    .filterEquals(getIntent());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Comparison operator on two PendingIntent objects, such that true
     * is returned then they both represent the same operation from the