Build 1.0_r1(from source)

android.os
Class ServiceManager

java.lang.Object
  extended by android.os.ServiceManager

public final class ServiceManager
extends Object


Constructor Summary
ServiceManager()
           
 
Method Summary
static void addService(String name, IBinder service)
          Place a new @a service called @a name into the service manager.
static IBinder checkService(String name)
          Retrieve an existing service called @a name from the service manager.
static IBinder getService(String name)
          Returns a reference to a service with the given name.
static void initServiceCache(Map<String,IBinder> cache)
          This is only intended to be called when the process is first being brought up and bound by the activity manager.
static String[] listServices()
          Return a list of all currently running services.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceManager

public ServiceManager()
Method Detail

getService

public static IBinder getService(String name)
Returns a reference to a service with the given name.

Parameters:
name - the name of the service to get
Returns:
a reference to the service, or null if the service doesn't exist

addService

public static void addService(String name,
                              IBinder service)
Place a new @a service called @a name into the service manager.

Parameters:
name - the name of the new service
service - the service object

checkService

public static IBinder checkService(String name)
Retrieve an existing service called @a name from the service manager. Non-blocking.


listServices

public static String[] listServices()
                             throws RemoteException
Return a list of all currently running services.

Throws:
RemoteException

initServiceCache

public static void initServiceCache(Map<String,IBinder> cache)
This is only intended to be called when the process is first being brought up and bound by the activity manager. There is only one thread in the process at that time, so no locking is done.

Parameters:
cache - the cache of service references

Build 1.0_r1(from source)

Please submit a feedback, bug or feature