diff options
author | Bobby Georgescu <georgescu@google.com> | 2013-03-12 22:45:17 -0700 |
---|---|---|
committer | Bobby Georgescu <georgescu@google.com> | 2013-03-12 22:45:17 -0700 |
commit | 0a7dd573732a06879b35cdd07a8c0ee08b62a32e (patch) | |
tree | 620d78edaf9742b259130cc6612080822ac2b902 /src/com | |
parent | b2edf4808b52024ca6f84bfa63e9d167407dc68d (diff) | |
download | android_packages_apps_Snap-0a7dd573732a06879b35cdd07a8c0ee08b62a32e.tar.gz android_packages_apps_Snap-0a7dd573732a06879b35cdd07a8c0ee08b62a32e.tar.bz2 android_packages_apps_Snap-0a7dd573732a06879b35cdd07a8c0ee08b62a32e.zip |
Usage statistics collection for camera module, filmstrip
Change-Id: Ib3e7dfb8948e99541f6d492c7d7bd4bfbad1e53d
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/PanoramaModule.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/VideoModule.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/ui/CameraSwitcher.java | 3 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 10 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/StateManager.java | 12 | ||||
-rw-r--r-- | src/com/android/gallery3d/ui/PhotoView.java | 9 |
7 files changed, 40 insertions, 3 deletions
diff --git a/src/com/android/camera/PanoramaModule.java b/src/com/android/camera/PanoramaModule.java index 2703c3596..623d96dc6 100644 --- a/src/com/android/camera/PanoramaModule.java +++ b/src/com/android/camera/PanoramaModule.java @@ -66,6 +66,7 @@ import com.android.gallery3d.exif.ExifOutputStream; import com.android.gallery3d.exif.ExifReader; import com.android.gallery3d.exif.ExifTag; import com.android.gallery3d.ui.GLRootView; +import com.android.gallery3d.util.UsageStatistics; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -1101,6 +1102,8 @@ public class PanoramaModule implements CameraModule, // Dismiss open menu if exists. PopupManager.getInstance(mActivity).notifyShowPopup(null); mRootView.requestLayout(); + UsageStatistics.onContentViewChanged( + UsageStatistics.COMPONENT_CAMERA, "PanoramaModule"); } /** diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 4c627c92c..037e0fdb3 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -58,6 +58,7 @@ import com.android.gallery3d.R; import com.android.gallery3d.common.ApiHelper; import com.android.gallery3d.filtershow.CropExtras; import com.android.gallery3d.filtershow.FilterShowActivity; +import com.android.gallery3d.util.UsageStatistics; import java.io.File; import java.io.FileNotFoundException; @@ -1255,6 +1256,8 @@ public class PhotoModule // Dismiss open menu if exists. PopupManager.getInstance(mActivity).notifyShowPopup(null); + UsageStatistics.onContentViewChanged( + UsageStatistics.COMPONENT_CAMERA, "PhotoModule"); } void waitCameraStartUpThread() { diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index a168372d1..4ae46a897 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -77,6 +77,7 @@ import com.android.camera.ui.ZoomRenderer; import com.android.gallery3d.R; import com.android.gallery3d.common.ApiHelper; import com.android.gallery3d.util.AccessibilityUtils; +import com.android.gallery3d.util.UsageStatistics; import java.io.File; import java.io.IOException; @@ -866,6 +867,8 @@ public class VideoModule implements CameraModule, PopupManager.getInstance(mActivity).notifyShowPopup(null); mVideoNamer = new VideoNamer(); + UsageStatistics.onContentViewChanged( + UsageStatistics.COMPONENT_CAMERA, "VideoModule"); } private void setDisplayOrientation() { diff --git a/src/com/android/camera/ui/CameraSwitcher.java b/src/com/android/camera/ui/CameraSwitcher.java index ce4f85003..75906acbe 100644 --- a/src/com/android/camera/ui/CameraSwitcher.java +++ b/src/com/android/camera/ui/CameraSwitcher.java @@ -38,6 +38,7 @@ import android.widget.LinearLayout; import com.android.camera.Util; import com.android.gallery3d.R; import com.android.gallery3d.common.ApiHelper; +import com.android.gallery3d.util.UsageStatistics; public class CameraSwitcher extends RotateImageView implements OnClickListener, OnTouchListener { @@ -106,6 +107,8 @@ public class CameraSwitcher extends RotateImageView private void onCameraSelected(int ix) { hidePopup(); if ((ix != mCurrentIndex) && (mListener != null)) { + UsageStatistics.setPendingTransitionCause( + UsageStatistics.TRANSITION_MENU_TAP); setCurrentIndex(ix); mListener.onCameraSelected(mModuleIds[ix]); } diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 44ff62feb..84030896a 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -69,6 +69,7 @@ import com.android.gallery3d.ui.PhotoView; import com.android.gallery3d.ui.SelectionManager; import com.android.gallery3d.ui.SynchronizedHandler; import com.android.gallery3d.util.GalleryUtils; +import com.android.gallery3d.util.UsageStatistics; public abstract class PhotoPage extends ActivityState implements PhotoView.Listener, AppBridge.Server, @@ -1338,8 +1339,17 @@ public abstract class PhotoPage extends ActivityState implements } if (enabled) { mHandler.removeMessages(MSG_HIDE_BARS); + UsageStatistics.onContentViewChanged( + UsageStatistics.COMPONENT_GALLERY, "FilmstripPage"); } else { refreshHidingMessage(); + if (mAppBridge == null || mCurrentIndex > 0) { + UsageStatistics.onContentViewChanged( + UsageStatistics.COMPONENT_GALLERY, "SinglePhotoPage"); + } else { + UsageStatistics.onContentViewChanged( + UsageStatistics.COMPONENT_CAMERA, "Unknown"); // TODO + } } } diff --git a/src/com/android/gallery3d/app/StateManager.java b/src/com/android/gallery3d/app/StateManager.java index b4b5d4b05..c0c84c950 100644 --- a/src/com/android/gallery3d/app/StateManager.java +++ b/src/com/android/gallery3d/app/StateManager.java @@ -24,6 +24,7 @@ import android.os.Parcelable; import android.view.Menu; import android.view.MenuItem; +import com.android.camera.CameraActivity; import com.android.gallery3d.anim.StateTransitionAnimation; import com.android.gallery3d.common.Utils; import com.android.gallery3d.util.UsageStatistics; @@ -63,9 +64,14 @@ public class StateManager { StateTransitionAnimation.Transition.Incoming); if (mIsResumed) top.onPause(); } - UsageStatistics.onContentViewChanged( - UsageStatistics.COMPONENT_GALLERY, - klass.getSimpleName()); + // Ignore the filmstrip used for the root of the camera app + boolean ignoreHit = (mActivity instanceof CameraActivity) + && mStack.isEmpty(); + if (!ignoreHit) { + UsageStatistics.onContentViewChanged( + UsageStatistics.COMPONENT_GALLERY, + klass.getSimpleName()); + } state.initialize(mActivity, data); mStack.push(new StateEntry(data, state)); diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 40e01ab07..5c8ac1c3e 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -42,6 +42,7 @@ import com.android.gallery3d.glrenderer.StringTexture; import com.android.gallery3d.glrenderer.Texture; import com.android.gallery3d.util.GalleryUtils; import com.android.gallery3d.util.RangeArray; +import com.android.gallery3d.util.UsageStatistics; public class PhotoView extends GLView { @SuppressWarnings("unused") @@ -1180,8 +1181,16 @@ public class PhotoView extends GLView { // Removing the touch down flag allows snapback to happen // for film mode change. mHolding &= ~HOLD_TOUCH_DOWN; + if (mFilmMode) { + UsageStatistics.setPendingTransitionCause( + UsageStatistics.TRANSITION_PINCH_OUT); + } else { + UsageStatistics.setPendingTransitionCause( + UsageStatistics.TRANSITION_PINCH_IN); + } setFilmMode(!mFilmMode); + // We need to call onScaleEnd() before setting mModeChanged // to true. onScaleEnd(); |