Package org.robolectric.shadows
Class ShadowServiceManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowServiceManager
-
@Implements(value=android.os.ServiceManager.class, isInAndroidSdk=false) public class ShadowServiceManager extends Object
Shadow forServiceManager.
-
-
Constructor Summary
Constructors Constructor Description ShadowServiceManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddBinderService(String name, Class<? extends IInterface> clazz)protected static voidaddBinderService(String name, Class<? extends IInterface> clazz, boolean useDeepBinder)protected static voidaddBinderService(String name, Class<? extends IInterface> clazz, String className, boolean useDeepBinder)protected static voidaddBinderService(String name, String className)protected static voidaddService(String name, IBinder service)protected static IBindercheckService(String name)protected static IBindergetService(String name)Returns the binder associated with the given system service.protected static voidinitServiceCache(Map<String,IBinder> cache)protected static String[]listServices()static voidreset()static voidsetServiceAvailability(String service, boolean available)Sets the availability of the given system service.
-
-
-
Method Detail
-
addBinderService
protected static void addBinderService(String name, Class<? extends IInterface> clazz)
-
addBinderService
protected static void addBinderService(String name, Class<? extends IInterface> clazz, boolean useDeepBinder)
-
addBinderService
protected static void addBinderService(String name, Class<? extends IInterface> clazz, String className, boolean useDeepBinder)
-
getService
@Implementation protected static IBinder getService(String name)
Returns the binder associated with the given system service. If the given service is set to unavailable insetServiceAvailability(java.lang.String, boolean),nullwill be returned.
-
addService
@Implementation protected static void addService(String name, IBinder service)
-
checkService
@Implementation protected static IBinder checkService(String name)
-
listServices
@Implementation protected static String[] listServices() throws RemoteException
- Throws:
RemoteException
-
initServiceCache
@Implementation protected static void initServiceCache(Map<String,IBinder> cache)
-
setServiceAvailability
public static void setServiceAvailability(String service, boolean available)
Sets the availability of the given system service. If the service is set as unavailable, subsequent calls toContext.getSystemService(java.lang.String)for that service will returnnull.
-
reset
@Resetter public static void reset()
-
-