本文整理汇总了Java中android.content.ContentResolver.call方法的典型用法代码示例。如果您正苦于以下问题:Java ContentResolver.call方法的具体用法?Java ContentResolver.call怎么用?Java ContentResolver.call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.ContentResolver
的用法示例。
在下文中一共展示了ContentResolver.call方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceive
import android.content.ContentResolver; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
final ContentResolver resolver = context.getContentResolver();
final String action = intent.getAction();
if (Intent.ACTION_PACKAGE_FULLY_REMOVED.equals(action)) {
resolver.call(RecentsProvider.buildRecent(), RecentsProvider.METHOD_PURGE, null, null);
} else if (Intent.ACTION_PACKAGE_DATA_CLEARED.equals(action)) {
final Uri data = intent.getData();
if (data != null) {
final String packageName = data.getSchemeSpecificPart();
resolver.call(RecentsProvider.buildRecent(), RecentsProvider.METHOD_PURGE_PACKAGE,
packageName, null);
}
}
}
示例2: compressDocument
import android.content.ContentResolver; //导入方法依赖的package包/类
public static boolean compressDocument(ContentResolver resolver, Uri fromDocumentUri, ArrayList<String> fromDocumentIds) {
final ContentProviderClient client = resolver.acquireUnstableContentProviderClient(
fromDocumentUri.getAuthority());
try {
final Bundle in = new Bundle();
in.putString(Document.COLUMN_DOCUMENT_ID, getDocumentId(fromDocumentUri));
in.putParcelable(DocumentsContract.EXTRA_URI, fromDocumentUri);
in.putStringArrayList(DocumentsContract.EXTRA_DOCUMENTS_COMPRESS, fromDocumentIds);
resolver.call(fromDocumentUri, METHOD_COMPRESS_DOCUMENT, null, in);
return true;
} catch (Exception e) {
Log.w(TAG, "Failed to compress document", e);
return false;
} finally {
ContentProviderClientCompat.releaseQuietly(client);
}
}
示例3: uncompressDocument
import android.content.ContentResolver; //导入方法依赖的package包/类
public static boolean uncompressDocument(ContentResolver resolver, Uri fromDocumentUri) {
final ContentProviderClient client = resolver.acquireUnstableContentProviderClient(
fromDocumentUri.getAuthority());
try {
final Bundle in = new Bundle();
in.putString(Document.COLUMN_DOCUMENT_ID, getDocumentId(fromDocumentUri));
in.putParcelable(DocumentsContract.EXTRA_URI, fromDocumentUri);
resolver.call(fromDocumentUri, METHOD_UNCOMPRESS_DOCUMENT, null, in);
return true;
} catch (Exception e) {
Log.w(TAG, "Failed to uncompress document", e);
return false;
} finally {
ContentProviderClientCompat.releaseQuietly(client);
}
}
示例4: call
import android.content.ContentResolver; //导入方法依赖的package包/类
public static Bundle call(String authority, Context context, String methodName, String arg, Bundle bundle) {
Uri uri = Uri.parse("content://" + authority);
ContentResolver contentResolver = context.getContentResolver();
return contentResolver.call(uri, methodName, arg, bundle);
}
示例5: call
import android.content.ContentResolver; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public static Bundle call(ContentResolver resolver, ContentProviderClient client, Uri uri, String method, String arg, Bundle extras) throws Exception{
if(Utils.hasJellyBeanMR1()){
return client.call(method, arg, extras);
}
else{
return resolver.call(uri, method, arg, extras);
}
}
示例6: transactProviderInstall
import android.content.ContentResolver; //导入方法依赖的package包/类
private static Object transactProviderInstall(String processName,ProviderInfo info){
Bundle extras = new Bundle();
extras.putParcelable(PROVIDER_INFO_KEY,info);
ContentResolver contentResolver = RuntimeVariables.androidApplication.getContentResolver();
Bundle bundle = contentResolver.call(accquireRemoteBridgeToken(processName),METHOD_INSTALLPROVIDER,"",extras);
Object holder = bundle.getParcelable(PROVIDER_HOLDER_KEY);
return holder;
}
示例7: request
import android.content.ContentResolver; //导入方法依赖的package包/类
@Nullable
public BundledFontFamily request(@NonNull ContentResolver resolver) {
Bundle data = new Bundle();
data.setClassLoader(this.getClass().getClassLoader());
data.putParcelable("data", this);
Bundle result = resolver.call(
Uri.parse("content://moe.shizuku.fontprovider"), "request", "bundled", data);
if (result != null) {
result.setClassLoader(this.getClass().getClassLoader());
return result.getParcelable("data");
}
return null;
}
示例8: call
import android.content.ContentResolver; //导入方法依赖的package包/类
public static Bundle call(ContentResolver cr, String method) {
return cr.call(CONTENT_URI, method, null, null);
}