summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/LauncherProvider.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-10-08 13:21:35 +0200
committerMichael Jurka <mikejurka@google.com>2012-10-08 15:53:53 +0200
commit45355c4596f396d7e7247e91de850646356bd104 (patch)
treef847e46f9ef60e7dda14978cbdc139c5f09726d1 /src/com/android/launcher2/LauncherProvider.java
parent914d55501146cf2c3abdf52c021b40fa789d211a (diff)
downloadpackages_apps_trebuchet-45355c4596f396d7e7247e91de850646356bd104.zip
packages_apps_trebuchet-45355c4596f396d7e7247e91de850646356bd104.tar.gz
packages_apps_trebuchet-45355c4596f396d7e7247e91de850646356bd104.tar.bz2
Re-merge "Add support for custom manta cling"
Also, fix issue where mako was crashing because Launcher was trying to load a custom cling for it. It was doing this because a custom home layout was specified by SetupWizard, but for now we only want custom clings on large devices Bug: 7302705 Bug: 6992663 This reverts commit 2ebcf509f038f435ca8819dc098a7cb480bed0d9. Change-Id: I46533309d5c62edfbd3a3b178c6965ffc73b6476
Diffstat (limited to 'src/com/android/launcher2/LauncherProvider.java')
-rw-r--r--src/com/android/launcher2/LauncherProvider.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index 74cf7a4..8097ac9 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -74,6 +74,8 @@ public class LauncherProvider extends ContentProvider {
static final String PARAMETER_NOTIFY = "notify";
static final String DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED =
"DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED";
+ static final String DEFAULT_WORKSPACE_RESOURCE_ID =
+ "DEFAULT_WORKSPACE_RESOURCE_ID";
private static final String ACTION_APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE =
"com.android.launcher.action.APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE";
@@ -206,18 +208,23 @@ public class LauncherProvider extends ContentProvider {
/**
* @param workspaceResId that can be 0 to use default or non-zero for specific resource
*/
- synchronized public void loadDefaultFavoritesIfNecessary(int workspaceResId) {
+ synchronized public void loadDefaultFavoritesIfNecessary(int origWorkspaceResId) {
String spKey = LauncherApplication.getSharedPreferencesKey();
SharedPreferences sp = getContext().getSharedPreferences(spKey, Context.MODE_PRIVATE);
if (sp.getBoolean(DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED, false)) {
+ int workspaceResId = origWorkspaceResId;
+
// Use default workspace resource if none provided
if (workspaceResId == 0) {
- workspaceResId = R.xml.default_workspace;
+ workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace);
}
// Populate favorites table with initial favorites
SharedPreferences.Editor editor = sp.edit();
editor.remove(DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED);
+ if (origWorkspaceResId != 0) {
+ editor.putInt(DEFAULT_WORKSPACE_RESOURCE_ID, origWorkspaceResId);
+ }
mOpenHelper.loadFavorites(mOpenHelper.getWritableDatabase(), workspaceResId);
editor.commit();
}