summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherBackupHelper.java
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2014-11-24 16:57:54 -0500
committerChris Wren <cwren@android.com>2014-11-24 16:57:54 -0500
commitb02e611d15bd6fbb05814adaa804dd68181c556c (patch)
tree26b4e38c8c5e67263e67d36de3ec244c753082c0 /src/com/android/launcher3/LauncherBackupHelper.java
parentab6527da412bf944df08429c697f5fcf94f8bb52 (diff)
downloadandroid_packages_apps_Trebuchet-b02e611d15bd6fbb05814adaa804dd68181c556c.tar.gz
android_packages_apps_Trebuchet-b02e611d15bd6fbb05814adaa804dd68181c556c.tar.bz2
android_packages_apps_Trebuchet-b02e611d15bd6fbb05814adaa804dd68181c556c.zip
Don't try to create an app state instance during restore.
Added a static utility function to get the DeviceProfile instead. Bug: 18504164 Change-Id: Ia510a84f1c195e58acf3bf4d1f6a42c739fdd413
Diffstat (limited to 'src/com/android/launcher3/LauncherBackupHelper.java')
-rw-r--r--src/com/android/launcher3/LauncherBackupHelper.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/com/android/launcher3/LauncherBackupHelper.java b/src/com/android/launcher3/LauncherBackupHelper.java
index c260fbc33..437434748 100644
--- a/src/com/android/launcher3/LauncherBackupHelper.java
+++ b/src/com/android/launcher3/LauncherBackupHelper.java
@@ -371,16 +371,9 @@ public class LauncherBackupHelper implements BackupHelper {
if (mCurrentProfile != null) {
return mCurrentProfile;
}
- LauncherAppState.setApplicationContext(mContext.getApplicationContext());
- LauncherAppState app = LauncherAppState.getInstance();
-
- DeviceProfile profile;
- if (app.getDynamicGrid() == null) {
- // Initialize the grid
- profile = app.initDynamicGrid(mContext);
- } else {
- profile = app.getDynamicGrid().getDeviceProfile();
- }
+ final Context applicationContext = mContext.getApplicationContext();
+ DeviceProfile profile = LauncherAppState.createDynamicGrid(applicationContext, null)
+ .getDeviceProfile();
mCurrentProfile = new DeviceProfieData();
mCurrentProfile.desktopRows = profile.numRows;