Search in sources :

Example 1 with OnMarshaledListener

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);
        }
    }
}
Also used : OnMarshaledListener(android.app.PendingIntent.OnMarshaledListener) SuppressLint(android.annotation.SuppressLint) Implementation(org.robolectric.annotation.Implementation)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 OnMarshaledListener (android.app.PendingIntent.OnMarshaledListener)1 Implementation (org.robolectric.annotation.Implementation)1