am 2fc87a73: Merge "Clean up stats stubs." into gb-ub-photos-denali

* commit '2fc87a7338d34d8d7383eeea3a367893961a6ac5':
  Clean up stats stubs.
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index c7aace0..22dea88 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -949,7 +949,7 @@
         setCameraState(SNAPSHOT_IN_PROGRESS);
         UsageStatistics.captureEvent(eventprotos.NavigationChange.Mode.PHOTO_CAPTURE,
                 UsageStatistics.hashFileName(mNamedImages.mQueue.lastElement().title + ".jpg"),
-                mParameters);
+                mParameters, null);
         return true;
     }
 
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 0477127..a835fab 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -410,7 +410,7 @@
             showVideoSnapshotUI(true);
             mSnapshotInProgress = true;
             UsageStatistics.captureEvent(eventprotos.NavigationChange.Mode.VIDEO_STILL,
-                    null, null);
+                    null, null, null);
         }
     }
 
diff --git a/src_pd/com/android/camera/util/UsageStatistics.java b/src_pd/com/android/camera/util/UsageStatistics.java
index de0cbf5..155f0c0 100644
--- a/src_pd/com/android/camera/util/UsageStatistics.java
+++ b/src_pd/com/android/camera/util/UsageStatistics.java
@@ -15,170 +15,21 @@
  */
 
 package com.android.camera.util;
-
 import android.content.Context;
 import android.hardware.Camera;
 
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.HashMap;
-import java.util.Map;
-
-
 public class UsageStatistics {
-
-    public static final String COMPONENT_GALLERY = "Gallery";
-    public static final String COMPONENT_CAMERA = "Camera";
-    public static final String COMPONENT_EDITOR = "Editor";
-    public static final String COMPONENT_IMPORTER = "Importer";
-    public static final String COMPONENT_LIGHTCYCLE = "Lightcycle";
-    public static final String COMPONENT_PANORAMA = "Panorama";
-    public static final String COMPONENT_GCAM = "GCam";
-
-    public static final String TRANSITION_BACK_BUTTON = "BackButton";
-    public static final String TRANSITION_UP_BUTTON = "UpButton";
-    public static final String TRANSITION_PINCH_IN = "PinchIn";
-    public static final String TRANSITION_PINCH_OUT = "PinchOut";
-    public static final String TRANSITION_INTENT = "Intent";
-    public static final String TRANSITION_ITEM_TAP = "ItemTap";
-    public static final String TRANSITION_MENU_TAP = "MenuTap";
-    public static final String TRANSITION_BUTTON_TAP = "ButtonTap";
-    public static final String TRANSITION_SWIPE = "Swipe";
-
-    public static final String ACTION_CAPTURE_START = "CaptureStart";
-    public static final String ACTION_CAPTURE_FAIL = "CaptureFail";
-    public static final String ACTION_CAPTURE_DONE = "CaptureDone";
-
-    public static final String ACTION_STITCHING_START = "StitchingStart";
-    public static final String ACTION_STITCHING_DONE = "StitchingDone";
-
-    public static final String ACTION_FOREGROUNDED = "Foregrounded";
-    public static final String ACTION_OPEN_FAIL = "OpenFailure";
-    public static final String ACTION_SCREEN_CHANGED = "ScreenChanged";
-    public static final String ACTION_FILMSTRIP = "Filmstrip";
-    public static final String ACTION_TOUCH_FOCUS = "TouchFocus";
-    public static final String ACTION_DELETE = "Delete";
-    public static final String ACTION_GALLERY = "Gallery";
-    public static final String ACTION_EDIT = "Edit";
-    public static final String ACTION_CROP = "Crop";
-    public static final String ACTION_PLAY_VIDEO = "PlayVideo";
-
-    public static final String CATEGORY_LIFECYCLE = "AppLifecycle";
-    public static final String CATEGORY_BUTTON_PRESS = "ButtonPress";
-
-    public static final String LIFECYCLE_START = "Start";
-
-    private static final String GOOGLER_LABEL = "Googler";
-    private static final String TIMEZONE_LABEL = "Timezone";
-
-    public static final String PLAY_LOG_TAG = "com.google.android.GoogleCamera";
-
-    /**
-     * The user has shared a photo or video.
-     * <p/>
-     * <p>This should be used only within the {@link #COMPONENT_GALLERY} category.
-     * <p/>
-     * <p>The label should be either Photo or Video, to identify the type of item being shared.
-     * <p/>
-     * <p>The optional value should be the time different between the time the photo or video was
-     * taken, according to its metadata, and the time it was actually shared, or -1 if the time it
-     * was taken is not available.
-     */
-    public static final String ACTION_SHARE = "Share";
-
-    private static final String UNKNOWN_LABEL = "NULL";
-    private static final String EVENT_TRANSITION = "ScreenTransition";
-    private static final long SESSION_TIMEOUT_MS = 300000;
-    private static final boolean DEV_MODE =
-            !"user".equals(android.os.Build.TYPE);
-    private static final String ANALYTICS_TAG_DEV = "UA-36276453-2";
-    private static final String ANALYTICS_TAG_USER = "UA-36276453-1";
-    private static final String TRANSITION_FORMAT_STRING = "%s -> %s";
-    private static final int DEFAULT_SAMPLE_RATE_HUNDREDTHS = 10000;
-
-    private static boolean sAnalyticsEnabled = false;
-    private static String sAnalyticsTag;
-    private static double sSampleRateHundredths = -1;
-    private static String sLastHit = UNKNOWN_LABEL;
-    private static String sPendingTransition = UNKNOWN_LABEL;
-    private static long sLastUpdateTimestamp = 0;
-    private static long sLastTimestampDifference = 0;
-    private static MessageDigest sShaMessageDigest;
-    private static String sTimeZone;
-    private static Boolean sGoogler;
-    private static int sCurrentMode;
-    private static Map<String, Integer> sValidPreferences = new HashMap<String, Integer>();
-
-    public static void initialize(Context context) {
-    }
-
-    public static void photoInteraction(String fileNameHash, int interactionType, int cause) {
-    }
-
-    public static void foregrounded(int source) {
-    }
-
-    public static void captureEvent(int mode, String fileNameHash, Camera.Parameters parameters) {
-    }
-
+    public static void initialize(Context context) {}
+    public static void photoInteraction(String fileNameHash, int interactionType, int cause) {}
+    public static void foregrounded(int source) {}
     public static void captureEvent(int mode, String fileNameHash,
-                                    Camera.Parameters parameters, Float duration) {
-    }
+                                    Camera.Parameters parameters, Float duration) {}
+    public static void changePreference(String preference, String newValue, String oldValue) {}
+    public static void cameraFailure(int cause) {}
+    public static void tapToFocus() {}
+    public static void changeScreen(int newScreen, Integer interactionCause) {}
 
-    public static void changePreference(String preference, String newValue, String oldValue) {
-
-    }
-
-    public static void cameraFailure(int cause) {
-    }
-
-    public static void tapToFocus() {
-    }
-
-    public static void changeScreen(int newScreen, Integer interactionCause) {
-    }
-
-
-    /**
-     * Given a filename such as image.jpg, it returns a hash used for logging.  The hash
-     * identifies the file for later operations such as delete or share without leaking
-     * the filename, or keeping extra book keeping on the device.
-     *
-     * @param fileName the filename with extension that will be hashed.
-     * @return a deterministic one way hash of the fileName
-     */
     public static String hashFileName(String fileName) {
-        return toSHA1(fileName);
+        return "";
     }
-
-    private static String toSHA1(String input) {
-        byte[] inputBytes = input.getBytes();
-        if (sShaMessageDigest == null) {
-            try {
-                sShaMessageDigest = MessageDigest.getInstance("SHA-1");
-            } catch (NoSuchAlgorithmException e) {
-                e.printStackTrace();
-            }
-        }
-        if (sShaMessageDigest != null && inputBytes != null) {
-            return byteArrayToHexString(sShaMessageDigest.digest(inputBytes));
-        } else {
-            return "";
-        }
-    }
-
-    private static String byteArrayToHexString(byte[] b) {
-        StringBuilder resultBuilder = new StringBuilder();
-        for (byte aB : b) {
-
-            // This converts a byte to a 2 digit hex string by masking
-            // first we get rid of any extraneous high bits
-            // Then we set one high bit to guarantee the hex representation is long enough
-            // lastly we only take the last 2 characters from the string (ignoring the high
-            // order bit we set)
-            resultBuilder.append(Integer.toString((aB & 0xff) + 0x100, 16).substring(1));
-        }
-        return resultBuilder.toString();
-    }
-
 }
diff --git a/src_pd/com/google/common/logging/eventprotos.java b/src_pd/com/google/common/logging/eventprotos.java
index 97814a2..6eba6a9 100644
--- a/src_pd/com/google/common/logging/eventprotos.java
+++ b/src_pd/com/google/common/logging/eventprotos.java
@@ -21,43 +21,43 @@
     public class CameraEvent {
 
         public class InteractionType {
-            public static final int SHARE = 0;
-            public static final int DELETE = 0;
-            public static final int DETAILS = 0;
+            public static final int SHARE = 10000;
+            public static final int DELETE = 10000;
+            public static final int DETAILS = 10000;
         }
 
         public class InteractionCause {
-            public static final int BUTTON = 0;
-            public static final int SWIPE_LEFT = 0;
-            public static final int SWIPE_UP = 0;
-            public static final int SWIPE_DOWN = 0;
-            public static final int SWIPE_RIGHT = 0;
+            public static final int BUTTON = 10000;
+            public static final int SWIPE_LEFT = 10000;
+            public static final int SWIPE_UP = 10000;
+            public static final int SWIPE_DOWN = 10000;
+            public static final int SWIPE_RIGHT = 10000;
         }
     }
 
     public class NavigationChange {
         public class Mode {
-            public static final int PHOTO_CAPTURE = 0;
-            public static final int FILMSTRIP = 0;
-            public static final int VIDEO_CAPTURE = 0;
-            public static final int VIDEO_STILL = 0;
-            public static final int GALLERY = 0;
+            public static final int PHOTO_CAPTURE = 10000;
+            public static final int FILMSTRIP = 10000;
+            public static final int VIDEO_CAPTURE = 10000;
+            public static final int VIDEO_STILL = 10000;
+            public static final int GALLERY = 10000;
         }
     }
 
     public class CameraFailure {
         public class FailureReason {
-            public static final int SECURITY = 0;
-            public static final int OPEN_FAILURE = 0;
-            public static final int RECONNECT_FAILURE = 0;
+            public static final int SECURITY = 10000;
+            public static final int OPEN_FAILURE = 10000;
+            public static final int RECONNECT_FAILURE = 10000;
         }
     }
 
     public class ForegroundEvent {
         public class ForegroundSource {
-            public static final int ICON_LAUNCHER = 0;
-            public static final int LOCK_SCREEN = 0;
-            public static final int INTENT_PICKER = 0;
+            public static final int ICON_LAUNCHER = 10000;
+            public static final int LOCK_SCREEN = 10000;
+            public static final int INTENT_PICKER = 10000;
         }
     }
 }