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

Commit 8bc47ed3 authored by Winson Chung's avatar Winson Chung Committed by Android Git Automerger
Browse files

am d7eb771e: am c164cf2a: am 767df884: Merge "Try and bind search widget...

am d7eb771e: am c164cf2a: am 767df884: Merge "Try and bind search widget before initial calculations of transition rects. (Bug 17456094)" into lmp-dev

* commit 'd7eb771e182bf41be04e664179186c9f7707bbde':
  Try and bind search widget before initial calculations of transition rects. (Bug 17456094)
parents 29768bf5 bb08cfca
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.recents;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
@@ -32,6 +33,7 @@ import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Handler;
import android.os.UserHandle;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import com.android.systemui.R;
@@ -118,6 +120,22 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        // Load the header bar layout
        reloadHeaderBarLayout();
        mBootCompleted = true;

        // Try and pre-emptively bind the search widget on startup to ensure that we
        // have the right thumbnail bounds to animate to.
        if (Constants.DebugFlags.App.EnableSearchLayout) {
            // If there is no id, then bind a new search app widget
            if (mConfig.searchBarAppWidgetId < 0) {
                AppWidgetHost host = new RecentsAppWidgetHost(mContext,
                        Constants.Values.App.AppWidgetHostId);
                Pair<Integer, AppWidgetProviderInfo> widgetInfo =
                        mSystemServicesProxy.bindSearchAppWidget(host);
                if (widgetInfo != null) {
                    // Save the app widget id into the settings
                    mConfig.updateSearchBarAppWidgetId(mContext, widgetInfo.first);
                }
            }
        }
    }

    /** Shows the recents */