public ContentProvider addProvider(
     Class<? extends ContentProvider> providerClass, String authority) throws Exception {
   ContentProvider provider = providerClass.newInstance();
   ProviderInfo info = new ProviderInfo();
   info.authority = authority;
   provider.attachInfo(mProviderContext, info);
   resolver.addProvider(authority, provider);
   return provider;
 }
 static GalleryAppStub newGalleryContext(SQLiteDatabase db, Looper mainLooper) {
   MockContentResolver cr = new MockContentResolver();
   ContentProvider cp = new DbContentProvider(db, cr);
   cr.addProvider("media", cp);
   return new GalleryAppMock(null, cr, mainLooper);
 }
 public void addAuthority(String authority) {
   resolver.addProvider(authority, mprovider);
 }