Prune unneeded AnalyticsUtil methods to sendScreenView (1/2)

Test: see Ia305eef7c7073e5bd2d964f0054116ac21ed3f47
Bug: 28017432
Bug: 30759296
Change-Id: I4b09f0d7dee1f3eccf970ad3595d1dcb92226bf6
diff --git a/src-bind/com/android/contactsbind/analytics/AnalyticsUtil.java b/src-bind/com/android/contactsbind/analytics/AnalyticsUtil.java
index e48e8f2..53b59eb 100644
--- a/src-bind/com/android/contactsbind/analytics/AnalyticsUtil.java
+++ b/src-bind/com/android/contactsbind/analytics/AnalyticsUtil.java
@@ -25,27 +25,4 @@
      * Initialize this class and setup automatic activity tracking.
      */
     public static void initialize(Application application) { }
-
-    /**
-     * Log a screen view for {@param fragment}.
-     */
-    public static void sendScreenView(Fragment fragment) {}
-
-    public static void sendScreenView(Fragment fragment, Activity activity) {}
-
-    public static void sendScreenView(Fragment fragment, Activity activity, String tag) {}
-
-    public static void sendScreenView(String fragmentName, Activity activity, String tag) {}
-
-    /**
-     * Logs a event to the analytics server.
-     *
-     * @param application The application the tracker is stored in.
-     * @param category The category for the event.
-     * @param action The event action.
-     * @param label The event label.
-     * @param value The value associated with the event.
-     */
-    public static void sendEvent(Application application, String category, String action,
-            String label, long value) { }
 }
\ No newline at end of file
diff --git a/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java b/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java
index 3b7ed6b..bbbd794 100644
--- a/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java
+++ b/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java
@@ -29,10 +29,6 @@
 
 import com.android.contacts.common.R;
 import com.android.contacts.common.list.ShortcutIntentBuilder.OnShortcutIntentCreatedListener;
-import com.android.contactsbind.analytics.AnalyticsUtil;
-
-import org.json.JSONException;
-import org.json.JSONObject;
 
 /**
  * Fragment containing a phone number list for picking.
@@ -169,12 +165,6 @@
                         + " adapter is ready. Ignoring");
             }
         }
-
-        // Get the lookup key and track any analytics
-        final String lookupKey = getLookupKey(position);
-        if (!TextUtils.isEmpty(lookupKey)) {
-            maybeTrackAnalytics(lookupKey);
-        }
     }
 
     protected void cacheContactInfo(int position) {
@@ -304,42 +294,4 @@
     protected int getCallInitiationType(boolean isRemoteDirectory) {
         return OnPhoneNumberPickerActionListener.CALL_INITIATION_UNKNOWN;
     }
-
-    /**
-     * Where a lookup key contains analytic event information, logs the associated analytics event.
-     *
-     * @param lookupKey The lookup key JSON object.
-     */
-    private void maybeTrackAnalytics(String lookupKey) {
-        try {
-            JSONObject json = new JSONObject(lookupKey);
-
-            String analyticsCategory = json.getString(
-                    PhoneNumberListAdapter.PhoneQuery.ANALYTICS_CATEGORY);
-            String analyticsAction = json.getString(
-                    PhoneNumberListAdapter.PhoneQuery.ANALYTICS_ACTION);
-            String analyticsValue = json.getString(
-                    PhoneNumberListAdapter.PhoneQuery.ANALYTICS_VALUE);
-
-            if (TextUtils.isEmpty(analyticsCategory) || TextUtils.isEmpty(analyticsAction) ||
-                    TextUtils.isEmpty(analyticsValue)) {
-                return;
-            }
-
-            // Assume that the analytic value being tracked could be a float value, but just cast
-            // to a long so that the analytic server can handle it.
-            long value;
-            try {
-                float floatValue = Float.parseFloat(analyticsValue);
-                value = (long) floatValue;
-            } catch (NumberFormatException nfe) {
-                return;
-            }
-
-            AnalyticsUtil.sendEvent(getActivity().getApplication(), analyticsCategory,
-                    analyticsAction, "" /* label */, value);
-        } catch (JSONException e) {
-            // Not an error; just a lookup key that doesn't have the right information.
-        }
-    }
 }