Nested Classes | ||
---|---|---|
class | RegistrationInformation.WidgetClassList | Class containing a list of widgets. |
Fields | ||
---|---|---|
public static int | API_NOT_REQUIRED | Constant defining that an API is not required for extension. |
Public Constructors | |
---|---|
RegistrationInformation() |
Public Methods | |
---|---|
boolean |
isControlDeviceSupported(DeviceInfo deviceInfo)
Return if the specified Control API device is supported by the extension. |
abstract int |
getRequiredNotificationApiVersion()
Return the required notifications API version |
abstract ContentValues |
getExtensionRegistrationConfiguration()
Get the extension registration information. |
ContentValues[] |
getSourceRegistrationConfigurations()
Get all source registration configurations. |
boolean |
isWidgetSizeSupported(int width, int height)
Checks if the widget size is supported. |
abstract int |
getRequiredWidgetApiVersion()
Return the required widget API version. |
int |
getTargetWidgetApiVersion()
Return the target widget API version. |
boolean |
isDisplaySizeSupported(int width, int height)
Return if the display size is supported. |
abstract int |
getRequiredControlApiVersion()
Return the required control API version. |
int |
getTargetControlApiVersion()
Return the target control API version. |
boolean |
isSensorSupported(AccessorySensor sensor)
Return if the sensor is used by extension. |
abstract int |
getRequiredSensorApiVersion()
Return the required sensor API version. |
int |
getTargetSensorApiVersion()
Return the target sensor API version. |
boolean |
supportsLowPowerMode()
Return true if low power mode is used by the control extension. |
boolean |
controlInterceptsBackButton()
Return true if the control extension wants to intercept the back button of the connected accessory. |
boolean |
isSourcesToBeUpdatedAtServiceCreation()
Return true if the sources shall be updated when the extension service is created. |
boolean |
isSupportedWidgetAvailable(Context context, HostApplicationInfo hostApplication)
Check if widget shall be supported for this host application by checking that the host application has device with a supported widget size. |
boolean |
isSupportedSensorAvailable(Context context, HostApplicationInfo hostApplication)
Check if sensor shall be supported for this host application by checking if the host application has at least one supported sensor. |
boolean |
isSupportedControlAvailable(Context context, HostApplicationInfo hostApplication)
Check if control shall be supported for this host application by checking that the host application has a device with a supported display size. |
java.util.List<ContentValues> |
getWidgetRegistrationValues(Context context, java.lang.String packageName, WidgetContainer widgetContainer, int registrationVersion)
Get widget registration values for a host application widget. |
java.lang.String |
getExtensionKey()
Get the extension's registration key. |
static BaseWidget |
getWidgetInstanceFromClass(Context context, java.lang.String hostAppPackageName, int instanceId, java.lang.String key)
Create a widget instance for provided class. |
Protected Methods | |
---|---|
RegistrationInformation.WidgetClassList |
getWidgetClasses(Context context, java.lang.String hostAppPackageName, WidgetContainer widgetContainer)
Get widget registration info for a host application widget. |
Constant defining that an API is not required for extension.
Return if the specified Control API device is supported by the extension. Default implementation checks if the display size is supported by the extension. Override this method to adapt it to your needs, e.g. to include tap support.
deviceInfo | The device. |
---|
True if the Control API device is supported.
Return the required notifications API version
Required notification API version, or API_NOT_REQUIRED if not requiring notification support.
Get the extension registration information.
The registration configuration.
Get all source registration configurations. Note that the extension specific id must be set if there are more than one source. Override this method if this is a notification extension.
The source registration information.
Checks if the widget size is supported. Override this to provide extension specific implementation.
width | The widget width. |
---|---|
height | The widget height. |
True if the widget size is supported.
Return the required widget API version.
Required API widget version, or API_NOT_REQUIRED if not supporting widget.
Return the target widget API version.
Required API widget version, or API_NOT_REQUIRED if not supporting widget. Returns required widget API version by default.
Return if the display size is supported.
width | The display width. |
---|---|
height | The display height. |
True if the display size is supported.
Return the required control API version.
Required API control version, or API_NOT_REQUIRED if not supporting control.
Return the target control API version.
Required API control version, or API_NOT_REQUIRED if not supporting control. Returns required control API version by default.
Return if the sensor is used by extension.
sensor | The sensor. |
---|
True if sensor is used by the extension.
Return the required sensor API version.
Required API sensor version, or API_NOT_REQUIRED if not supporting sensor.
Return the target sensor API version.
Target API sensor version, or API_NOT_REQUIRED if not supporting sensor. Returns required sensor API version by default.
Return true if low power mode is used by the control extension.
True if low power mode is used by the extension.
Return true if the control extension wants to intercept the back button of the connected accessory.
True if extension wants to intercept back button
Return true if the sources shall be updated when the extension service is created. This might be handy if the extension use dynamic sources and the source can change when the extension service is not running.
True if the source registration shall be update when the extension service is created.
Check if widget shall be supported for this host application by checking that the host application has device with a supported widget size. This method can be override to provide extension specific implementations.
context | The context. |
---|---|
hostApplication | The host application. |
True if widget shall be supported.
Check if sensor shall be supported for this host application by checking if the host application has at least one supported sensor. This method can be override to provide extension specific implementations.
context | The context. |
---|---|
hostApplication | The host application. |
True if sensor shall be supported.
Check if control shall be supported for this host application by checking that the host application has a device with a supported display size. This method can be override to provide extension specific implementations.
context | The context. |
---|---|
hostApplication | The host application. |
True if control shall be supported.
Get widget registration values for a host application widget.
context | The context. |
---|---|
packageName | |
widgetContainer | The host application widget the registration is for. |
registrationVersion |
Content values with widget registration values.
Get the extension's registration key.
The extensionKey.
Create a widget instance for provided class.
context | Extension service context. |
---|---|
hostAppPackageName | Host app package name. |
instanceId | Widget instance ID. |
key | The widget class name. |
Widget instance.
Get widget registration info for a host application widget.
context | The context. |
---|---|
hostAppPackageName | The host application package name |
widgetContainer | The host application widget the registration is for. |
A list with widget registration info.
Returns information needed during extension registration