diff options
author | Vadim Tryshev <vadimt@google.com> | 2019-02-04 18:36:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-02-04 18:36:29 +0000 |
commit | 3775fe8a22a923892621e97a9cf28d02f3f339f1 (patch) | |
tree | 178205745d74f9b654736113481bfc8379b50e05 | |
parent | 2c3aa0c0cf50931ab26bf9ad34ce82a627ff4776 (diff) | |
parent | bff4842c234ce0f4472bc2ef90e11370049dc5a2 (diff) | |
download | android_packages_apps_Trebuchet-3775fe8a22a923892621e97a9cf28d02f3f339f1.tar.gz android_packages_apps_Trebuchet-3775fe8a22a923892621e97a9cf28d02f3f339f1.tar.bz2 android_packages_apps_Trebuchet-3775fe8a22a923892621e97a9cf28d02f3f339f1.zip |
Merge "Removing unnecessarily requiring activity to be a launcher" into ub-launcher3-master
-rw-r--r-- | src/com/android/launcher3/popup/RemoteActionShortcut.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/launcher3/popup/RemoteActionShortcut.java b/src/com/android/launcher3/popup/RemoteActionShortcut.java index 3e124290a..f8b62427c 100644 --- a/src/com/android/launcher3/popup/RemoteActionShortcut.java +++ b/src/com/android/launcher3/popup/RemoteActionShortcut.java @@ -26,12 +26,12 @@ import android.view.View; import android.widget.Toast; import com.android.launcher3.AbstractFloatingView; +import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.ItemInfo; -import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.userevent.nano.LauncherLogProto; -public class RemoteActionShortcut extends SystemShortcut<Launcher> { +public class RemoteActionShortcut extends SystemShortcut<BaseDraggingActivity> { private static final String TAG = "RemoteActionShortcut"; private final RemoteAction mAction; @@ -44,13 +44,13 @@ public class RemoteActionShortcut extends SystemShortcut<Launcher> { @Override public View.OnClickListener getOnClickListener( - final Launcher launcher, final ItemInfo itemInfo) { + final BaseDraggingActivity activity, final ItemInfo itemInfo) { return view -> { - AbstractFloatingView.closeAllOpenViews(launcher); + AbstractFloatingView.closeAllOpenViews(activity); try { mAction.getActionIntent().send( - launcher, + activity, 0, new Intent().putExtra( Intent.EXTRA_PACKAGE_NAME, @@ -59,20 +59,20 @@ public class RemoteActionShortcut extends SystemShortcut<Launcher> { if (resultData != null && !resultData.isEmpty()) { Log.e(TAG, "Remote action returned result: " + mAction.getTitle() + " : " + resultData); - Toast.makeText(launcher, resultData, Toast.LENGTH_SHORT).show(); + Toast.makeText(activity, resultData, Toast.LENGTH_SHORT).show(); } }, new Handler(Looper.getMainLooper())); } catch (PendingIntent.CanceledException e) { Log.e(TAG, "Remote action canceled: " + mAction.getTitle(), e); - Toast.makeText(launcher, launcher.getString( + Toast.makeText(activity, activity.getString( R.string.remote_action_failed, mAction.getTitle()), Toast.LENGTH_SHORT) .show(); } - launcher.getUserEventDispatcher().logActionOnControl(LauncherLogProto.Action.Touch.TAP, + activity.getUserEventDispatcher().logActionOnControl(LauncherLogProto.Action.Touch.TAP, LauncherLogProto.ControlType.REMOTE_ACTION_SHORTCUT, view); }; } |