use of android.app.PendingIntent.OnMarshaledListener in project robolectric by robolectric.
the class ShadowPendingIntent method writePendingIntentOrNullToParcel.
@Implementation
public static void writePendingIntentOrNullToParcel(@Nullable PendingIntent sender, @NonNull Parcel out) {
if (sender == null) {
out.writeInt(NULL_PENDING_INTENT_VALUE);
return;
}
int index = parceledPendingIntents.size();
parceledPendingIntents.add(sender);
out.writeInt(index);
if (RuntimeEnvironment.getApiLevel() >= N) {
ThreadLocal<OnMarshaledListener> sOnMarshaledListener = ReflectionHelpers.getStaticField(PendingIntent.class, "sOnMarshaledListener");
OnMarshaledListener listener = sOnMarshaledListener.get();
if (listener != null) {
listener.onMarshaled(sender, out, 0);
}
}
}
Aggregations