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