Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 1 | package com.android.launcher3; |
| 2 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 3 | import static android.appwidget.AppWidgetManager.INVALID_APPWIDGET_ID; |
| 4 | import static android.appwidget.AppWidgetProviderInfo.WIDGET_FEATURE_RECONFIGURABLE; |
| 5 | |
Sunny Goyal | 076839c | 2017-10-30 13:52:20 -0700 | [diff] [blame] | 6 | import static com.android.launcher3.ItemInfoWithIcon.FLAG_SYSTEM_MASK; |
| 7 | import static com.android.launcher3.ItemInfoWithIcon.FLAG_SYSTEM_NO; |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 8 | import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP; |
| 9 | import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.RECONFIGURE; |
| 10 | import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.UNINSTALL; |
| 11 | import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.SETTINGS_BUTTON; |
| 12 | import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.UNINSTALL_TARGET; |
Sunny Goyal | 076839c | 2017-10-30 13:52:20 -0700 | [diff] [blame] | 13 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 14 | import android.appwidget.AppWidgetHostView; |
| 15 | import android.appwidget.AppWidgetManager; |
| 16 | import android.appwidget.AppWidgetProviderInfo; |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 17 | import android.content.ComponentName; |
| 18 | import android.content.Context; |
Sunny Goyal | d5bd67d | 2016-03-11 01:10:19 -0800 | [diff] [blame] | 19 | import android.content.Intent; |
Sunny Goyal | 8e0e1d7 | 2016-10-10 10:41:41 -0700 | [diff] [blame] | 20 | import android.content.pm.ApplicationInfo; |
Sunny Goyal | 3e9be43 | 2017-01-05 15:22:41 -0800 | [diff] [blame] | 21 | import android.content.pm.LauncherActivityInfo; |
Sunny Goyal | f2db253 | 2017-03-01 17:27:16 -0800 | [diff] [blame] | 22 | import android.content.pm.PackageManager; |
Sunny Goyal | d5bd67d | 2016-03-11 01:10:19 -0800 | [diff] [blame] | 23 | import android.net.Uri; |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 24 | import android.os.Bundle; |
Sunny Goyal | 7c74e4a | 2016-12-15 15:53:17 -0800 | [diff] [blame] | 25 | import android.os.UserHandle; |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 26 | import android.os.UserManager; |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 27 | import android.util.ArrayMap; |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 28 | import android.util.AttributeSet; |
Jon Miranda | c56e3ff | 2017-08-23 12:13:24 -0700 | [diff] [blame] | 29 | import android.util.Log; |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 30 | import android.view.View; |
Sunny Goyal | d5bd67d | 2016-03-11 01:10:19 -0800 | [diff] [blame] | 31 | import android.widget.Toast; |
Sunny Goyal | aa8ef11 | 2015-06-12 20:04:41 -0700 | [diff] [blame] | 32 | |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 33 | import com.android.launcher3.Launcher.OnResumeCallback; |
Sunny Goyal | 8e0e1d7 | 2016-10-10 10:41:41 -0700 | [diff] [blame] | 34 | import com.android.launcher3.compat.LauncherAppsCompat; |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 35 | import com.android.launcher3.dragndrop.DragOptions; |
| 36 | import com.android.launcher3.userevent.nano.LauncherLogProto.Target; |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 37 | import com.android.launcher3.util.Themes; |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 38 | |
Jon Miranda | c56e3ff | 2017-08-23 12:13:24 -0700 | [diff] [blame] | 39 | import java.net.URISyntaxException; |
| 40 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 41 | /** |
| 42 | * Drop target which provides a secondary option for an item. |
| 43 | * For app targets: shows as uninstall |
| 44 | * For configurable widgets: shows as setup |
| 45 | */ |
| 46 | public class SecondaryDropTarget extends ButtonDropTarget implements OnAlarmListener { |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 47 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 48 | private static final String TAG = "SecondaryDropTarget"; |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 49 | |
| 50 | private static final long CACHE_EXPIRE_TIMEOUT = 5000; |
| 51 | private final ArrayMap<UserHandle, Boolean> mUninstallDisabledCache = new ArrayMap<>(1); |
| 52 | |
| 53 | private final Alarm mCacheExpireAlarm; |
Jon Miranda | c56e3ff | 2017-08-23 12:13:24 -0700 | [diff] [blame] | 54 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 55 | private int mCurrentAccessibilityAction = -1; |
| 56 | public SecondaryDropTarget(Context context, AttributeSet attrs) { |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 57 | this(context, attrs, 0); |
| 58 | } |
| 59 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 60 | public SecondaryDropTarget(Context context, AttributeSet attrs, int defStyle) { |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 61 | super(context, attrs, defStyle); |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 62 | |
| 63 | mCacheExpireAlarm = new Alarm(); |
| 64 | mCacheExpireAlarm.setOnAlarmListener(this); |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | @Override |
| 68 | protected void onFinishInflate() { |
| 69 | super.onFinishInflate(); |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 70 | setupUi(UNINSTALL); |
Sunny Goyal | da1dfa3 | 2017-04-26 22:34:49 -0700 | [diff] [blame] | 71 | } |
| 72 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 73 | private void setupUi(int action) { |
| 74 | if (action == mCurrentAccessibilityAction) { |
| 75 | return; |
| 76 | } |
| 77 | mCurrentAccessibilityAction = action; |
| 78 | |
| 79 | if (action == UNINSTALL) { |
| 80 | mHoverColor = getResources().getColor(R.color.uninstall_target_hover_tint); |
| 81 | setDrawable(R.drawable.ic_uninstall_shadow); |
| 82 | updateText(R.string.uninstall_drop_target_label); |
| 83 | } else { |
| 84 | mHoverColor = Themes.getColorAccent(getContext()); |
| 85 | setDrawable(R.drawable.ic_setup_shadow); |
| 86 | updateText(R.string.gadget_setup_text); |
| 87 | } |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | @Override |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 91 | public void onAlarm(Alarm alarm) { |
| 92 | mUninstallDisabledCache.clear(); |
Sunny Goyal | 1a70cef | 2015-04-22 11:29:51 -0700 | [diff] [blame] | 93 | } |
| 94 | |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 95 | @Override |
| 96 | public int getAccessibilityAction() { |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 97 | return mCurrentAccessibilityAction; |
| 98 | } |
| 99 | |
| 100 | @Override |
| 101 | public int getControlTypeForLogging() { |
| 102 | return mCurrentAccessibilityAction == UNINSTALL ? UNINSTALL_TARGET : SETTINGS_BUTTON; |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | @Override |
| 106 | protected boolean supportsDrop(ItemInfo info) { |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 107 | return supportsAccessibilityDrop(info, getViewUnderDrag(info)); |
| 108 | } |
| 109 | |
| 110 | @Override |
| 111 | public boolean supportsAccessibilityDrop(ItemInfo info, View view) { |
| 112 | if (view instanceof AppWidgetHostView) { |
| 113 | if (getReconfigurableWidgetId(view) != INVALID_APPWIDGET_ID) { |
| 114 | setupUi(RECONFIGURE); |
| 115 | return true; |
| 116 | } |
| 117 | return false; |
| 118 | } |
| 119 | |
| 120 | setupUi(UNINSTALL); |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 121 | Boolean uninstallDisabled = mUninstallDisabledCache.get(info.user); |
| 122 | if (uninstallDisabled == null) { |
| 123 | UserManager userManager = |
| 124 | (UserManager) getContext().getSystemService(Context.USER_SERVICE); |
| 125 | Bundle restrictions = userManager.getUserRestrictions(info.user); |
| 126 | uninstallDisabled = restrictions.getBoolean(UserManager.DISALLOW_APPS_CONTROL, false) |
Sunny Goyal | 6b0aa87 | 2017-09-29 07:54:37 -0700 | [diff] [blame] | 127 | || restrictions.getBoolean(UserManager.DISALLOW_UNINSTALL_APPS, false); |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 128 | mUninstallDisabledCache.put(info.user, uninstallDisabled); |
Sunny Goyal | 6b0aa87 | 2017-09-29 07:54:37 -0700 | [diff] [blame] | 129 | } |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 130 | // Cancel any pending alarm and set cache expiry after some time |
| 131 | mCacheExpireAlarm.setAlarm(CACHE_EXPIRE_TIMEOUT); |
| 132 | if (uninstallDisabled) { |
Sunny Goyal | a52ecb0 | 2016-12-16 15:04:51 -0800 | [diff] [blame] | 133 | return false; |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 134 | } |
| 135 | |
Sunny Goyal | 076839c | 2017-10-30 13:52:20 -0700 | [diff] [blame] | 136 | if (info instanceof ItemInfoWithIcon) { |
| 137 | ItemInfoWithIcon iconInfo = (ItemInfoWithIcon) info; |
| 138 | if ((iconInfo.runtimeStatusFlags & FLAG_SYSTEM_MASK) != 0) { |
| 139 | return (iconInfo.runtimeStatusFlags & FLAG_SYSTEM_NO) != 0; |
Sunny Goyal | 6b0aa87 | 2017-09-29 07:54:37 -0700 | [diff] [blame] | 140 | } |
| 141 | } |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 142 | return getUninstallTarget(info) != null; |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | /** |
Sunny Goyal | 8e0e1d7 | 2016-10-10 10:41:41 -0700 | [diff] [blame] | 146 | * @return the component name that should be uninstalled or null. |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 147 | */ |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 148 | private ComponentName getUninstallTarget(ItemInfo item) { |
Sunny Goyal | 8e0e1d7 | 2016-10-10 10:41:41 -0700 | [diff] [blame] | 149 | Intent intent = null; |
Sunny Goyal | 7c74e4a | 2016-12-15 15:53:17 -0800 | [diff] [blame] | 150 | UserHandle user = null; |
Sunny Goyal | 1fe0c2c | 2017-08-15 12:54:42 -0700 | [diff] [blame] | 151 | if (item != null && |
| 152 | item.itemType == LauncherSettings.BaseLauncherColumns.ITEM_TYPE_APPLICATION) { |
| 153 | intent = item.getIntent(); |
| 154 | user = item.user; |
Sunny Goyal | 8e0e1d7 | 2016-10-10 10:41:41 -0700 | [diff] [blame] | 155 | } |
| 156 | if (intent != null) { |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 157 | LauncherActivityInfo info = LauncherAppsCompat.getInstance(mLauncher) |
Sunny Goyal | 8e0e1d7 | 2016-10-10 10:41:41 -0700 | [diff] [blame] | 158 | .resolveActivity(intent, user); |
| 159 | if (info != null |
| 160 | && (info.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 0) { |
| 161 | return info.getComponentName(); |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 162 | } |
| 163 | } |
| 164 | return null; |
| 165 | } |
| 166 | |
| 167 | @Override |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 168 | public void onDrop(DragObject d, DragOptions options) { |
| 169 | // Defer onComplete |
Sunny Goyal | 1797af4 | 2017-10-06 13:29:57 -0700 | [diff] [blame] | 170 | d.dragSource = new DeferredOnComplete(d.dragSource, getContext()); |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 171 | super.onDrop(d, options); |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | @Override |
Sunny Goyal | 0f76b56 | 2016-12-13 19:37:10 -0800 | [diff] [blame] | 175 | public void completeDrop(final DragObject d) { |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 176 | ComponentName target = performDropAction(getViewUnderDrag(d.dragInfo), d.dragInfo); |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 177 | if (d.dragSource instanceof DeferredOnComplete) { |
| 178 | DeferredOnComplete deferred = (DeferredOnComplete) d.dragSource; |
| 179 | if (target != null) { |
| 180 | deferred.mPackageName = target.getPackageName(); |
| 181 | mLauncher.setOnResumeCallback(deferred); |
| 182 | } else { |
| 183 | deferred.sendFailure(); |
| 184 | } |
| 185 | } |
Tony Wickham | 734dfbe | 2015-09-16 16:22:36 -0700 | [diff] [blame] | 186 | } |
| 187 | |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 188 | private View getViewUnderDrag(ItemInfo info) { |
| 189 | if (info instanceof LauncherAppWidgetInfo && info.container == CONTAINER_DESKTOP && |
| 190 | mLauncher.getWorkspace().getDragInfo() != null) { |
| 191 | return mLauncher.getWorkspace().getDragInfo().cell; |
| 192 | } |
| 193 | return null; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * Verifies that the view is an reconfigurable widget and returns the corresponding widget Id, |
| 198 | * otherwise return {@code INVALID_APPWIDGET_ID} |
| 199 | */ |
| 200 | private int getReconfigurableWidgetId(View view) { |
| 201 | if (!(view instanceof AppWidgetHostView)) { |
| 202 | return INVALID_APPWIDGET_ID; |
| 203 | } |
| 204 | AppWidgetHostView hostView = (AppWidgetHostView) view; |
| 205 | AppWidgetProviderInfo widgetInfo = hostView.getAppWidgetInfo(); |
| 206 | if (widgetInfo == null || widgetInfo.configure == null) { |
| 207 | return INVALID_APPWIDGET_ID; |
| 208 | } |
| 209 | if ( (LauncherAppWidgetProviderInfo.fromProviderInfo(getContext(), widgetInfo) |
| 210 | .getWidgetFeatures() & WIDGET_FEATURE_RECONFIGURABLE) == 0) { |
| 211 | return INVALID_APPWIDGET_ID; |
| 212 | } |
| 213 | return hostView.getAppWidgetId(); |
| 214 | } |
| 215 | |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 216 | /** |
| 217 | * Performs the drop action and returns the target component for the dragObject or null if |
| 218 | * the action was not performed. |
| 219 | */ |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 220 | protected ComponentName performDropAction(View view, ItemInfo info) { |
| 221 | if (mCurrentAccessibilityAction == RECONFIGURE) { |
| 222 | int widgetId = getReconfigurableWidgetId(view); |
| 223 | if (widgetId != INVALID_APPWIDGET_ID) { |
| 224 | mLauncher.getAppWidgetHost().startConfigActivity(mLauncher, widgetId, -1); |
| 225 | } |
| 226 | return null; |
| 227 | } |
| 228 | // else: mCurrentAccessibilityAction == UNINSTALL |
| 229 | |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 230 | ComponentName cn = getUninstallTarget(info); |
Sunny Goyal | 8e0e1d7 | 2016-10-10 10:41:41 -0700 | [diff] [blame] | 231 | if (cn == null) { |
Sunny Goyal | d5bd67d | 2016-03-11 01:10:19 -0800 | [diff] [blame] | 232 | // System applications cannot be installed. For now, show a toast explaining that. |
| 233 | // We may give them the option of disabling apps this way. |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 234 | Toast.makeText(mLauncher, R.string.uninstall_system_app_text, Toast.LENGTH_SHORT).show(); |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 235 | return null; |
| 236 | } |
| 237 | try { |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 238 | Intent i = Intent.parseUri(mLauncher.getString(R.string.delete_package_intent), 0) |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 239 | .setData(Uri.fromParts("package", cn.getPackageName(), cn.getClassName())) |
| 240 | .putExtra(Intent.EXTRA_USER, info.user); |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 241 | mLauncher.startActivity(i); |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 242 | return cn; |
| 243 | } catch (URISyntaxException e) { |
| 244 | Log.e(TAG, "Failed to parse intent to start uninstall activity for item=" + info); |
| 245 | return null; |
| 246 | } |
| 247 | } |
| 248 | |
Sunny Goyal | 0236d0b | 2017-10-24 14:54:30 -0700 | [diff] [blame] | 249 | @Override |
| 250 | public void onAccessibilityDrop(View view, ItemInfo item) { |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 251 | performDropAction(view, item); |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | /** |
| 255 | * A wrapper around {@link DragSource} which delays the {@link #onDropCompleted} action until |
| 256 | * {@link #onLauncherResume} |
| 257 | */ |
| 258 | private class DeferredOnComplete implements DragSource, OnResumeCallback { |
| 259 | |
| 260 | private final DragSource mOriginal; |
| 261 | private final Context mContext; |
| 262 | |
| 263 | private String mPackageName; |
| 264 | private DragObject mDragObject; |
| 265 | |
| 266 | public DeferredOnComplete(DragSource original, Context context) { |
| 267 | mOriginal = original; |
| 268 | mContext = context; |
| 269 | } |
| 270 | |
| 271 | @Override |
Sunny Goyal | 1797af4 | 2017-10-06 13:29:57 -0700 | [diff] [blame] | 272 | public void onDropCompleted(View target, DragObject d, |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 273 | boolean success) { |
| 274 | mDragObject = d; |
| 275 | } |
| 276 | |
| 277 | @Override |
| 278 | public void fillInLogContainerData(View v, ItemInfo info, Target target, |
| 279 | Target targetParent) { |
| 280 | mOriginal.fillInLogContainerData(v, info, target, targetParent); |
| 281 | } |
| 282 | |
| 283 | @Override |
| 284 | public void onLauncherResume() { |
| 285 | // We use MATCH_UNINSTALLED_PACKAGES as the app can be on SD card as well. |
| 286 | if (LauncherAppsCompat.getInstance(mContext) |
| 287 | .getApplicationInfo(mPackageName, PackageManager.MATCH_UNINSTALLED_PACKAGES, |
| 288 | mDragObject.dragInfo.user) == null) { |
| 289 | mDragObject.dragSource = mOriginal; |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 290 | mOriginal.onDropCompleted(SecondaryDropTarget.this, mDragObject, true); |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 291 | } else { |
| 292 | sendFailure(); |
Jon Miranda | c56e3ff | 2017-08-23 12:13:24 -0700 | [diff] [blame] | 293 | } |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 294 | } |
Sunny Goyal | 3dce5f3 | 2017-10-05 11:40:05 -0700 | [diff] [blame] | 295 | |
| 296 | public void sendFailure() { |
| 297 | mDragObject.dragSource = mOriginal; |
| 298 | mDragObject.cancelled = true; |
Winson Chung | 1054d4e | 2018-03-05 19:39:21 +0000 | [diff] [blame^] | 299 | mOriginal.onDropCompleted(SecondaryDropTarget.this, mDragObject, false); |
Sunny Goyal | d5bd67d | 2016-03-11 01:10:19 -0800 | [diff] [blame] | 300 | } |
Sunny Goyal | fa401a1 | 2015-04-10 13:45:42 -0700 | [diff] [blame] | 301 | } |
| 302 | } |