Adding workaround to allow shortcuts to skip the launch animation. (Bug 6447372)
Change-Id: Ic6e985ea0e9c70044b47279dc9e8886f8fec0507
This commit is contained in:
1 parent
8e21bc5411
commit
2672ff937e
2 files changed
+16
-7
No files matched your search
@@ -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
|
||||
@@ -1890,7 +1892,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());
|
||||
|
||||
|
||||
Reference in new issue
Block a user