Refactors ButtonDropTarget to add extension data

Also fixes a bug where DeleteDropTarget was logging Remove instead of
Cancel.

Bug: 78793340
Test: Enable verbose logging and manual test
Change-Id: I0f0cfff070eab003ebb745292630bc6ce3243f4d
This commit is contained in:
Mehdi Alizadeh
2018-05-01 19:26:05 -07:00
parent 954157a228
commit bda47cf925
5 changed files with 32 additions and 11 deletions

View File

@@ -8,8 +8,6 @@ import static com.android.launcher3.ItemInfoWithIcon.FLAG_SYSTEM_NO;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP;
import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.RECONFIGURE;
import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.UNINSTALL;
import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.SETTINGS_BUTTON;
import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.UNINSTALL_TARGET;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
@@ -33,6 +31,8 @@ import android.widget.Toast;
import com.android.launcher3.Launcher.OnResumeCallback;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.logging.LoggerUtils;
import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.Themes;
@@ -98,8 +98,11 @@ public class SecondaryDropTarget extends ButtonDropTarget implements OnAlarmList
}
@Override
public int getControlTypeForLogging() {
return mCurrentAccessibilityAction == UNINSTALL ? UNINSTALL_TARGET : SETTINGS_BUTTON;
public Target getDropTargetForLogging() {
Target t = LoggerUtils.newTarget(Target.Type.CONTROL);
t.controlType = mCurrentAccessibilityAction == UNINSTALL ? ControlType.UNINSTALL_TARGET
: ControlType.SETTINGS_BUTTON;
return t;
}
@Override