Merge "New API for comparing two intents of PendingIntent object." am: 687da317ad
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597953 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I72c2dd4e9a93fc8e4f3494755940e103b7b820a3
This commit is contained in:
@@ -6,6 +6,10 @@ package android.app {
|
|||||||
method public void setMaxManifestReceiverApiLevel(int);
|
method public void setMaxManifestReceiverApiLevel(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class PendingIntent implements android.os.Parcelable {
|
||||||
|
method @RequiresPermission("android.permission.GET_INTENT_SENDER_INTENT") public boolean intentFilterEquals(@Nullable android.app.PendingIntent);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package android.app.usage {
|
package android.app.usage {
|
||||||
|
|||||||
@@ -248,6 +248,10 @@ package android.app {
|
|||||||
method public boolean matchesCallFilter(android.os.Bundle);
|
method public boolean matchesCallFilter(android.os.Bundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class PendingIntent implements android.os.Parcelable {
|
||||||
|
method @RequiresPermission("android.permission.GET_INTENT_SENDER_INTENT") public boolean intentFilterEquals(@Nullable android.app.PendingIntent);
|
||||||
|
}
|
||||||
|
|
||||||
public final class PictureInPictureParams implements android.os.Parcelable {
|
public final class PictureInPictureParams implements android.os.Parcelable {
|
||||||
method public java.util.List<android.app.RemoteAction> getActions();
|
method public java.util.List<android.app.RemoteAction> getActions();
|
||||||
method public float getAspectRatio();
|
method public float getAspectRatio();
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ package android.app;
|
|||||||
import android.annotation.IntDef;
|
import android.annotation.IntDef;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.RequiresPermission;
|
||||||
|
import android.annotation.SystemApi;
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.IIntentReceiver;
|
import android.content.IIntentReceiver;
|
||||||
@@ -1170,6 +1173,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
|
* Comparison operator on two PendingIntent objects, such that true
|
||||||
* is returned then they both represent the same operation from the
|
* is returned then they both represent the same operation from the
|
||||||
|
|||||||
Reference in New Issue
Block a user