Replace drag & drop constants with finalize ids
Bug: 197520937 Test: builds Change-Id: I05ec8a7e119288e13e0c670e88323743238397c4
This commit is contained in:
@@ -14248,34 +14248,34 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
hideTooltip();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (action == R.id.accessibilityActionDragDrop) {
|
||||
if (!canAcceptAccessibilityDrop()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
if (mAttachInfo != null && mAttachInfo.mSession != null) {
|
||||
final int[] location = new int[2];
|
||||
getLocationInWindow(location);
|
||||
final int centerX = location[0] + getWidth() / 2;
|
||||
final int centerY = location[1] + getHeight() / 2;
|
||||
return mAttachInfo.mSession.dropForAccessibility(mAttachInfo.mWindow,
|
||||
centerX, centerY);
|
||||
case R.id.accessibilityActionDragDrop: {
|
||||
if (!canAcceptAccessibilityDrop()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
if (mAttachInfo != null && mAttachInfo.mSession != null) {
|
||||
final int[] location = new int[2];
|
||||
getLocationInWindow(location);
|
||||
final int centerX = location[0] + getWidth() / 2;
|
||||
final int centerY = location[1] + getHeight() / 2;
|
||||
return mAttachInfo.mSession.dropForAccessibility(mAttachInfo.mWindow,
|
||||
centerX, centerY);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e(VIEW_LOG_TAG, "Unable to drop for accessibility", e);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e(VIEW_LOG_TAG, "Unable to drop for accessibility", e);
|
||||
}
|
||||
return false;
|
||||
} else if (action == R.id.accessibilityActionDragCancel) {
|
||||
if (!startedSystemDragForAccessibility()) {
|
||||
return false;
|
||||
}
|
||||
if (mAttachInfo != null && mAttachInfo.mDragToken != null) {
|
||||
cancelDragAndDrop();
|
||||
return true;
|
||||
case R.id.accessibilityActionDragCancel: {
|
||||
if (!startedSystemDragForAccessibility()) {
|
||||
return false;
|
||||
}
|
||||
if (mAttachInfo != null && mAttachInfo.mDragToken != null) {
|
||||
cancelDragAndDrop();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4321,15 +4321,13 @@ public class AccessibilityNodeInfo implements Parcelable {
|
||||
return "ACTION_PRESS_AND_HOLD";
|
||||
case R.id.accessibilityActionImeEnter:
|
||||
return "ACTION_IME_ENTER";
|
||||
case R.id.accessibilityActionDragStart:
|
||||
return "ACTION_DRAG";
|
||||
case R.id.accessibilityActionDragCancel:
|
||||
return "ACTION_CANCEL_DRAG";
|
||||
case R.id.accessibilityActionDragDrop:
|
||||
return "ACTION_DROP";
|
||||
default:
|
||||
// TODO(197520937): Use finalized constants in switch
|
||||
if (action == R.id.accessibilityActionDragStart) {
|
||||
return "ACTION_DRAG";
|
||||
} else if (action == R.id.accessibilityActionDragCancel) {
|
||||
return "ACTION_CANCEL_DRAG";
|
||||
} else if (action == R.id.accessibilityActionDragDrop) {
|
||||
return "ACTION_DROP";
|
||||
}
|
||||
return "ACTION_UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user