Package org.robolectric.shadows
Class ShadowPendingIntent
- java.lang.Object
-
- org.robolectric.shadows.ShadowPendingIntent
-
@Implements(android.app.PendingIntent.class) public class ShadowPendingIntent extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ShadowPendingIntent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcancel()booleanequals(java.lang.Object o)protected static android.app.PendingIntentgetActivities(android.content.Context context, int requestCode, android.content.Intent[] intents, int flags)protected static android.app.PendingIntentgetActivities(android.content.Context context, int requestCode, android.content.Intent[] intents, int flags, android.os.Bundle options)protected static android.app.PendingIntentgetActivity(android.content.Context context, int requestCode, android.content.Intent intent, int flags)protected static android.app.PendingIntentgetActivity(android.content.Context context, int requestCode, android.content.Intent intent, int flags, android.os.Bundle options)protected static android.app.PendingIntentgetBroadcast(android.content.Context context, int requestCode, android.content.Intent intent, int flags)protected java.lang.StringgetCreatorPackage()intgetFlags()protected static android.app.PendingIntentgetForegroundService(android.content.Context context, int requestCode, android.content.Intent intent, int flags)protected android.content.IntentSendergetIntentSender()intgetRequestCode()android.content.ContextgetSavedContext()android.content.IntentgetSavedIntent()This returns the last Intent in the Intent[] to be delivered when the PendingIntent is sent.android.content.Intent[]getSavedIntents()This method is particularly useful for PendingIntents created with multiple Intents:getActivities(Context, int, Intent[], int)getActivities(Context, int, Intent[], int, Bundle)protected static android.app.PendingIntentgetService(android.content.Context context, int requestCode, android.content.Intent intent, int flags)protected java.lang.StringgetTargetPackage()inthashCode()booleanisActivityIntent()booleanisBroadcastIntent()booleanisCanceled()booleanisForegroundServiceIntent()booleanisServiceIntent()static android.app.PendingIntentreadPendingIntentOrNullFromParcel(android.os.Parcel in)static voidreset()protected voidsend()protected voidsend(int code)protected voidsend(int code, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler)protected voidsend(android.content.Context context, int code, android.content.Intent intent)protected voidsend(android.content.Context context, int code, android.content.Intent intent, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler)protected voidsend(android.content.Context context, int code, android.content.Intent intent, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler, java.lang.String requiredPermission)protected voidsend(android.content.Context context, int code, android.content.Intent intent, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler, java.lang.String requiredPermission, android.os.Bundle options)voidsetCreatorPackage(java.lang.String creatorPackage)static voidwritePendingIntentOrNullToParcel(android.app.PendingIntent sender, android.os.Parcel out)
-
-
-
Method Detail
-
getActivity
@Implementation protected static android.app.PendingIntent getActivity(android.content.Context context, int requestCode, android.content.Intent intent, int flags)
-
getActivity
@Implementation protected static android.app.PendingIntent getActivity(android.content.Context context, int requestCode, android.content.Intent intent, int flags, android.os.Bundle options)
-
getActivities
@Implementation protected static android.app.PendingIntent getActivities(android.content.Context context, int requestCode, android.content.Intent[] intents, int flags)
-
getActivities
@Implementation protected static android.app.PendingIntent getActivities(android.content.Context context, int requestCode, android.content.Intent[] intents, int flags, android.os.Bundle options)
-
getBroadcast
@Implementation protected static android.app.PendingIntent getBroadcast(android.content.Context context, int requestCode, android.content.Intent intent, int flags)
-
getService
@Implementation protected static android.app.PendingIntent getService(android.content.Context context, int requestCode, android.content.Intent intent, int flags)
-
getForegroundService
@Implementation(minSdk=26) protected static android.app.PendingIntent getForegroundService(android.content.Context context, int requestCode, android.content.Intent intent, int flags)
-
cancel
@Implementation protected void cancel()
-
send
@Implementation protected void send() throws android.app.PendingIntent.CanceledException- Throws:
android.app.PendingIntent.CanceledException
-
send
@Implementation protected void send(int code) throws android.app.PendingIntent.CanceledException- Throws:
android.app.PendingIntent.CanceledException
-
send
@Implementation protected void send(int code, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler) throws android.app.PendingIntent.CanceledException- Throws:
android.app.PendingIntent.CanceledException
-
send
@Implementation protected void send(android.content.Context context, int code, android.content.Intent intent) throws android.app.PendingIntent.CanceledException- Throws:
android.app.PendingIntent.CanceledException
-
send
@Implementation protected void send(android.content.Context context, int code, android.content.Intent intent, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler) throws android.app.PendingIntent.CanceledException- Throws:
android.app.PendingIntent.CanceledException
-
send
@Implementation protected void send(android.content.Context context, int code, android.content.Intent intent, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler, java.lang.String requiredPermission) throws android.app.PendingIntent.CanceledException- Throws:
android.app.PendingIntent.CanceledException
-
send
@Implementation(minSdk=23) protected void send(android.content.Context context, int code, android.content.Intent intent, android.app.PendingIntent.OnFinished onFinished, android.os.Handler handler, java.lang.String requiredPermission, android.os.Bundle options) throws android.app.PendingIntent.CanceledException- Throws:
android.app.PendingIntent.CanceledException
-
getIntentSender
@Implementation protected android.content.IntentSender getIntentSender()
-
isActivityIntent
public boolean isActivityIntent()
- Returns:
trueiff sending this PendingIntent will start an activity
-
isBroadcastIntent
public boolean isBroadcastIntent()
- Returns:
trueiff sending this PendingIntent will broadcast an Intent
-
isServiceIntent
public boolean isServiceIntent()
- Returns:
trueiff sending this PendingIntent will start a service
-
isForegroundServiceIntent
public boolean isForegroundServiceIntent()
- Returns:
trueiff sending this PendingIntent will start a foreground service
-
getSavedContext
public android.content.Context getSavedContext()
- Returns:
- the context in which this PendingIntent was created
-
getSavedIntent
public android.content.Intent 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
public android.content.Intent[] 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
-
getTargetPackage
@Implementation protected java.lang.String getTargetPackage()
-
getCreatorPackage
@Implementation(minSdk=17) protected java.lang.String getCreatorPackage()
-
setCreatorPackage
public void setCreatorPackage(java.lang.String creatorPackage)
-
equals
@Implementation public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
@Implementation public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
readPendingIntentOrNullFromParcel
@Implementation @Nullable public static android.app.PendingIntent readPendingIntentOrNullFromParcel(android.os.Parcel in)
-
writePendingIntentOrNullToParcel
@Implementation public static void writePendingIntentOrNullToParcel(@Nullable android.app.PendingIntent sender, android.os.Parcel out)
-
reset
@Resetter public static void reset()
-
-