本文整理汇总了Java中com.sonyericsson.extras.liveware.extension.util.Dbg.e方法的典型用法代码示例。如果您正苦于以下问题:Java Dbg.e方法的具体用法?Java Dbg.e怎么用?Java Dbg.e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sonyericsson.extras.liveware.extension.util.Dbg
的用法示例。
在下文中一共展示了Dbg.e方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doInBackground
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
@Override
protected Boolean doInBackground(Void... params) {
if (mOnlySources) {
try {
registerOrUpdateSources();
return true;
} catch (RegisterExtensionException e) {
if (Dbg.DEBUG) {
Dbg.e("Source refresh failed", e);
}
return false;
}
} else {
boolean registrationSuccess = registerOrUpdateExtension();
if (registrationSuccess) {
if (mRegistrationInformation.getRequiredWidgetApiVersion() > 0
|| mRegistrationInformation.getRequiredControlApiVersion() > 0) {
registerWithAllHostApps();
}
}
return registrationSuccess;
}
}
示例2: getImage
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Get the widget image.
*
* @return The image.
*/
public Bitmap getImage() {
// If profile image explicitly set then use it.
// Otherwise get the contact photo.
if (mProfileImageUri != null) {
return ExtensionUtils.getBitmapFromUri(mContext, mProfileImageUri);
} else {
if (mContactReference != null) {
Uri uri = Uri.parse(mContactReference);
return ExtensionUtils.getContactPhoto(mContext, uri);
} else {
if (Dbg.DEBUG) {
Dbg.e("No image available");
}
return null;
}
}
}
示例3: getName
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Get the name.
*
* @return The name.
*/
public String getName() {
// If display name explicitly set then use it.
// Otherwise get the display name from the contact.
if (mName != null) {
return mName;
} else {
if (mContactReference != null) {
Uri uri = Uri.parse(mContactReference);
return ExtensionUtils.getContactName(mContext, uri);
} else {
if (Dbg.DEBUG) {
Dbg.e("No name");
}
return null;
}
}
}
示例4: removeUnsafeValues
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Iterates through ContentValues and removes values that are not available
* for the given SmartConnect version, regardless of which table the value
* is in. Current implementation only supports API levels 1 and 2. May not
* be complete.
*
* @param context
* @param apiLevel The version of the current API level, contentvalues not
* supported in this API level will be removed
* @param values the ContentValues to be scanned for unsafe values
* @return
*/
static int removeUnsafeValues(Context context, int apiLevel, ContentValues values) {
int removedValues = 0;
if (apiLevel < 2) {
for (String key : API_2_KEYS) {
if (values.containsKey(key)) {
values.remove(key);
Dbg.d("Removing " + key + " key from contentvalues");
removedValues++;
}
}
}
Dbg.e("Removed " + removedValues + " values from contentvalues");
return removedValues;
}
示例5: performRegistration
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Perform the registration.
*
* @param onlySources True if only notification sources shall be refreshed.
* @return True if registration was successful.
*/
boolean performRegistration(boolean onlySources) {
if (onlySources) {
try {
registerOrUpdateSources();
return true;
} catch (RegisterExtensionException e) {
if (Dbg.DEBUG) {
Dbg.e("Source refresh failed", e);
}
return false;
}
} else {
boolean registrationSuccess = registerOrUpdateExtension();
if (registrationSuccess) {
if (mRegistrationInformation.getRequiredWidgetApiVersion() > 0
|| mRegistrationInformation.getRequiredControlApiVersion() > 0) {
registerWithAllHostApps();
}
}
return registrationSuccess;
}
}
示例6: removeUnsafeValues
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Iterates through ContentValues and removes values that are not available
* for the given SmartConnect version, regardless of which table the value
* is in. Current implementation only supports API levels 1 and 2. May not
* be complete.
*
* @param context
* @param apiLevel The version of the current API level, contentvalues not
* supported in this API level will be removed
* @param values the ContentValues to be scanned for unsafe values
* @return
*/
static int removeUnsafeValues(Context context, int apiLevel, ContentValues values) {
int removedValues = 0;
if (apiLevel < 2) {
for (String key : API_2_KEYS) {
if (values.containsKey(key)) {
values.remove(key);
Dbg.d("Removing " + key + " key from contentvalues");
removedValues++;
}
}
}
Dbg.e("Removed " + removedValues + " values from contentvalues");
return removedValues;
}
示例7: registerOrUpdateExtension
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Register the extension or update the registration if already registered.
* This method is called from the the background
*
* @return True if the extension was registered properly.
*/
private boolean registerOrUpdateExtension() {
if (Dbg.DEBUG) {
Dbg.d("Start registration of extension.");
}
try {
// Register or update extension
if (!isRegistered()) {
register();
if (Dbg.DEBUG) {
Dbg.d("Registered extension.");
}
} else {
updateRegistration();
if (Dbg.DEBUG) {
Dbg.d("Updated extension.");
}
}
if (mRegistrationInformation.getRequiredNotificationApiVersion() > 0) {
// Register all sources
registerOrUpdateSources();
}
} catch (RegisterExtensionException exception) {
if (Dbg.DEBUG) {
Dbg.e("Failed to register extension", exception);
}
return false;
}
return true;
}
示例8: openSocket
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Create socket to be able to read sensor data
*/
private void openSocket() throws AccessorySensorException {
try {
// Open socket
mLocalServerSocket = new LocalServerSocket(mSocketName);
// Stop server listening thread if running
if (mServerThread != null) {
mServerThread.interrupt();
mServerThread = null;
}
// Start server listening thread
mServerThread = new ServerThread(new Handler() {
public void handleMessage(Message msg) {
AccessorySensorEvent accessorySensorEvent = (AccessorySensorEvent)msg.obj;
if (accessorySensorEvent != null && mListener != null) {
mListener.onSensorEvent(accessorySensorEvent);
}
}
});
mServerThread.start();
// Send intent to Aha
sendSensorStartListeningIntent();
} catch (IOException e) {
if (Dbg.DEBUG) {
Dbg.e(e.getMessage(), e);
}
throw new AccessorySensorException(e.getMessage());
}
}
示例9: openSocket
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Create socket to be able to read sensor data
*/
private void openSocket() throws AccessorySensorException {
try {
// Open socket
mLocalServerSocket = new LocalServerSocket(mSocketName);
// Stop server listening thread if running
if (mServerThread != null) {
mServerThread.interrupt();
mServerThread = null;
}
// Start server listening thread
mServerThread = new ServerThread(new Handler() {
@Override
public void handleMessage(Message msg) {
AccessorySensorEvent accessorySensorEvent = (AccessorySensorEvent)msg.obj;
if (accessorySensorEvent != null && mListener != null) {
mListener.onSensorEvent(accessorySensorEvent);
}
}
});
mServerThread.start();
// Send intent to Aha
sendSensorStartListeningIntent();
} catch (IOException e) {
if (Dbg.DEBUG) {
Dbg.e(e.getMessage(), e);
}
throw new AccessorySensorException(e.getMessage());
}
}
示例10: logAndThrow
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Write to log and throw exception
*
* This method is called from the the background
*
* @param text Text to write to log
* @param exception exception to throw
* @throws RegisterExtensionException
*/
private void logAndThrow(String text, Exception exception) throws RegisterExtensionException {
if (Dbg.DEBUG) {
Dbg.e(text, exception);
}
throw new RegisterExtensionException(text);
}
示例11: logAndThrow
import com.sonyericsson.extras.liveware.extension.util.Dbg; //导入方法依赖的package包/类
/**
* Write to log and throw exception This method is called from the the
* background
*
* @param text Text to write to log
* @param exception exception to throw
* @throws RegisterExtensionException
*/
private void logAndThrow(String text, Exception exception) throws RegisterExtensionException {
if (Dbg.DEBUG) {
Dbg.e(text, exception);
}
throw new RegisterExtensionException(text);
}