Class ShadowPendingIntent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
boolean
callLastOnFinished
(Intent intent, int resultCode, String resultData, Bundle resultExtras) protected void
cancel()
boolean
protected static PendingIntent
getActivities
(Context context, int requestCode, Intent[] intents, int flags) protected static PendingIntent
getActivities
(Context context, int requestCode, Intent[] intents, int flags, Bundle options) protected static PendingIntent
getActivity
(Context context, int requestCode, Intent intent, int flags) protected static PendingIntent
getActivity
(Context context, int requestCode, Intent intent, int flags, Bundle options) protected static PendingIntent
getBroadcast
(Context context, int requestCode, Intent intent, int flags) protected String
protected int
int
getFlags()
protected static PendingIntent
getForegroundService
(Context context, int requestCode, Intent intent, int flags) protected IntentSender
int
This returns the last Intent in the Intent[] to be delivered when the PendingIntent is sent.Intent[]
This method is particularly useful for PendingIntents created with multiple Intents:getActivities(Context, int, Intent[], int)
getActivities(Context, int, Intent[], int, Bundle)
protected static PendingIntent
getService
(Context context, int requestCode, Intent intent, int flags) protected String
int
hashCode()
boolean
Returnstrue
if thisPendingIntent
was created withgetActivity(android.content.Context, int, android.content.Intent, int)
orgetActivities(android.content.Context, int, android.content.Intent[], int)
.boolean
Deprecated.boolean
Returnstrue
if thisPendingIntent
was created withgetBroadcast(android.content.Context, int, android.content.Intent, int)
.boolean
Deprecated.preferisBroadcast()
which was added toPendingIntent
in API 31 (Android S).boolean
boolean
Returnstrue
if thisPendingIntent
was created withgetForegroundService(android.content.Context, int, android.content.Intent, int)
.boolean
Deprecated.preferisForegroundService()
which was added toPendingIntent
in API 31 (Android S).boolean
boolean
Returnstrue
if thisPendingIntent
was created withgetService(android.content.Context, int, android.content.Intent, int)
.boolean
Deprecated.preferisService()
which was added toPendingIntent
in API 31 (Android S).protected boolean
static PendingIntent
static void
reset()
protected void
send()
protected void
send
(int code) protected void
send
(int code, PendingIntent.OnFinished onFinished, Handler handler) protected void
protected void
send
(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler) protected void
send
(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler, String requiredPermission) protected void
send
(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler, String requiredPermission, Bundle options) void
setCreatorPackage
(String creatorPackage) void
setCreatorUid
(int uid) static void
writePendingIntentOrNullToParcel
(PendingIntent sender, Parcel out) protected void
writeToParcel
(Parcel out, int flags)
-
Constructor Details
-
ShadowPendingIntent
public ShadowPendingIntent()
-
-
Method Details
-
__staticInitializer__
-
getActivity
@Implementation protected static PendingIntent getActivity(Context context, int requestCode, Intent intent, int flags) -
getActivity
@Implementation protected static PendingIntent getActivity(Context context, int requestCode, Intent intent, int flags, Bundle options) -
getActivities
@Implementation protected static PendingIntent getActivities(Context context, int requestCode, Intent[] intents, int flags) -
getActivities
@Implementation protected static PendingIntent getActivities(Context context, int requestCode, Intent[] intents, int flags, Bundle options) -
getBroadcast
@Implementation protected static PendingIntent getBroadcast(Context context, int requestCode, Intent intent, int flags) -
getService
@Implementation protected static PendingIntent getService(Context context, int requestCode, Intent intent, int flags) -
getForegroundService
@Implementation(minSdk=26) protected static PendingIntent getForegroundService(Context context, int requestCode, Intent intent, int flags) -
cancel
-
send
- Throws:
PendingIntent.CanceledException
-
send
- Throws:
PendingIntent.CanceledException
-
send
@Implementation protected void send(int code, PendingIntent.OnFinished onFinished, Handler handler) throws PendingIntent.CanceledException - Throws:
PendingIntent.CanceledException
-
send
@Implementation protected void send(Context context, int code, Intent intent) throws PendingIntent.CanceledException - Throws:
PendingIntent.CanceledException
-
send
@Implementation protected void send(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler) throws PendingIntent.CanceledException - Throws:
PendingIntent.CanceledException
-
send
@Implementation protected void send(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler, String requiredPermission) throws PendingIntent.CanceledException - Throws:
PendingIntent.CanceledException
-
send
@Implementation(minSdk=23) protected void send(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler, String requiredPermission, Bundle options) throws PendingIntent.CanceledException - Throws:
PendingIntent.CanceledException
-
getIntentSender
-
isActivity
Returnstrue
if thisPendingIntent
was created withgetActivity(android.content.Context, int, android.content.Intent, int)
orgetActivities(android.content.Context, int, android.content.Intent[], int)
.This method is intentionally left
public
rather thanprotected
because it serves a secondary purpose as a utility shadow method for API levels < 31. -
isBroadcast
Returnstrue
if thisPendingIntent
was created withgetBroadcast(android.content.Context, int, android.content.Intent, int)
.This method is intentionally left
public
rather thanprotected
because it serves a secondary purpose as a utility shadow method for API levels < 31. -
isForegroundService
Returnstrue
if thisPendingIntent
was created withgetForegroundService(android.content.Context, int, android.content.Intent, int)
.This method is intentionally left
public
rather thanprotected
because it serves a secondary purpose as a utility shadow method for API levels < 31. -
isService
Returnstrue
if thisPendingIntent
was created withgetService(android.content.Context, int, android.content.Intent, int)
.This method is intentionally left
public
rather thanprotected
because it serves a secondary purpose as a utility shadow method for API levels < 31. -
isImmutable
Returnstrue
if thisPendingIntent
is marked withPendingIntent.FLAG_IMMUTABLE
.This method is intentionally left
public
rather thanprotected
because it serves a secondary purpose as a utility shadow method for API levels < 31. -
isTargetedToPackage
-
isActivityIntent
Deprecated.preferisActivity()
which was added toPendingIntent
in API 31 (Android S).- Returns:
true
iff sending this PendingIntent will start an activity
-
isBroadcastIntent
Deprecated.preferisBroadcast()
which was added toPendingIntent
in API 31 (Android S).- Returns:
true
iff sending this PendingIntent will broadcast an Intent
-
isServiceIntent
Deprecated.preferisService()
which was added toPendingIntent
in API 31 (Android S).- Returns:
true
iff sending this PendingIntent will start a service
-
isForegroundServiceIntent
Deprecated.preferisForegroundService()
which was added toPendingIntent
in API 31 (Android S).- Returns:
true
iff sending this PendingIntent will start a foreground service
-
getSavedContext
- Returns:
- the context in which this PendingIntent was created
-
getSavedIntent
This returns the last Intent in the Intent[] to be delivered when the PendingIntent is sent. This method is particularly useful for PendingIntents created with a single Intent:- Returns:
- the final Intent to be delivered when the PendingIntent is sent
-
getSavedIntents
This method is particularly useful for PendingIntents created with multiple Intents:- Returns:
- all Intents to be delivered when the PendingIntent is sent
-
isCanceled
public boolean isCanceled()- Returns:
- iff this PendingIntent has been canceled
-
getRequestCode
public int getRequestCode()- Returns:
- the request code with which this PendingIntent was created
-
getFlags
public int getFlags()- Returns:
- the flags with which this PendingIntent was created
-
getOptions
- Returns:
- the flags with which this PendingIntent was created
-
callLastOnFinished
public boolean callLastOnFinished(Intent intent, int resultCode, String resultData, Bundle resultExtras) CallsPendingIntent.OnFinished.onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle)
on the lastPendingIntent.OnFinished
passed withsend()
.PendingIntent.OnFinished.onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle)
is called on theHandler
passed withsend()
(if any). If noHandler
was provided it's invoked on the calling thread.- Returns:
- false if no
PendingIntent.OnFinished
callback was passed with the lastsend()
call, true otherwise.
-
getTargetPackage
-
getCreatorPackage
-
setCreatorPackage
-
getCreatorUid
-
setCreatorUid
public void setCreatorUid(int uid) -
equals
-
hashCode
-
readPendingIntentOrNullFromParcel
-
writePendingIntentOrNullToParcel
@Implementation public static void writePendingIntentOrNullToParcel(@Nullable PendingIntent sender, Parcel out) -
writeToParcel
-
reset
-
isActivity()
which was added toPendingIntent
in API 31 (Android S).