Bug 1261808 - Re-add telemetry for unsubscribing from feeds. r?margaret
MozReview-Commit-ID: 3aHIujRBXcQ
--- a/mobile/android/base/java/org/mozilla/gecko/feeds/action/WithdrawSubscriptionsAction.java
+++ b/mobile/android/base/java/org/mozilla/gecko/feeds/action/WithdrawSubscriptionsAction.java
@@ -6,16 +6,18 @@
package org.mozilla.gecko.feeds.action;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import org.json.JSONException;
+import org.mozilla.gecko.Telemetry;
+import org.mozilla.gecko.TelemetryContract;
import org.mozilla.gecko.db.BrowserContract;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.UrlAnnotations;
import org.mozilla.gecko.feeds.subscriptions.FeedSubscription;
/**
* WithdrawSubscriptionsAction: Look for feeds to unsubscribe from.
*/
@@ -76,16 +78,18 @@ public class WithdrawSubscriptionsAction
try {
while (cursor.moveToNext()) {
final FeedSubscription subscription = FeedSubscription.fromCursor(cursor);
if (!urlAnnotations.hasWebsiteForFeedUrl(resolver, subscription.getFeedUrl())) {
log("Removing subscription for feed: " + subscription.getFeedUrl());
urlAnnotations.deleteFeedSubscription(resolver, subscription);
+
+ Telemetry.sendUIEvent(TelemetryContract.Event.UNSAVE, TelemetryContract.Method.SERVICE, "content_update");
}
}
} catch (JSONException e) {
log("Could not deserialize subscription", e);
} finally {
cursor.close();
}
}