OSDN Git Service

Add LauncherCallbacks method to add additional search widget options.
authorTony Wickham <twickham@google.com>
Fri, 16 Oct 2015 16:49:32 +0000 (09:49 -0700)
committerTony Wickham <twickham@google.com>
Fri, 16 Oct 2015 17:15:36 +0000 (10:15 -0700)
Bug: 25000458
Change-Id: I5e8d48617568569bc6e4f284749c3ed9fb20a68f

src/com/android/launcher3/Launcher.java
src/com/android/launcher3/LauncherCallbacks.java
src/com/android/launcher3/testing/LauncherExtension.java

index 3b1ee2a..9c321a8 100644 (file)
@@ -3553,6 +3553,10 @@ public class Launcher extends Activity
             opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, maxWidth);
             opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, minWidth);
 
+            if (mLauncherCallbacks != null) {
+                opts.putAll(mLauncherCallbacks.getAdditionalSearchWidgetOptions());
+            }
+
             SharedPreferences sp = getSharedPreferences(
                     LauncherAppState.getSharedPreferencesKey(), MODE_PRIVATE);
             int widgetId = sp.getInt(QSB_WIDGET_ID, -1);
index 927db22..f27ed1d 100644 (file)
@@ -83,6 +83,7 @@ public interface LauncherCallbacks {
     public boolean hasCustomContentToLeft();
     public void populateCustomContentContainer();
     public View getQsbBar();
+    public Bundle getAdditionalSearchWidgetOptions();
 
     /*
      * Extensions points for adding / replacing some other aspects of the Launcher experience.
index 3364fcc..1bb5787 100644 (file)
@@ -253,6 +253,11 @@ public class LauncherExtension extends Launcher {
         }
 
         @Override
+        public Bundle getAdditionalSearchWidgetOptions() {
+            return new Bundle();
+        }
+
+        @Override
         public Intent getFirstRunActivity() {
             return null;
         }