diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-12-23 14:25:45 +0000 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-24 10:04:49 +0000 |
commit | fff81cad6963dfa977fa8063efa3d29797d9d8c2 (patch) | |
tree | e43abf973d2bdbccf2778df871a554464f5aabc2 /src/com/cyanogenmod/trebuchet/LauncherProvider.java | |
parent | 10a908a32cab20d5fc0ee944a3b34b98a9648f68 (diff) | |
download | packages_apps_trebuchet-fff81cad6963dfa977fa8063efa3d29797d9d8c2.zip packages_apps_trebuchet-fff81cad6963dfa977fa8063efa3d29797d9d8c2.tar.gz packages_apps_trebuchet-fff81cad6963dfa977fa8063efa3d29797d9d8c2.tar.bz2 |
Launcher actions
Change-Id: Ica0699f99d68b9f89d6f103eaadc56e632d87101
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/LauncherProvider.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/LauncherProvider.java | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/com/cyanogenmod/trebuchet/LauncherProvider.java b/src/com/cyanogenmod/trebuchet/LauncherProvider.java index 3d90922..e4227c3 100644 --- a/src/com/cyanogenmod/trebuchet/LauncherProvider.java +++ b/src/com/cyanogenmod/trebuchet/LauncherProvider.java @@ -66,7 +66,7 @@ public class LauncherProvider extends ContentProvider { private static final String DATABASE_NAME = "launcher.db"; - private static final int DATABASE_VERSION = 12; + private static final int DATABASE_VERSION = 13; static final String AUTHORITY = "com.cyanogenmod.trebuchet.settings"; @@ -480,18 +480,6 @@ public class LauncherProvider extends ContentProvider { version = 8; } - if (version < 9) { - // The max id is not yet set at this point (onUpgrade is triggered in the ctor - // before it gets a change to get set, so we need to read it here when we use it) - if (mMaxId == -1) { - mMaxId = initializeMaxId(db); - } - - // Add default hotseat icons - loadFavorites(db, R.xml.update_workspace); - version = 9; - } - // We bumped the version three time during JB, once to update the launch flags, once to // update the override for the default launch animation and once to set the mimetype // to improve startup performance @@ -503,6 +491,18 @@ public class LauncherProvider extends ContentProvider { version = 12; } + if (version < 13) { + // The max id is not yet set at this point (onUpgrade is triggered in the ctor + // before it gets a change to get set, so we need to read it here when we use it) + if (mMaxId == -1) { + mMaxId = initializeMaxId(db); + } + + // Add default hotseat icons + loadFavorites(db, R.xml.update_workspace); + version = 13; + } + if (version != DATABASE_VERSION) { Log.w(TAG, "Destroying all old data."); db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES); @@ -825,14 +825,6 @@ public class LauncherProvider extends ContentProvider { String x = a.getString(R.styleable.Favorite_x); String y = a.getString(R.styleable.Favorite_y); - // If we are adding to the hotseat, the screen is used as the position in the - // hotseat. This screen can't be at position 0 because AllApps is in the - // zeroth position. - if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT - && Integer.valueOf(screen) == allAppsButtonRank) { - throw new RuntimeException("Invalid screen position for hotseat item"); - } - values.clear(); values.put(LauncherSettings.Favorites.CONTAINER, container); values.put(LauncherSettings.Favorites.SCREEN, screen); |