1 package org.robolectric.shadows; 2 3 import static org.robolectric.shadow.api.Shadow.directlyOn; 4 5 import android.app.IntentService; 6 import org.robolectric.annotation.Implementation; 7 import org.robolectric.annotation.Implements; 8 import org.robolectric.annotation.RealObject; 9 import org.robolectric.util.ReflectionHelpers.ClassParameter; 10 11 @SuppressWarnings({"UnusedDeclaration"}) 12 @Implements(IntentService.class) 13 public class ShadowIntentService extends ShadowService { 14 @RealObject 15 IntentService realIntentService; 16 private boolean mRedelivery; 17 18 public boolean getIntentRedelivery() { 19 return mRedelivery; 20 } 21 22 @Implementation 23 public void setIntentRedelivery(boolean enabled) { 24 mRedelivery = enabled; 25 directlyOn(realIntentService, IntentService.class, "setIntentRedelivery", ClassParameter.from(boolean.class, enabled)); 26 } 27 } 28