Sony Addon SDK public abstract class

RegistrationInformation

This project is no longer being supported and will not get any further updates.
extends java.lang.Object
  1. java.lang.Object
  2. com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInformation

Class Overview

Returns information needed during extension registration

Summary

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.

Fields

public static int API_NOT_REQUIRED

Constant defining that an API is not required for extension.

Public Constructors

public RegistrationInformation()

Public Methods

public boolean isControlDeviceSupported(DeviceInfo deviceInfo)

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.

Parameters
deviceInfo The device.
Returns

True if the Control API device is supported.

public abstract int getRequiredNotificationApiVersion()

Return the required notifications API version

Returns

Required notification API version, or API_NOT_REQUIRED if not requiring notification support.

See Also

public abstract ContentValues getExtensionRegistrationConfiguration()

Get the extension registration information.

Returns

The registration configuration.

See Also

public ContentValues[] getSourceRegistrationConfigurations()

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.

Returns

The source registration information.

See Also

public boolean isWidgetSizeSupported(int width, int height)

Checks if the widget size is supported. Override this to provide extension specific implementation.

Parameters
width The widget width.
height The widget height.
Returns

True if the widget size is supported.

public abstract int getRequiredWidgetApiVersion()

Return the required widget API version.

Returns

Required API widget version, or API_NOT_REQUIRED if not supporting widget.

See Also

public int getTargetWidgetApiVersion()

Return the target widget API version.

Returns

Required API widget version, or API_NOT_REQUIRED if not supporting widget. Returns required widget API version by default.

See Also

public boolean isDisplaySizeSupported(int width, int height)

Return if the display size is supported.

Parameters
width The display width.
height The display height.
Returns

True if the display size is supported.

See Also

public abstract int getRequiredControlApiVersion()

Return the required control API version.

Returns

Required API control version, or API_NOT_REQUIRED if not supporting control.

See Also

public int getTargetControlApiVersion()

Return the target control API version.

Returns

Required API control version, or API_NOT_REQUIRED if not supporting control. Returns required control API version by default.

See Also

public boolean isSensorSupported(AccessorySensor sensor)

Return if the sensor is used by extension.

Parameters
sensor The sensor.
Returns

True if sensor is used by the extension.

public abstract int getRequiredSensorApiVersion()

Return the required sensor API version.

Returns

Required API sensor version, or API_NOT_REQUIRED if not supporting sensor.

See Also

public int getTargetSensorApiVersion()

Return the target sensor API version.

Returns

Target API sensor version, or API_NOT_REQUIRED if not supporting sensor. Returns required sensor API version by default.

See Also

public boolean supportsLowPowerMode()

Return true if low power mode is used by the control extension.

Returns

True if low power mode is used by the extension.

public boolean controlInterceptsBackButton()

Return true if the control extension wants to intercept the back button of the connected accessory.

Returns

True if extension wants to intercept back button

public boolean isSourcesToBeUpdatedAtServiceCreation()

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.

Returns

True if the source registration shall be update when the extension service is created.

public 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. This method can be override to provide extension specific implementations.

Parameters
context The context.
hostApplication The host application.
Returns

True if widget shall be supported.

public 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. This method can be override to provide extension specific implementations.

Parameters
context The context.
hostApplication The host application.
Returns

True if sensor shall be supported.

public 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. This method can be override to provide extension specific implementations.

Parameters
context The context.
hostApplication The host application.
Returns

True if control shall be supported.

public java.util.List<ContentValues> getWidgetRegistrationValues(Context context, java.lang.String packageName, WidgetContainer widgetContainer, int registrationVersion)

Get widget registration values for a host application widget.

Parameters
context The context.
packageName
widgetContainer The host application widget the registration is for.
registrationVersion
Returns

Content values with widget registration values.

public java.lang.String getExtensionKey()

Get the extension's registration key.

Returns

The extensionKey.

public static BaseWidget getWidgetInstanceFromClass(Context context, java.lang.String hostAppPackageName, int instanceId, java.lang.String key)

Create a widget instance for provided class.

Parameters
context Extension service context.
hostAppPackageName Host app package name.
instanceId Widget instance ID.
key The widget class name.
Returns

Widget instance.

Protected Methods

protected RegistrationInformation.WidgetClassList getWidgetClasses(Context context, java.lang.String hostAppPackageName, WidgetContainer widgetContainer)

Get widget registration info for a host application widget.

Parameters
context The context.
hostAppPackageName The host application package name
widgetContainer The host application widget the registration is for.
Returns

A list with widget registration info.