diff --git a/res/values/override.xml b/res/values/override.xml
index 1b82e00..a070dbe 100644
--- a/res/values/override.xml
+++ b/res/values/override.xml
@@ -21,11 +21,6 @@
     <!-- Authority of a provider in System UI that will provide preview info for available clockfaces. -->
     <string name="clocks_provider_authority" translatable="false">com.android.keyguard.clock</string>
 
-    <!--Name of metadata in the main launcher Activity which values contains the authority
-        corresponding to a ContentProvider in launcher to provide available grids and
-        allow for changing them -->
-    <string name="grid_control_metadata_name" translatable="false">com.android.launcher3.grid.control</string>
-
     <string name="launcher_overlayable_package" translatable="false">com.android.launcher3</string>
 
     <!-- List of packages whose icons are used to preview the icon shape for a theme. These are
diff --git a/src/com/android/customization/model/grid/LauncherGridOptionsProvider.java b/src/com/android/customization/model/grid/LauncherGridOptionsProvider.java
index 8eb7383..7d1d5cd 100644
--- a/src/com/android/customization/model/grid/LauncherGridOptionsProvider.java
+++ b/src/com/android/customization/model/grid/LauncherGridOptionsProvider.java
@@ -18,13 +18,8 @@
 import android.content.ContentResolver;
 import android.content.ContentValues;
 import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ProviderInfo;
-import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
 import android.database.Cursor;
-import android.net.Uri;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.util.Pair;
@@ -36,6 +31,7 @@
 import com.android.customization.model.ResourceConstants;
 import com.android.systemui.shared.system.SurfaceViewRequestUtils;
 import com.android.wallpaper.R;
+import com.android.wallpaper.util.PreviewUtils;
 
 import com.bumptech.glide.Glide;
 
@@ -57,33 +53,20 @@
     private static final String COL_PREVIEW_COUNT = "preview_count";
     private static final String COL_IS_DEFAULT = "is_default";
 
-    private static final String METHOD_GET_PREVIEW = "get_preview";
     private static final String METADATA_KEY_PREVIEW_VERSION = "preview_version";
 
     private final Context mContext;
-    private final String mGridProviderAuthority;
-    private final ProviderInfo mProviderInfo;
+    private final PreviewUtils mPreviewUtils;
     private List<GridOption> mOptions;
     private String mVersion;
 
     public LauncherGridOptionsProvider(Context context, String authorityMetadataKey) {
+        mPreviewUtils = new PreviewUtils(context, authorityMetadataKey);
         mContext = context;
-        Intent homeIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME);
-
-        ResolveInfo info = context.getPackageManager().resolveActivity(homeIntent,
-                PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_META_DATA);
-        if (info != null && info.activityInfo != null && info.activityInfo.metaData != null) {
-            mGridProviderAuthority = info.activityInfo.metaData.getString(authorityMetadataKey);
-        } else {
-            mGridProviderAuthority = null;
-        }
-        // TODO: check permissions if needed
-        mProviderInfo = TextUtils.isEmpty(mGridProviderAuthority) ? null
-                : mContext.getPackageManager().resolveContentProvider(mGridProviderAuthority, 0);
     }
 
     boolean areGridsAvailable() {
-        return mProviderInfo != null;
+        return mPreviewUtils.supportsPreview();
     }
 
     boolean usesSurfaceView() {
@@ -104,15 +87,11 @@
         if (mOptions != null && !reload) {
             return Pair.create(mOptions, mVersion);
         }
-        Uri optionsUri = new Uri.Builder()
-                .scheme(ContentResolver.SCHEME_CONTENT)
-                .authority(mProviderInfo.authority)
-                .appendPath(LIST_OPTIONS)
-                .build();
         ContentResolver resolver = mContext.getContentResolver();
         String iconPath = mContext.getResources().getString(Resources.getSystem().getIdentifier(
                 ResourceConstants.CONFIG_ICON_MASK, "string", ResourceConstants.ANDROID_PACKAGE));
-        try (Cursor c = resolver.query(optionsUri, null, null, null, null)) {
+        try (Cursor c = resolver.query(mPreviewUtils.getUri(LIST_OPTIONS), null, null, null,
+                null)) {
             mVersion = c.getExtras().getString(METADATA_KEY_PREVIEW_VERSION);
             mOptions = new ArrayList<>();
             while(c.moveToNext()) {
@@ -121,15 +100,9 @@
                 int cols = c.getInt(c.getColumnIndex(COL_COLS));
                 int previewCount = c.getInt(c.getColumnIndex(COL_PREVIEW_COUNT));
                 boolean isSet = Boolean.valueOf(c.getString(c.getColumnIndex(COL_IS_DEFAULT)));
-                Uri preview = new Uri.Builder()
-                        .scheme(ContentResolver.SCHEME_CONTENT)
-                        .authority(mProviderInfo.authority)
-                        .appendPath(PREVIEW)
-                        .appendPath(name)
-                        .build();
                 String title = mContext.getString(R.string.grid_title_pattern, cols, rows);
-                mOptions.add(new GridOption(title, name, isSet, rows, cols, preview, previewCount,
-                        iconPath));
+                mOptions.add(new GridOption(title, name, isSet, rows, cols,
+                        mPreviewUtils.getUri(PREVIEW), previewCount, iconPath));
             }
             Glide.get(mContext).clearDiskCache();
         } catch (Exception e) {
@@ -146,24 +119,14 @@
      *                  {@link SurfaceViewRequestUtils#createSurfaceBundle(SurfaceView)}.
      */
     void renderPreview(String name, Bundle bundle) {
-        Uri preview = new Uri.Builder()
-                .scheme(ContentResolver.SCHEME_CONTENT)
-                .authority(mProviderInfo.authority)
-                .appendPath(PREVIEW)
-                .appendPath(name)
-                .build();
         bundle.putString("name", name);
-        mContext.getContentResolver().call(preview, METHOD_GET_PREVIEW, null, bundle);
+        mPreviewUtils.renderPreview(bundle);
     }
 
     int applyGrid(String name) {
-        Uri updateDefaultUri = new Uri.Builder()
-                .scheme(ContentResolver.SCHEME_CONTENT)
-                .authority(mProviderInfo.authority)
-                .appendPath(DEFAULT_GRID)
-                .build();
         ContentValues values = new ContentValues();
         values.put("name", name);
-        return mContext.getContentResolver().update(updateDefaultUri, values, null, null);
+        return mContext.getContentResolver().update(mPreviewUtils.getUri(DEFAULT_GRID), values,
+                null, null);
     }
 }
