summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-08-16 04:59:08 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-09-13 14:04:35 -0700
commit952e63d0065d79d2bd9557ed7f28e96adb39ca9a (patch)
tree3f07803d9731a9c56ee7c0d707385b0272966e6b /tests
parentbe213def874f580a58b2ee4a94ba503a6d7e3f15 (diff)
downloadandroid_packages_apps_Trebuchet-952e63d0065d79d2bd9557ed7f28e96adb39ca9a.tar.gz
android_packages_apps_Trebuchet-952e63d0065d79d2bd9557ed7f28e96adb39ca9a.tar.bz2
android_packages_apps_Trebuchet-952e63d0065d79d2bd9557ed7f28e96adb39ca9a.zip
Fixing custom widgets support:
> Moving the definitions to xml so that it is easier to override in derivative projects > Fixing verious bind and save logic for custom widgets > Adding feature flag to easily disable custom widgets Change-Id: I0e278bc7dd415713029364060ef10842da990be9
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java
index d4d517a22..87103d713 100644
--- a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java
@@ -16,6 +16,7 @@
package com.android.launcher3.ui.widget;
import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.ContentValues;
@@ -171,8 +172,9 @@ public class BindWidgetTest extends AbstractLauncherUiTest {
// Widget has a valid Id now.
assertEquals(0, mCursor.getInt(mCursor.getColumnIndex(LauncherSettings.Favorites.RESTORED))
& LauncherAppWidgetInfo.FLAG_ID_NOT_VALID);
- assertNotNull(mWidgetManager.getAppWidgetInfo(mCursor.getInt(mCursor.getColumnIndex(
- LauncherSettings.Favorites.APPWIDGET_ID))));
+ assertNotNull(AppWidgetManager.getInstance(mTargetContext)
+ .getAppWidgetInfo(mCursor.getInt(mCursor.getColumnIndex(
+ LauncherSettings.Favorites.APPWIDGET_ID))));
}
@Test
@@ -297,7 +299,7 @@ public class BindWidgetTest extends AbstractLauncherUiTest {
item.spanY = info.minSpanY;
item.minSpanX = info.minSpanX;
item.minSpanY = info.minSpanY;
- item.user = info.getUser();
+ item.user = info.getProfile();
item.cellX = 0;
item.cellY = 1;
item.container = LauncherSettings.Favorites.CONTAINER_DESKTOP;