use of android.support.annotation.WorkerThread in project Walrus by megabug.
the class WriteOrEmulateCardDataFragment method onFinish.
@Override
@WorkerThread
public void onFinish() {
FragmentManager fragmentManager = getFragmentManager();
Fragment dialogFragment = fragmentManager.findFragmentByTag(SINGLE_CARD_DATA_IO_DIALOG_FRAGMENT_TAG);
if (dialogFragment != null)
fragmentManager.beginTransaction().remove(dialogFragment).commit();
}
use of android.support.annotation.WorkerThread in project AndroidLife by CaMnter.
the class LoadedPlugin method createResources.
@WorkerThread
private static Resources createResources(Context context, File apk) {
if (Constants.COMBINE_RESOURCES) {
Resources resources = ResourcesManager.createResources(context, apk.getAbsolutePath());
ResourcesManager.hookResources(context, resources);
return resources;
} else {
Resources hostResources = context.getResources();
AssetManager assetManager = createAssetManager(context, apk);
return new Resources(assetManager, hostResources.getDisplayMetrics(), hostResources.getConfiguration());
}
}
use of android.support.annotation.WorkerThread in project AndroidLife by CaMnter.
the class ScreenshotsListener method handleMediaContentChange.
@WorkerThread
private void handleMediaContentChange(@NonNull final Uri contentUri) {
Cursor cursor = null;
try {
// 数据改变时查询数据库中最后加入的一条数据
cursor = this.context.getContentResolver().query(contentUri, Build.VERSION.SDK_INT < 16 ? MEDIA_PROJECTIONS : MEDIA_PROJECTIONS_API_16, null, null, MediaStore.Images.ImageColumns.DATE_ADDED + " desc limit 1");
if (cursor == null) {
Log.d(TAG, "[handleMediaContentChange] [cursor] = null");
return;
}
if (!cursor.moveToFirst()) {
Log.d(TAG, "[handleMediaContentChange] Cursor no data");
return;
}
// 获取各列的索引
int dataIndex = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
int dateTakenIndex = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATE_TAKEN);
// 获取行数据
String data = cursor.getString(dataIndex);
long dateTaken = cursor.getLong(dateTakenIndex);
// 处理获取到的第一行数据
this.handleMediaRowData(data, dateTaken, cursor);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (cursor != null && !cursor.isClosed()) {
cursor.close();
}
}
}
use of android.support.annotation.WorkerThread in project AppCenter-SDK-Android by Microsoft.
the class Analytics method queuePage.
/**
* Enqueue page log now.
*/
@WorkerThread
private void queuePage(String name, Map<String, String> properties) {
PageLog pageLog = new PageLog();
pageLog.setName(name);
pageLog.setProperties(properties);
mChannel.enqueue(pageLog, ANALYTICS_GROUP);
}
use of android.support.annotation.WorkerThread in project AppCenter-SDK-Android by Microsoft.
the class AppCenter method queueCustomProperties.
/**
* Send custom properties.
* Unit test requires top level methods when PowerMock.whenNew.
*
* @param properties properties to send.
*/
@WorkerThread
private void queueCustomProperties(@NonNull Map<String, Object> properties) {
CustomPropertiesLog customPropertiesLog = new CustomPropertiesLog();
customPropertiesLog.setProperties(properties);
mChannel.enqueue(customPropertiesLog, CORE_GROUP);
}
Aggregations