Merge "Preventing unnecessary options update to QSB provider by checking if the options have changed before calling update" into ub-launcher3-calgary

This commit is contained in:
Sunny Goyal
2016-05-19 22:54:22 +00:00
committed by Android (Google) Code Review
2 changed files with 26 additions and 1 deletions
+6 -1
View File
@@ -3552,7 +3552,12 @@ public class Launcher extends Activity
if (widgetId != -1) {
mQsb = mAppWidgetHost.createView(this, widgetId, searchProvider);
mQsb.setId(R.id.qsb_widget);
mQsb.updateAppWidgetOptions(opts);
if (!Utilities.containsAll(
AppWidgetManager.getInstance(this).getAppWidgetOptions(widgetId), opts)) {
// Launcher should not be updating the options often.
FileLog.d(TAG, "Options for QSB were not same");
mQsb.updateAppWidgetOptions(opts);
}
mQsb.setPadding(0, 0, 0, 0);
mSearchDropTargetBar.addView(mQsb);
mSearchDropTargetBar.setQsbSearchBar(mQsb);