public class SystemCapabilityManager extends Object
Note: This class must be accessed through the SdlManager. Do not instantiate it by itself.
| Modifier and Type | Method and Description |
|---|---|
void |
addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType,
OnSystemCapabilityListener listener)
Adds a listener to be called whenever a new capability is retrieved.
|
static <T> List<T> |
convertToList(Object object,
Class<T> classType)
Converts a capability object into a list.
|
Object |
getCapability(SystemCapabilityType systemCapabilityType,
OnSystemCapabilityListener scListener,
boolean forceUpdate)
Gets the capability object that corresponds to the supplied capability type by returning the currently cached value immediately (or null) as well as calling the listener immediately with the cached value, if available.
|
WindowCapability |
getDefaultMainWindowCapability() |
WindowCapability |
getWindowCapability(int windowID) |
boolean |
isCapabilitySupported(SystemCapabilityType type)
Ability to see if the connected module supports the given capability.
|
boolean |
removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType,
OnSystemCapabilityListener listener)
Removes an OnSystemCapabilityListener that was previously added
|
boolean |
supportsSubscriptions()
Checks is subscriptions are available on the connected head unit.
|
public WindowCapability getWindowCapability(int windowID)
public WindowCapability getDefaultMainWindowCapability()
public boolean isCapabilitySupported(SystemCapabilityType type)
type - the SystemCapabilityType that is to be checkedpublic boolean supportsSubscriptions()
public Object getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener, boolean forceUpdate)
systemCapabilityType - type of capability desiredscListener - callback to execute upon retrieving capabilityforceUpdate - flag to force getting a new fresh copy of the capability from the head unit even if it is cachedpublic void addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener)
systemCapabilityType - Type of capability desiredlistener - callback to execute upon retrieving capabilitypublic boolean removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener)
systemCapabilityType - Type of capabilitylistener - the listener that should be removedpublic static <T> List<T> convertToList(Object object, Class<T> classType)
object - the capability that needs to be convertedclassType - The class type of that should be contained in the list