summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-05-06 17:06:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-06 17:06:20 -0700
commit04cb48f465e7a9382efa9438ef9826ba5bcb416d (patch)
treed44a211c021ce84cc192174d4c049ee71c5dcc87 /src/com
parent3ed802de77e9847b45074f206a4ac310257f894e (diff)
parent2672ff937ea7885d184679dfee9f355b7bf2fc7d (diff)
downloadandroid_packages_apps_Trebuchet-04cb48f465e7a9382efa9438ef9826ba5bcb416d.tar.gz
android_packages_apps_Trebuchet-04cb48f465e7a9382efa9438ef9826ba5bcb416d.tar.bz2
android_packages_apps_Trebuchet-04cb48f465e7a9382efa9438ef9826ba5bcb416d.zip
Merge "Adding workaround to allow shortcuts to skip the launch animation. (Bug 6447372)" into jb-dev
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher2/Launcher.java12
-rw-r--r--src/com/android/launcher2/LauncherProvider.java11
2 files changed, 16 insertions, 7 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index ff8e78594..8b6fee92d 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -33,8 +33,6 @@ import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
-import android.content.ClipData;
-import android.content.ClipDescription;
import android.content.ComponentCallbacks2;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -144,6 +142,10 @@ public final class Launcher extends Activity
private static final String PREFERENCES = "launcher.preferences";
static final String FORCE_ENABLE_ROTATION_PROPERTY = "launcher.force_enable_rotation";
+ // The Intent extra that defines whether to ignore the launch animation
+ static final String INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION =
+ "com.android.launcher.intent.extra.shortcut.INGORE_LAUNCH_ANIMATION";
+
// Type: int
private static final String RUNTIME_STATE_CURRENT_SCREEN = "launcher.current_screen";
// Type: int
@@ -1907,7 +1909,11 @@ public final class Launcher extends Activity
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
- if (v != null) {
+ // Only launch using the new animation if the shortcut has not opted out (this is a
+ // private contract between launcher and may be ignored in the future).
+ boolean useLaunchAnimation = (v != null) &&
+ !intent.hasExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION);
+ if (useLaunchAnimation) {
ActivityOptions opts = ActivityOptions.makeScaleUpAnimation(v, 0, 0,
v.getMeasuredWidth(), v.getMeasuredHeight());
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index 5e572a575..4cf87d2b4 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 = 10;
+ private static final int DATABASE_VERSION = 11;
static final String AUTHORITY = "com.android.launcher2.settings";
@@ -477,12 +477,14 @@ public class LauncherProvider extends ContentProvider {
version = 9;
}
- if (version < 10) {
+ // 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) {
// 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 = 10;
+ version = 11;
}
if (version != DATABASE_VERSION) {
@@ -535,7 +537,8 @@ public class LauncherProvider extends ContentProvider {
// detail activities.
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TASK);
-
+ newIntent.putExtra(
+ Launcher.INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION, true);
newIntent.setData(uri);
final ContentValues values = new ContentValues();