PackageManager resolveContentProvider - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for PackageManager resolveContentProvider method.

This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
 
public class MyMockContentResolver extends MockContentResolver {
 
	public MyMockContentResolver(Context context) {
		ContentProvider provider = new MockImagesProvider();
		ProviderInfo providerInfo = new ProviderInfo();
		providerInfo.authority = "media";
		providerInfo.enabled = true;
		providerInfo.isSyncable = false;
		providerInfo.packageName = MockImagesProvider.class.getPackage().getName();
		provider.attachInfo(context, providerInfo);
		super.addProvider("media", provider);
	} 
} 
4
CodeRank
This code example shows how to use the following methods:
    * @return the provider 
    */ 
   public ContentProvider getProvider() {
      if (null == provider) {
         provider = new TestMockContentProvider(); // use your application's provider class implementation here
         ProviderInfo pi = new ProviderInfo();
         pi.authority = "org.openremote.android.test.provider.authority"; // use the provider authority name defined for
                                                                         // your application, either in the manifest or 
                                                                         // in a static 'persistence' class 
         pi.enabled = true;
         pi.isSyncable = false;
         pi.packageName = TestMockContentProvider.class.getPackage().getName(); // again - customize this for your
         pi.packageName = "";                                                                     // application
         provider.attachInfo(this.context, pi);
         super.addProvider("org.openremote.android.test.provider.authority", provider);
      } 
      return provider;
   } 
 
   /** 
4
CodeRank
This code example shows how to use the following methods:
        mWriteAccessLatch = new CountDownLatch(1);
 
        // Set up the sub-provider for handling profiles. 
        mProfileProvider = getProfileProvider();
        mProfileProvider.setDbHelperToSerializeOn(mContactsHelper, CONTACTS_DB_TAG);
        ProviderInfo profileInfo = new ProviderInfo();
        profileInfo.readPermission = "android.permission.READ_PROFILE";
        profileInfo.writePermission = "android.permission.WRITE_PROFILE";
        mProfileProvider.attachInfo(getContext(), profileInfo);
        mProfileHelper = mProfileProvider.getDatabaseHelper(getContext());
 
        return true; 
    } 
 
    public ProfileProvider getProfileProvider() { 
        return new ProfileProvider(this);
    } 
 
    @Override 
    public void onBegin() { 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:resolveContentProvider
            assertNotNull(name);
            MoreAsserts.assertNotEqual(name, "");
            assertEquals(flags, 0);
            switch (mSearchablesMode) {
            case SEARCHABLES_PASSTHROUGH:
                return mRealPackageManager.resolveContentProvider(name, flags);
            case SEARCHABLES_MOCK_ZERO:
            default: 
                throw new UnsupportedOperationException();
            } 
        } 
 
        /** 
         * Get the activity information for a particular activity. 
         * 
         * @param name The name of the activity to find. 
         * @param flags Additional option flags. 
         * 
         * @return ActivityInfo Information about the activity, if found, else null. 
         */ 
5
CodeRank
resolveContentProvider Method Overview
Find a single content provider by its base path name.
See Code Examples for other Android PackageManager Methods: