| java.lang.Object | |
| ↳ | com.davidluoye.support.os.LocalServices |
This class is used in a similar way as ServiceManager, except the services registered here are not Binder objects and are only available in the same process. Once all services are converted to the SystemService interface, this class can be absorbed into SystemServiceManager.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static <T> void |
addService(Class<T> type, T service)
Adds a service instance of the specified interface to the global registry of local services.
| ||||||||||
| static <T> void |
addService(String name, T service)
Adds a service instance of the specified interface to the global registry of local services.
| ||||||||||
| static <T> T |
getService(Class<T> type)
Returns a local service instance that implements the specified interface.
| ||||||||||
| static <T> T |
getService(String name)
Returns a local service instance that implements the specified interface.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Adds a service instance of the specified interface to the global registry of local services.
Adds a service instance of the specified interface to the global registry of local services.
Returns a local service instance that implements the specified interface.
| type | The type of service. |
|---|
Returns a local service instance that implements the specified interface.
| name | The name of service. |
|---|