Class ShadowPendingIntent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidbooleancallLastOnFinished(Intent intent, int resultCode, String resultData, Bundle resultExtras) protected voidcancel()booleanprotected static PendingIntentgetActivities(Context context, int requestCode, Intent[] intents, int flags) protected static PendingIntentgetActivities(Context context, int requestCode, Intent[] intents, int flags, Bundle options) protected static PendingIntentgetActivity(Context context, int requestCode, Intent intent, int flags) protected static PendingIntentgetActivity(Context context, int requestCode, Intent intent, int flags, Bundle options) protected static PendingIntentgetBroadcast(Context context, int requestCode, Intent intent, int flags) protected Stringprotected intintgetFlags()protected static PendingIntentgetForegroundService(Context context, int requestCode, Intent intent, int flags) protected IntentSenderintThis 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 PendingIntentgetService(Context context, int requestCode, Intent intent, int flags) protected StringinthashCode()booleanReturnstrueif thisPendingIntentwas created withgetActivity(android.content.Context, int, android.content.Intent, int)orgetActivities(android.content.Context, int, android.content.Intent[], int).booleanDeprecated.booleanReturnstrueif thisPendingIntentwas created withgetBroadcast(android.content.Context, int, android.content.Intent, int).booleanDeprecated.preferisBroadcast()which was added toPendingIntentin API 31 (Android S).booleanbooleanReturnstrueif thisPendingIntentwas created withgetForegroundService(android.content.Context, int, android.content.Intent, int).booleanDeprecated.preferisForegroundService()which was added toPendingIntentin API 31 (Android S).booleanbooleanReturnstrueif thisPendingIntentwas created withgetService(android.content.Context, int, android.content.Intent, int).booleanDeprecated.preferisService()which was added toPendingIntentin API 31 (Android S).protected booleanstatic PendingIntentstatic voidreset()protected voidsend()protected voidsend(int code) protected voidsend(int code, PendingIntent.OnFinished onFinished, Handler handler) protected voidprotected voidsend(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler) protected voidsend(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler, String requiredPermission) protected voidsend(Context context, int code, Intent intent, PendingIntent.OnFinished onFinished, Handler handler, String requiredPermission, Bundle options) voidsetCreatorPackage(String creatorPackage) voidsetCreatorUid(int uid) static voidwritePendingIntentOrNullToParcel(PendingIntent sender, Parcel out) protected voidwriteToParcel(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
Returnstrueif thisPendingIntentwas created withgetActivity(android.content.Context, int, android.content.Intent, int)orgetActivities(android.content.Context, int, android.content.Intent[], int).This method is intentionally left
publicrather thanprotectedbecause it serves a secondary purpose as a utility shadow method for API levels < 31. -
isBroadcast
Returnstrueif thisPendingIntentwas created withgetBroadcast(android.content.Context, int, android.content.Intent, int).This method is intentionally left
publicrather thanprotectedbecause it serves a secondary purpose as a utility shadow method for API levels < 31. -
isForegroundService
Returnstrueif thisPendingIntentwas created withgetForegroundService(android.content.Context, int, android.content.Intent, int).This method is intentionally left
publicrather thanprotectedbecause it serves a secondary purpose as a utility shadow method for API levels < 31. -
isService
Returnstrueif thisPendingIntentwas created withgetService(android.content.Context, int, android.content.Intent, int).This method is intentionally left
publicrather thanprotectedbecause it serves a secondary purpose as a utility shadow method for API levels < 31. -
isImmutable
Returnstrueif thisPendingIntentis marked withPendingIntent.FLAG_IMMUTABLE.This method is intentionally left
publicrather thanprotectedbecause it serves a secondary purpose as a utility shadow method for API levels < 31. -
isTargetedToPackage
-
isActivityIntent
Deprecated.preferisActivity()which was added toPendingIntentin API 31 (Android S).- Returns:
trueiff sending this PendingIntent will start an activity
-
isBroadcastIntent
Deprecated.preferisBroadcast()which was added toPendingIntentin API 31 (Android S).- Returns:
trueiff sending this PendingIntent will broadcast an Intent
-
isServiceIntent
Deprecated.preferisService()which was added toPendingIntentin API 31 (Android S).- Returns:
trueiff sending this PendingIntent will start a service
-
isForegroundServiceIntent
Deprecated.preferisForegroundService()which was added toPendingIntentin API 31 (Android S).- Returns:
trueiff 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.OnFinishedpassed withsend().PendingIntent.OnFinished.onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle)is called on theHandlerpassed withsend()(if any). If noHandlerwas provided it's invoked on the calling thread.- Returns:
- false if no
PendingIntent.OnFinishedcallback 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 toPendingIntentin API 31 (Android S).