Class ShadowServiceManager

java.lang.Object
org.robolectric.shadows.ShadowServiceManager

@Implements(value=android.os.ServiceManager.class, isInAndroidSdk=false) public class ShadowServiceManager extends Object
Shadow for ServiceManager.
  • Constructor Details

    • ShadowServiceManager

      public ShadowServiceManager()
  • Method Details

    • 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, String className)
    • 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 in setServiceAvailability(java.lang.String, boolean), null will 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 to Context.getSystemService(java.lang.String) for that service will return null.
    • reset

      @Resetter public static void reset()