summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson <winsonc@google.com>2015-08-05 21:00:45 (GMT)
committerWinson Chung <winsonc@google.com>2015-08-05 21:18:53 (GMT)
commita1f79d3e16362d16c06b18fd5a06d93be9bbf1fd (patch)
tree912742b9c38d5543051c9c4ebd58aa380f9f8919
parentd1ea63f24a751521e6c35cc06be0e548e0b04f23 (diff)
downloadandroid_packages_apps_Trebuchet-a1f79d3e16362d16c06b18fd5a06d93be9bbf1fd.zip
android_packages_apps_Trebuchet-a1f79d3e16362d16c06b18fd5a06d93be9bbf1fd.tar.gz
android_packages_apps_Trebuchet-a1f79d3e16362d16c06b18fd5a06d93be9bbf1fd.tar.bz2
Fixing invisible search bar
- We used to rely on the state transition to inflate the search widget after the permission to bind widgets was granted, which is fragile. Now we try and inflate the search widget after user grants the permission if necessary. Bug: 22515084 Bug: 22980143 Change-Id: Id111d263bc8a864e0fa652cfd0e07e66ec690fe7
-rw-r--r--src/com/android/launcher3/Launcher.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 9d04770..32e7ee6 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -742,6 +742,7 @@ public class Launcher extends Activity
};
if (requestCode == REQUEST_BIND_APPWIDGET) {
+ // This is called only if the user did not previously have permissions to bind widgets
final int appWidgetId = data != null ?
data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1) : -1;
if (resultCode == RESULT_CANCELED) {
@@ -751,6 +752,10 @@ public class Launcher extends Activity
} else if (resultCode == RESULT_OK) {
addAppWidgetImpl(appWidgetId, mPendingAddInfo, null,
mPendingAddWidgetInfo, ON_ACTIVITY_RESULT_ANIMATION_DELAY);
+
+ // When the user has granted permission to bind widgets, we should check to see if
+ // we can inflate the default search bar widget.
+ getOrCreateQsbBar();
}
return;
} else if (requestCode == REQUEST_PICK_WALLPAPER) {