Log.wtf if DeleteDropTarget "canRemove", but doesn't remove item from the database.

Bug: 379606516
Test: Verified locally that these logs show when hard-coded to appear. Also verified that normal usage doesn't cause crashes.
Flag: EXEMPT bug logs
Change-Id: Iadc67f4a063f5924c758468c6b227b23368fc192
This commit is contained in:
Stefan Andonian
2024-12-12 19:19:52 +00:00
parent 8da7f25ccb
commit b64026135f

View File

@@ -22,6 +22,7 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
@@ -131,6 +132,10 @@ public class DeleteDropTarget extends ButtonDropTarget {
ItemInfo item = d.dragInfo;
if (canRemove(item)) {
mDropTargetHandler.onDeleteComplete(item);
} else if (mText == getResources().getText(R.string.remove_drop_target_label)) {
Log.wtf("b/379606516", "If the drop target text is 'remove', then"
+ " users should always be able to delete the item from launcher's db."
+ " Invalid drag ItemInfo: " + item);
}
}