OSDN Git Service

Only import workspaces for non-tablets (where grid hasn't changed)
authorAdam Cohen <adamcohen@google.com>
Tue, 3 Dec 2013 01:00:14 +0000 (17:00 -0800)
committerAdam Cohen <adamcohen@google.com>
Tue, 3 Dec 2013 01:02:36 +0000 (17:02 -0800)
Change-Id: I832b6259477d6325c141fddfe9b50cb05aeff8d2

src/com/android/launcher3/LauncherProvider.java

index 4eb30e7..54de635 100644 (file)
@@ -290,6 +290,13 @@ public class LauncherProvider extends ContentProvider {
         public void onRow(ContentValues values);
     }
 
+    private static boolean shouldImportLauncher2Database(Context context) {
+        boolean isTablet = context.getResources().getBoolean(R.bool.is_tablet);
+
+        // We don't import the old databse for tablets, as the grid size has changed.
+        return !isTablet && IMPORT_LAUNCHER2_DATABASE;
+    }
+
     private static class DatabaseHelper extends SQLiteOpenHelper {
         private static final String TAG_FAVORITES = "favorites";
         private static final String TAG_FAVORITE = "favorite";
@@ -369,7 +376,7 @@ public class LauncherProvider extends ContentProvider {
                 sendAppWidgetResetNotify();
             }
 
-            if (IMPORT_LAUNCHER2_DATABASE) {
+            if (shouldImportLauncher2Database(mContext)) {
                 // Try converting the old database
                 ContentValuesCallback permuteScreensCb = new ContentValuesCallback() {
                     public void onRow(ContentValues values) {