Only show App Info drag target if developer settings are enabled.

Bug: 28794577
Change-Id: Ia515a627a4f94121c47386829c6772bea42e70f1
diff --git a/src/com/android/launcher3/InfoDropTarget.java b/src/com/android/launcher3/InfoDropTarget.java
index 191becf..259370c 100644
--- a/src/com/android/launcher3/InfoDropTarget.java
+++ b/src/com/android/launcher3/InfoDropTarget.java
@@ -18,7 +18,9 @@
 
 import android.content.ActivityNotFoundException;
 import android.content.ComponentName;
+import android.content.ContentResolver;
 import android.content.Context;
+import android.provider.Settings;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.widget.Toast;
@@ -92,7 +94,12 @@
     }
 
     public static boolean supportsDrop(ItemInfo info) {
-        return info instanceof AppInfo || info instanceof ShortcutInfo
-                || info instanceof PendingAddItemInfo || info instanceof LauncherAppWidgetInfo;
+        // Only show the App Info drop target if developer settings are enabled.
+        ContentResolver resolver = LauncherAppState.getInstance().getContext().getContentResolver();
+        boolean developmentSettingsEnabled = Settings.Global.getInt(resolver,
+                Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1;
+        return developmentSettingsEnabled
+                && (info instanceof AppInfo || info instanceof ShortcutInfo
+                || info instanceof PendingAddItemInfo || info instanceof LauncherAppWidgetInfo);
     }
 }