summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2013-06-17 15:24:28 -0700
committerBobby Georgescu <georgescu@google.com>2013-06-17 15:48:31 -0700
commit608e27fb708aa24afe5790b0f0825c977a7df784 (patch)
tree095cacdd442b48dfd5546cbc9b2a0aecf57d2df1 /src/com
parent3126f4f5c0c241f7fb895cc8222954a7f7cbfdfe (diff)
downloadandroid_packages_apps_Snap-608e27fb708aa24afe5790b0f0825c977a7df784.tar.gz
android_packages_apps_Snap-608e27fb708aa24afe5790b0f0825c977a7df784.tar.bz2
android_packages_apps_Snap-608e27fb708aa24afe5790b0f0825c977a7df784.zip
Add more metrics to Editor
Bug: 9467671 Instrument - Editor opened - Number of filters used in save - Undo/redo/reset/state panel - Save completed Change-Id: I4722f36496ccd089829bd616f89d760078922573
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java13
-rw-r--r--src/com/android/gallery3d/filtershow/presets/ImagePreset.java4
-rw-r--r--src/com/android/gallery3d/filtershow/tools/SaveCopyTask.java3
3 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 2d745968b..7ba0fcc9c 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -92,6 +92,7 @@ import com.android.gallery3d.filtershow.tools.XmpPresets.XMresults;
import com.android.gallery3d.filtershow.ui.FramedTextButton;
import com.android.gallery3d.filtershow.ui.Spline;
import com.android.gallery3d.util.GalleryUtils;
+import com.android.gallery3d.util.UsageStatistics;
import com.android.photos.data.GalleryBitmapPool;
import java.io.File;
@@ -167,6 +168,9 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
extractXMPData();
processIntent();
+ UsageStatistics.onContentViewChanged(UsageStatistics.COMPONENT_EDITOR, "Main");
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
+ UsageStatistics.CATEGORY_LIFECYCLE, UsageStatistics.LIFECYCLE_START);
}
public boolean isShowingImageStatePanel() {
@@ -750,6 +754,8 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
mMasterImage.onHistoryItemClick(position);
backToMain();
invalidateViews();
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
+ UsageStatistics.CATEGORY_BUTTON_PRESS, "Undo");
return true;
}
case R.id.redoButton: {
@@ -757,14 +763,21 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
int position = adapter.redo();
mMasterImage.onHistoryItemClick(position);
invalidateViews();
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
+ UsageStatistics.CATEGORY_BUTTON_PRESS, "Redo");
return true;
}
case R.id.resetHistoryButton: {
resetHistory();
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
+ UsageStatistics.CATEGORY_BUTTON_PRESS, "ResetHistory");
return true;
}
case R.id.showImageStateButton: {
toggleImageStatePanel();
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
+ UsageStatistics.CATEGORY_BUTTON_PRESS,
+ mShowingImageStatePanel ? "ShowPanel" : "HidePanel");
return true;
}
case android.R.id.home: {
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
index 00effa825..ebefa015f 100644
--- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
@@ -489,6 +489,10 @@ public class ImagePreset {
if (to == -1) {
to = mFilters.size();
}
+ if (environment.getQuality() == FilterEnvironment.QUALITY_FINAL) {
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
+ "SaveFilters", "Total", to - from + 1);
+ }
for (int i = from; i < to; i++) {
FilterRepresentation representation = null;
synchronized (mFilters) {
diff --git a/src/com/android/gallery3d/filtershow/tools/SaveCopyTask.java b/src/com/android/gallery3d/filtershow/tools/SaveCopyTask.java
index 9f7cba30b..1d8ab07a1 100644
--- a/src/com/android/gallery3d/filtershow/tools/SaveCopyTask.java
+++ b/src/com/android/gallery3d/filtershow/tools/SaveCopyTask.java
@@ -35,6 +35,7 @@ import com.android.gallery3d.filtershow.cache.CachingPipeline;
import com.android.gallery3d.filtershow.cache.ImageLoader;
import com.android.gallery3d.filtershow.filters.FiltersManager;
import com.android.gallery3d.filtershow.presets.ImagePreset;
+import com.android.gallery3d.util.UsageStatistics;
import com.android.gallery3d.util.XmpUtilHelper;
import java.io.File;
@@ -215,6 +216,8 @@ public class SaveCopyTask extends AsyncTask<ImagePreset, Void, Uri> {
XmpPresets.writeFilterXMP(context, sourceUri, this.destinationFile, preset);
noBitmap = false;
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
+ "SaveComplete", null);
} catch (java.lang.OutOfMemoryError e) {
// Try 5 times before failing for good.
if (++num_tries >= 5) {