@Implements(value=android.os.ServiceManager.class, isInAndroidSdk=false) public class ShadowServiceManager extends Object
Constructor and Description |
---|
ShadowServiceManager() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addService(String name,
IBinder service) |
protected static IBinder |
checkService(String name) |
protected static IBinder |
getService(String name)
Returns the binder associated with the given system service.
|
protected static void |
initServiceCache(Map<String,IBinder> cache) |
protected static String[] |
listServices() |
static void |
reset() |
static void |
setServiceAvailability(String service,
boolean available)
Sets the availability of the given system service.
|
@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.
@Implementation protected static void addService(String name, IBinder service)
@Implementation protected static IBinder checkService(String name)
@Implementation protected static String[] listServices() throws RemoteException
RemoteException
@Implementation protected static void initServiceCache(Map<String,IBinder> cache)
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
.
@Resetter public static void reset()