Merge "Lazily instantiate LauncherAppState." into jb-ub-gel-agar
diff --git a/res/layout/workspace_custom_content.xml b/res/layout/workspace_custom_content.xml
deleted file mode 100644
index 6497685..0000000
--- a/res/layout/workspace_custom_content.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<com.android.launcher3.CellLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
-
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:paddingStart="0dp"
-    android:paddingEnd="0dp"
-    android:paddingTop="0dp"
-    android:paddingBottom="0dp"
-    android:hapticFeedbackEnabled="false"
-
-    launcher:cellWidth="@dimen/workspace_cell_width"
-    launcher:cellHeight="@dimen/workspace_cell_height"
-    launcher:widthGap="@dimen/workspace_width_gap"
-    launcher:heightGap="@dimen/workspace_height_gap"
-    launcher:maxGap="@dimen/workspace_max_gap" />
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 40e44d1..3a9b2c1 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -106,11 +106,10 @@
     static final String TAG = "Launcher";
     static final boolean LOGD = false;
 
-    static final boolean PROFILE_STARTUP = true;
+    static final boolean PROFILE_STARTUP = false;
     static final boolean DEBUG_WIDGETS = false;
     static final boolean DEBUG_STRICT_MODE = false;
-    static final boolean DEBUG_RESUME_TIME = true;
-    static final boolean DEBUG_MEMORY = true;
+    static final boolean DEBUG_RESUME_TIME = false;
 
     private static final int MENU_GROUP_WALLPAPER = 1;
     private static final int MENU_WALLPAPER_SETTINGS = Menu.FIRST + 1;
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index af94a1a..9ee69be 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -511,7 +511,7 @@
 
     public void addCustomContentToLeft(View customContent) {
         CellLayout customScreen = (CellLayout)
-                mLauncher.getLayoutInflater().inflate(R.layout.workspace_custom_content, null);
+                mLauncher.getLayoutInflater().inflate(R.layout.workspace_screen, null);
 
         int spanX = customScreen.getCountX();
         int spanY = customScreen.getCountY();
@@ -521,6 +521,10 @@
 
         customScreen.addViewToCellLayout(customContent, 0, 0, lp, true);
 
+        Rect p = new Rect();
+        AppWidgetHostView.getDefaultPaddingForWidget(mLauncher, mLauncher.getComponentName(), p);
+        customContent.setPadding(p.left, p.top, p.right, p.bottom);
+
         addView(customScreen, 0);
 
         mWorkspaceScreens.put(CUSTOM_CONTENT_SCREEN_ID, customScreen);