Changing default screen to 0

Change-Id: I16b2440f99d4b91a3a74226cdac7054e7d5fd7f5
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index 02cde57..44c0c05 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -39,7 +39,7 @@
             android:paddingEnd="@dimen/workspace_right_padding"
             android:paddingTop="@dimen/workspace_top_padding"
             android:paddingBottom="@dimen/workspace_bottom_padding"
-            launcher:defaultScreen="2"
+            launcher:defaultScreen="@integer/config_workspaceDefaultScreen"
             launcher:cellCountX="@integer/cell_count_x"
             launcher:cellCountY="@integer/cell_count_y"
             launcher:pageSpacing="@dimen/workspace_page_spacing"
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index 780f436..0a20e88 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -57,7 +57,7 @@
             android:paddingEnd="@dimen/workspace_right_padding"
             android:paddingTop="@dimen/workspace_top_padding"
             android:paddingBottom="@dimen/workspace_bottom_padding"
-            launcher:defaultScreen="2"
+            launcher:defaultScreen="@integer/config_workspaceDefaultScreen"
             launcher:cellCountX="@integer/cell_count_x"
             launcher:cellCountY="@integer/cell_count_y"
             launcher:pageSpacing="@dimen/workspace_page_spacing"
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index d798aff..156b8c3 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -57,7 +57,7 @@
             android:paddingEnd="@dimen/workspace_right_padding"
             android:paddingTop="@dimen/workspace_top_padding"
             android:paddingBottom="@dimen/workspace_bottom_padding"
-            launcher:defaultScreen="2"
+            launcher:defaultScreen="@integer/config_workspaceDefaultScreen"
             launcher:cellCountX="@integer/cell_count_x"
             launcher:cellCountY="@integer/cell_count_y"
             launcher:pageSpacing="@dimen/workspace_page_spacing"
diff --git a/res/values/config.xml b/res/values/config.xml
index 4aec434..d4f8185 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -24,6 +24,8 @@
     <integer name="config_appsCustomizeWorkspaceAnimationStagger">40</integer>
     <integer name="config_workspaceAppsCustomizeAnimationStagger">100</integer>
 
+    <integer name="config_workspaceDefaultScreen">0</integer>
+
     <!-- Tab transition animation duration -->
     <integer name="config_tabTransitionDuration">250</integer>
 
diff --git a/src/com/android/launcher3/InstallShortcutReceiver.java b/src/com/android/launcher3/InstallShortcutReceiver.java
index a0ea93b..d61cec0 100644
--- a/src/com/android/launcher3/InstallShortcutReceiver.java
+++ b/src/com/android/launcher3/InstallShortcutReceiver.java
@@ -253,8 +253,8 @@
             // Try adding to the workspace screens incrementally, starting at the default or center
             // screen and alternating between +1, -1, +2, -2, etc. (using ~ ceil(i/2f)*(-1)^(i-1))
             final int screen = Launcher.DEFAULT_SCREEN;
-            for (int i = 0; i < (2 * Launcher.SCREEN_COUNT) + 1 && !found; ++i) {
-                int si = screen + (int) ((i / 2f) + 0.5f) * ((i % 2 == 1) ? 1 : -1);
+            for (int i = 0; i < Launcher.SCREEN_COUNT; i++) {
+                int si = i;
                 if (0 <= si && si < Launcher.SCREEN_COUNT) {
                     found = installShortcut(context, data, items, name, intent, si, exists, sp,
                             result);