Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 775455c4 authored by Tony Wickham's avatar Tony Wickham
Browse files

Add LauncherCallbacks method to add additional search widget options.

Bug: 25000458
Change-Id: I5e8d48617568569bc6e4f284749c3ed9fb20a68f
parent 28c6b963
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -3553,6 +3553,10 @@ public class Launcher extends Activity
            opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, maxWidth);
            opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, maxWidth);
            opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, minWidth);
            opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, minWidth);


            if (mLauncherCallbacks != null) {
                opts.putAll(mLauncherCallbacks.getAdditionalSearchWidgetOptions());
            }

            SharedPreferences sp = getSharedPreferences(
            SharedPreferences sp = getSharedPreferences(
                    LauncherAppState.getSharedPreferencesKey(), MODE_PRIVATE);
                    LauncherAppState.getSharedPreferencesKey(), MODE_PRIVATE);
            int widgetId = sp.getInt(QSB_WIDGET_ID, -1);
            int widgetId = sp.getInt(QSB_WIDGET_ID, -1);
+1 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,7 @@ public interface LauncherCallbacks {
    public boolean hasCustomContentToLeft();
    public boolean hasCustomContentToLeft();
    public void populateCustomContentContainer();
    public void populateCustomContentContainer();
    public View getQsbBar();
    public View getQsbBar();
    public Bundle getAdditionalSearchWidgetOptions();


    /*
    /*
     * Extensions points for adding / replacing some other aspects of the Launcher experience.
     * Extensions points for adding / replacing some other aspects of the Launcher experience.
+5 −0
Original line number Original line Diff line number Diff line
@@ -252,6 +252,11 @@ public class LauncherExtension extends Launcher {
            return mLauncherOverlay.getSearchBox();
            return mLauncherOverlay.getSearchBox();
        }
        }


        @Override
        public Bundle getAdditionalSearchWidgetOptions() {
            return new Bundle();
        }

        @Override
        @Override
        public Intent getFirstRunActivity() {
        public Intent getFirstRunActivity() {
            return null;
            return null;