summaryrefslogtreecommitdiffstats
path: root/robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-12-07 11:43:47 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-12-10 11:43:35 -0800
commitc5939393a92e3a07fbd6e17527b8b2a1d108f1d7 (patch)
treeda3dc6b9b4e87ffd670d9828de485a77f3f2b1a1 /robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
parent415f17333123eb40e7677cf0766f59e7af3f7418 (diff)
downloadandroid_packages_apps_Trebuchet-c5939393a92e3a07fbd6e17527b8b2a1d108f1d7.tar.gz
android_packages_apps_Trebuchet-c5939393a92e3a07fbd6e17527b8b2a1d108f1d7.tar.bz2
android_packages_apps_Trebuchet-c5939393a92e3a07fbd6e17527b8b2a1d108f1d7.zip
Bye bye workspace screens table
Removing a separate table for workspace screens. List of screens are automatically parsed using the items in the favorites DB. Order of the screen based on the screen id and rearranging screens is no longer supported. In case the screens need to be rearranged, all the items in the favorites db will need to be updated with new screen ids. This makes backing up the DB (in the same database) easier as only one table needs to be duplicates. Change-Id: I8ba947a898f637d780e2f49925e78604263126e8
Diffstat (limited to 'robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java')
-rw-r--r--robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java b/robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
index 67580ddd8..d4188aa8e 100644
--- a/robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
+++ b/robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
@@ -1,5 +1,7 @@
package com.android.launcher3.model;
+import static com.android.launcher3.model.GridSizeMigrationTask.getWorkspaceScreenIds;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -10,7 +12,6 @@ import android.database.Cursor;
import android.graphics.Point;
import com.android.launcher3.InvariantDeviceProfile;
-import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherProvider;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.config.FlagOverrideRule;
@@ -55,7 +56,6 @@ public class GridSizeMigrationTaskTest {
@Before
public void setUp() {
-
mValidPackages = new HashSet<>();
mValidPackages.add(TEST_PACKAGE);
mIdp = new InvariantDeviceProfile();
@@ -307,11 +307,6 @@ public class GridSizeMigrationTaskTest {
LauncherSettings.Settings.call(mContext.getContentResolver(),
LauncherSettings.Settings.METHOD_NEW_SCREEN_ID);
- ContentValues v = new ContentValues();
- v.put(LauncherSettings.WorkspaceScreens._ID, screenId);
- v.put(LauncherSettings.WorkspaceScreens.SCREEN_RANK, i);
- mContext.getContentResolver().insert(LauncherSettings.WorkspaceScreens.CONTENT_URI, v);
-
ids[i] = new int[typeArray[i].length][];
for (int y = 0; y < typeArray[i].length; y++) {
ids[i][y] = new int[typeArray[i][y].length];
@@ -326,7 +321,6 @@ public class GridSizeMigrationTaskTest {
}
}
- IntArray allScreens = LauncherModel.loadWorkspaceScreensDb(mContext);
return ids;
}
@@ -336,7 +330,7 @@ public class GridSizeMigrationTaskTest {
* represent the workspace grid.
*/
private void verifyWorkspace(int[][][] ids) {
- IntArray allScreens = LauncherModel.loadWorkspaceScreensDb(mContext);
+ IntArray allScreens = getWorkspaceScreenIds(mContext);
assertEquals(ids.length, allScreens.size());
int total = 0;