Bug 1241810 - Review follow-up: Rename CheckAction.notify() to CheckAction.showNotification(). r=me draft
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 23 Mar 2016 15:56:24 +0100
changeset 343945 d07e323506184a528c40d9f6fa25311a86dbb45b
parent 343944 c5f93e7093027a5ce2c1f8d45c6a351a44a70a90
child 343946 883211bcfe2b2080c51c549cff65064485b26bf7
push id13713
push users.kaspari@gmail.com
push dateWed, 23 Mar 2016 15:10:41 +0000
reviewersme
bugs1241810
milestone48.0a1
Bug 1241810 - Review follow-up: Rename CheckAction.notify() to CheckAction.showNotification(). r=me MozReview-Commit-ID: EIRYnna6yf9
mobile/android/base/java/org/mozilla/gecko/feeds/action/CheckAction.java
--- a/mobile/android/base/java/org/mozilla/gecko/feeds/action/CheckAction.java
+++ b/mobile/android/base/java/org/mozilla/gecko/feeds/action/CheckAction.java
@@ -79,17 +79,17 @@ public class CheckAction extends BaseAct
                 }
             }
         } catch (JSONException e) {
             log("Could not deserialize subscription", e);
         } finally {
             cursor.close();
         }
 
-        notify(updatedFeeds);
+        showNotification(updatedFeeds);
     }
 
     private FeedFetcher.FeedResponse checkFeedForUpdates(FeedSubscription subscription) {
         log("Checking feed: " + subscription.getFeedTitle());
 
         FeedFetcher.FeedResponse response = fetchFeed(subscription);
         if (response == null) {
             return null;
@@ -102,32 +102,32 @@ public class CheckAction extends BaseAct
 
             return response;
 
         }
 
         return null;
     }
 
-    private void notify(List<Feed> updatedFeeds) {
+    private void showNotification(List<Feed> updatedFeeds) {
         final int feedCount = updatedFeeds.size();
         if (feedCount == 0) {
             return;
         }
 
         if (feedCount == 1) {
-            notifySingle(updatedFeeds.get(0));
+            showNotificationForSingleUpdate(updatedFeeds.get(0));
         } else {
-            notifyMultiple(updatedFeeds);
+            showNotificationForMultipleUpdates(updatedFeeds);
         }
 
         Telemetry.sendUIEvent(TelemetryContract.Event.SHOW, TelemetryContract.Method.NOTIFICATION, "content_update");
     }
 
-    private void notifySingle(Feed feed) {
+    private void showNotificationForSingleUpdate(Feed feed) {
         final String date = DateFormat.getMediumDateFormat(context).format(new Date(feed.getLastItem().getTimestamp()));
 
         NotificationCompat.BigTextStyle style = new NotificationCompat.BigTextStyle()
                 .bigText(feed.getLastItem().getTitle())
                 .setBigContentTitle(feed.getTitle())
                 .setSummaryText(context.getString(R.string.content_notification_updated_on, date));
 
         Intent intent = new Intent(Intent.ACTION_VIEW);
@@ -146,17 +146,17 @@ public class CheckAction extends BaseAct
                 .setContentIntent(pendingIntent)
                 .setAutoCancel(true)
                 .addAction(createNotificationSettingsAction())
                 .build();
 
         NotificationManagerCompat.from(context).notify(R.id.websiteContentNotification, notification);
     }
 
-    private void notifyMultiple(List<Feed> feeds) {
+    private void showNotificationForMultipleUpdates(List<Feed> feeds) {
         final ArrayList<String> urls = new ArrayList<>();
 
         final NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
         for (Feed feed : feeds) {
             final String url = feed.getLastItem().getURL();
 
             inboxStyle.addLine(StringUtils.stripScheme(url, StringUtils.UrlFlags.STRIP_HTTPS));
             urls.add(url);