public static @NonNull <T extends AppListProvider<?>> T getInstance(final Context context) {
		final String authority = context.getPackageName() + AUTHORITY_SUFFIX;		// Do not use BuildConfig.APPLICATION_ID
		final ContentProviderClient client = context.getContentResolver().acquireContentProviderClient(authority);
		if (client == null) throw new IllegalStateException("AppListProvider not associated with authority: " + authority);
		try {	// DO NOT replace this with try-with-resources, since ContentProviderClient.close() was added in API 24.
			final ContentProvider provider = client.getLocalContentProvider();
			if (provider == null)
				throw new IllegalStateException("android:multiprocess=\"true\" is required for this provider.");
			if (! (provider instanceof AppListProvider)) throw new IllegalArgumentException("");
			@SuppressWarnings("unchecked") final T casted = (T) provider;
			return casted;
		} finally {
			client.release();
		}
	}
The implementation should be as fast as possible, since it may be called in mass.
mobile/src/main/java/com/oasisfeng/common/app/AppListProvider.java