Android ProviderInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ProviderInfo class.

This code example shows how to use the following methods:
        mContentResolver = new MockContentResolver();
        mContactsProvider = new MockContentProvider();
        mContentResolver.addProvider(ContactsContract.AUTHORITY, mContactsProvider);
        mContactsProvider.attachInfo(this, new ProviderInfo());
        mSettingsProvider = new MockContentProvider();
        mSettingsProvider.attachInfo(this, new ProviderInfo());
        mContentResolver.addProvider(Settings.AUTHORITY, mSettingsProvider);
    } 
 
    public void setMockAccountTypeManager(MockAccountTypeManager mockAccountTypeManager) {
        mMockAccountTypeManager = mockAccountTypeManager;
    } 
 
    @Override 
    public ContentResolver getContentResolver() {
        return mContentResolver;
    } 
 
    public MockContentProvider getContactsProvider() {
        return mContactsProvider;
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        mContentResolver = new MockContentResolver();
        mContactsProvider = new MockContentProvider();
        mContentResolver.addProvider(ContactsContract.AUTHORITY, mContactsProvider);
        mContactsProvider.attachInfo(this, new ProviderInfo());
        mSettingsProvider = new MockContentProvider();
        mSettingsProvider.attachInfo(this, new ProviderInfo());
        mContentResolver.addProvider(Settings.AUTHORITY, mSettingsProvider);
    } 
 
    public void setMockAccountTypeManager(MockAccountTypeManager mockAccountTypeManager) {
        mMockAccountTypeManager = mockAccountTypeManager;
    } 
 
    @Override 
    public ContentResolver getContentResolver() {
        return mContentResolver;
    } 
 
    public MockContentProvider getContactsProvider() {
        return mContactsProvider;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:

Related Android ProviderInfo Questions & Answers:

See Code Examples for Android ProviderInfo Methods: