本文整理汇总了Java中com.sonyericsson.extras.liveware.extension.util.Dbg.w方法的典型用法代码示例。如果您正苦于以下问题:Java Dbg.w方法的具体用法?Java Dbg.w怎么用?Java Dbg.w使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sonyericsson.extras.liveware.extension.util.Dbg
的用法示例。
在下文中一共展示了Dbg.w方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSupportedWidgetAvailable
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* 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.
*
* @param context The context.
* @param hostApplication The host application.
* @return True if widget shall be supported.
*/
public boolean isSupportedWidgetAvailable(final Context context,
final HostApplicationInfo hostApplication) {
if (getRequiredWidgetApiVersion() == API_NOT_REQUIRED) {
return false;
}
if (hostApplication.getWidgetApiVersion() == 0) {
return false;
}
if (getRequiredWidgetApiVersion() > hostApplication.getWidgetApiVersion()) {
if (Dbg.DEBUG) {
Dbg.w("isSupportedWidgetAvailable: required widget API version not supported");
}
return false;
}
for (DeviceInfo device : hostApplication.getDevices()) {
if (isWidgetSizeSupported(device.getWidgetWidth(), device.getWidgetHeight())) {
return true;
}
}
return false;
}
示例2: closeSocket
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Close socket to be able to read sensor data
*/
private void closeSocket() {
// Close socket
if (mLocalServerSocket != null) {
try {
mLocalServerSocket.close();
mLocalServerSocket = null;
} catch (IOException e) {
if (Dbg.DEBUG) {
Dbg.w(e.getMessage(), e);
}
}
}
// Stop thread
if (mServerThread != null) {
mServerThread.interrupt();
mServerThread = null;
}
// Send intent to Aha
sendSensorStopListeningIntent();
}
示例3: run
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
@Override
public void run() {
try {
DataInputStream inStream = new DataInputStream(mLocalServerSocket.accept()
.getInputStream());
while (!isInterrupted()) {
AccessorySensorEvent event = decodeSensorData(inStream);
if (event != null) {
Message msg = new Message();
msg.obj = event;
mHandler.sendMessage(msg);
}
}
} catch (IOException e) {
if (Dbg.DEBUG) {
Dbg.w(e.getMessage(), e);
}
}
}
示例4: isSupportedWidgetAvailable
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* 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.
*
* @param context The context.
* @param hostApplication The host application.
* @return True if widget shall be supported.
*/
public boolean isSupportedWidgetAvailable(final Context context,
final HostApplicationInfo hostApplication) {
if (getRequiredWidgetApiVersion() == API_NOT_REQUIRED) {
return false;
}
if (hostApplication.getWidgetApiVersion() == 0) {
return false;
}
if (getRequiredWidgetApiVersion() > hostApplication.getWidgetApiVersion()) {
if (Dbg.DEBUG) {
Dbg.w("isSupportedWidgetAvailable: required widget API version not supported");
}
return false;
}
for (DeviceInfo device : hostApplication.getDevices()) {
if (isWidgetSizeSupported(device.getWidgetWidth(), device.getWidgetHeight())) {
return true;
}
}
return false;
}
示例5: isSupportedControlAvailable
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* 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.
*
* @param context The context.
* @param hostApplication The host application.
* @return True if control shall be supported.
*/
public boolean isSupportedControlAvailable(final Context context,
final HostApplicationInfo hostApplication) {
if (getRequiredControlApiVersion() == API_NOT_REQUIRED) {
return false;
}
if (hostApplication.getControlApiVersion() == 0) {
return false;
}
if (getRequiredControlApiVersion() > hostApplication.getControlApiVersion()) {
if (Dbg.DEBUG) {
Dbg.w("isSupportedControlAvailable: required control API version not supported");
}
return false;
}
for (DeviceInfo device : hostApplication.getDevices()) {
if (isControlDeviceSupported(device)) {
return true;
}
}
return false;
}
示例6: isSupportedSensorAvailable
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* 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.
*
* @param context The context.
* @param hostApplication The host application.
* @return True if sensor shall be supported.
*/
public boolean isSupportedSensorAvailable(final Context context,
final HostApplicationInfo hostApplication) {
if (getRequiredSensorApiVersion() == API_NOT_REQUIRED) {
return false;
}
if (hostApplication.getSensorApiVersion() == 0) {
return false;
}
if (getRequiredSensorApiVersion() > hostApplication.getSensorApiVersion()) {
if (Dbg.DEBUG) {
Dbg.w("isSupportedSensorAvailable: required sensor API version not supported");
}
return false;
}
for (DeviceInfo device : hostApplication.getDevices()) {
for (AccessorySensor sensor : device.getSensors()) {
if (isSensorSupported(sensor)) {
return true;
}
}
}
return false;
}
示例7: isSupportedControlAvailable
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* 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.
*
* @param context The context.
* @param hostApplication The host application.
* @return True if control shall be supported.
*/
public boolean isSupportedControlAvailable(final Context context,
final HostApplicationInfo hostApplication) {
if (getRequiredControlApiVersion() == API_NOT_REQUIRED) {
return false;
}
if (hostApplication.getControlApiVersion() == 0) {
return false;
}
if (getRequiredControlApiVersion() > hostApplication.getControlApiVersion()) {
if (Dbg.DEBUG) {
Dbg.w("isSupportedControlAvailable: required control API version not supported");
}
return false;
}
for (DeviceInfo device : hostApplication.getDevices()) {
for (DisplayInfo display : device.getDisplays()) {
if (isDisplaySizeSupported(display.getWidth(), display.getHeight())) {
return true;
}
}
}
return false;
}
示例8: isSupportedSensorAvailable
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* 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.
*
* @param context The context.
* @param hostApplication The host application.
* @return True if sensor shall be supported.
*/
public boolean isSupportedSensorAvailable(final Context context,
final HostApplicationInfo hostApplication) {
if (getRequiredSensorApiVersion() == API_NOT_REQUIRED) {
return false;
}
if (hostApplication.getSensorApiVersion() == 0) {
return false;
}
if (getRequiredSensorApiVersion() > hostApplication.getSensorApiVersion()) {
if (Dbg.DEBUG) {
Dbg.w("isSupportedSensorAvailable: required sensor API version not supported");
}
return false;
}
for (DeviceInfo device : hostApplication.getDevices()) {
for (AccessorySensor sensor : device.getSensors()) {
if (isSensorSupported(sensor)) {
return true;
}
}
}
return false;
}
示例9: getWidgetRegistrationValues
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Get widget registration values for a host application widget.
*
* @param context The context.
* @param hostAppPackageName The host application package name
* @param widgetContainer The host application widget the registration is for.
* @param registrationVersion
* @return Content values with widget registration values.
*/
public List<ContentValues> getWidgetRegistrationValues(Context context,
String packageName, WidgetContainer widgetContainer, int registrationVersion) {
List<ContentValues> widgetList = new ArrayList<ContentValues>();
WidgetClassList widgetRegistrations = getWidgetClasses(context,
packageName,
widgetContainer);
for (Class<?> widgetClass : widgetRegistrations) {
BaseWidget wr = getWidgetInstanceFromClass(context, packageName,
WidgetExtension.NOT_SET, widgetClass.getName());
ContentValues values = new ContentValues();
values.put(WidgetRegistrationColumns.NAME, context.getString(wr.getName()));
values.put(WidgetRegistrationColumns.WIDTH, wr.getWidth());
values.put(WidgetRegistrationColumns.HEIGHT, wr.getHeight());
values.put(WidgetRegistrationColumns.TYPE, widgetContainer.getType());
if (Dbg.DEBUG) {
Dbg.w("Registraton version: " + registrationVersion);
}
if (registrationVersion >= CATEGORY_SUPPORT_API_VERSION) {
values.put(WidgetRegistrationColumns.CATEGORY, wr.getCategory());
}
values.put(WidgetRegistrationColumns.KEY, widgetClass.getName());
values.put(WidgetRegistrationColumns.PREVIEW_IMAGE_URI,
ExtensionUtils.getUriString(context,
wr.getPreviewUri()));
widgetList.add(values);
}
return widgetList;
}
示例10: isSupportedControlAvailable
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* 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.
*
* @param context The context.
* @param hostApplication The host application.
* @return True if control shall be supported.
*/
public boolean isSupportedControlAvailable(final Context context,
final HostApplicationInfo hostApplication) {
if (getRequiredControlApiVersion() == API_NOT_REQUIRED) {
return false;
}
if (hostApplication.getControlApiVersion() == 0) {
return false;
}
if (getRequiredControlApiVersion() > hostApplication.getControlApiVersion()) {
if (Dbg.DEBUG) {
Dbg.w("isSupportedControlAvailable: required control API version not supported");
}
return false;
}
for (DeviceInfo device : hostApplication.getDevices()) {
for (DisplayInfo display : device.getDisplays()) {
if (isDisplaySizeSupported(display.getWidth(), display.getHeight())) {
return true;
}
}
}
return false;
}