From d02402cb141d5f7838a10a400926e0dfcee2783f Mon Sep 17 00:00:00 2001 From: Daniel Lehmann Date: Mon, 14 May 2012 18:30:53 -0700 Subject: Preset type; contact shortcuts are now launched w/o provider invocation Bug:6434853 Change-Id: I2fb9773713136d11d478936095ebad4a5302a9e1 --- src/com/android/launcher2/LauncherProvider.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java index 4cf87d2b4..67b558da4 100644 --- a/src/com/android/launcher2/LauncherProvider.java +++ b/src/com/android/launcher2/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 = 11; + private static final int DATABASE_VERSION = 12; static final String AUTHORITY = "com.android.launcher2.settings"; @@ -477,14 +477,15 @@ public class LauncherProvider extends ContentProvider { version = 9; } - // We bumped the version twice during JB, once to update the launch flags, and once to - // update the override for the default launch animation. - if (version < 11) { + // 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 + if (version < 12) { // Contact shortcuts need a different set of flags to be launched now // The updateContactsShortcuts change is idempotent, so we can keep using it like // back in the Donut days updateContactsShortcuts(db); - version = 11; + version = 12; } if (version != DATABASE_VERSION) { @@ -540,6 +541,9 @@ public class LauncherProvider extends ContentProvider { newIntent.putExtra( Launcher.INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION, true); newIntent.setData(uri); + // Determine the type and also put that in the shortcut + // (that can speed up launch a bit) + newIntent.setDataAndType(uri, newIntent.resolveType(mContext)); final ContentValues values = new ContentValues(); values.put(LauncherSettings.Favorites.INTENT, -- cgit v1.2.3