Merge "Using background outline provider as the final provider for reveal animation" into ub-launcher3-burnaby
diff --git a/src/com/android/launcher3/AutoInstallsLayout.java b/src/com/android/launcher3/AutoInstallsLayout.java
index 20c9314..99a98dd 100644
--- a/src/com/android/launcher3/AutoInstallsLayout.java
+++ b/src/com/android/launcher3/AutoInstallsLayout.java
@@ -580,6 +580,7 @@
 
             int type;
             int folderDepth = parser.getDepth();
+            int rank = 0;
             while ((type = parser.next()) != XmlPullParser.END_TAG ||
                     parser.getDepth() > folderDepth) {
                 if (type != XmlPullParser.START_TAG) {
@@ -587,12 +588,14 @@
                 }
                 mValues.clear();
                 mValues.put(Favorites.CONTAINER, folderId);
+                mValues.put(Favorites.RANK, rank);
 
                 TagParser tagParser = mFolderElements.get(parser.getName());
                 if (tagParser != null) {
                     final long id = tagParser.parseAndAdd(parser);
                     if (id >= 0) {
                         folderItems.add(id);
+                        rank++;
                     }
                 } else {
                     throw new RuntimeException("Invalid folder item " + parser.getName());
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 0a20fa4..d576041 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3500,6 +3500,7 @@
                     .commit();
             }
 
+            mAppWidgetHost.setQsbWidgetId(widgetId);
             if (widgetId != -1) {
                 mQsb = mAppWidgetHost.createView(this, widgetId, searchProvider);
                 mQsb.updateAppWidgetOptions(opts);
diff --git a/src/com/android/launcher3/LauncherAppWidgetHost.java b/src/com/android/launcher3/LauncherAppWidgetHost.java
index c274f2e..de7c610 100644
--- a/src/com/android/launcher3/LauncherAppWidgetHost.java
+++ b/src/com/android/launcher3/LauncherAppWidgetHost.java
@@ -22,6 +22,7 @@
 import android.content.Context;
 import android.os.TransactionTooLargeException;
 import android.view.LayoutInflater;
+import android.view.View;
 
 import java.util.ArrayList;
 
@@ -35,16 +36,31 @@
 
     private final ArrayList<Runnable> mProviderChangeListeners = new ArrayList<Runnable>();
 
-    Launcher mLauncher;
+    private int mQsbWidgetId = -1;
+    private Launcher mLauncher;
 
     public LauncherAppWidgetHost(Launcher launcher, int hostId) {
         super(launcher, hostId);
         mLauncher = launcher;
     }
 
+    public void setQsbWidgetId(int widgetId) {
+        mQsbWidgetId = widgetId;
+    }
+
     @Override
     protected AppWidgetHostView onCreateView(Context context, int appWidgetId,
             AppWidgetProviderInfo appWidget) {
+        if (appWidgetId == mQsbWidgetId) {
+            return new LauncherAppWidgetHostView(context) {
+
+                @Override
+                protected View getErrorView() {
+                    // For the QSB, show an empty view instead of an error view.
+                    return new View(getContext());
+                }
+            };
+        }
         return new LauncherAppWidgetHostView(context);
     }