Render user's actual workspace in ThemePicker preview (Part 4)

Clear Glide memory cache when the grid fragment is being reloaded. This is to fix the case when user changes home screen layout before the preview images expire from Glide's cache.

Bug: 144052839
Test: Go to grid options, swipe home, and go to grid options again immediately. Make sure preview for the current grid choice is reloaded.
Change-Id: Ic805c5d4eee1ba8805608c775d5725929a6a9a11
diff --git a/src/com/android/customization/picker/grid/GridFragment.java b/src/com/android/customization/picker/grid/GridFragment.java
index 57720fe..9947aca 100644
--- a/src/com/android/customization/picker/grid/GridFragment.java
+++ b/src/com/android/customization/picker/grid/GridFragment.java
@@ -54,6 +54,7 @@
 import com.android.wallpaper.module.InjectorProvider;
 import com.android.wallpaper.picker.ToolbarFragment;
 
+import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 
 import java.util.List;
@@ -131,6 +132,9 @@
         final Resources res = getResources();
         DisplayMetrics dm = res.getDisplayMetrics();
         mScreenAspectRatio = (float) dm.heightPixels / dm.widthPixels;
+
+        // Clear memory cache whenever grid fragment view is being loaded.
+        Glide.get(getContext()).clearMemory();
         setUpOptions();
         view.findViewById(R.id.apply_button).setOnClickListener(v -> {
             mGridManager.apply(mSelectedOption,  new Callback() {