зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1241810 - Review follow-up: Rename actions to be more descriptive. r=me
MozReview-Commit-ID: 5VbOQv4W7CZ --HG-- rename : mobile/android/base/java/org/mozilla/gecko/feeds/action/CheckAction.java => mobile/android/base/java/org/mozilla/gecko/feeds/action/CheckForUpdatesAction.java rename : mobile/android/base/java/org/mozilla/gecko/feeds/action/EnrollAction.java => mobile/android/base/java/org/mozilla/gecko/feeds/action/EnrollSubscriptionsAction.java rename : mobile/android/base/java/org/mozilla/gecko/feeds/action/BaseAction.java => mobile/android/base/java/org/mozilla/gecko/feeds/action/FeedAction.java rename : mobile/android/base/java/org/mozilla/gecko/feeds/action/SetupAction.java => mobile/android/base/java/org/mozilla/gecko/feeds/action/SetupAlarmsAction.java rename : mobile/android/base/java/org/mozilla/gecko/feeds/action/SubscribeAction.java => mobile/android/base/java/org/mozilla/gecko/feeds/action/SubscribeToFeedAction.java rename : mobile/android/base/java/org/mozilla/gecko/feeds/action/WithdrawAction.java => mobile/android/base/java/org/mozilla/gecko/feeds/action/WithdrawSubscriptionsAction.java extra : rebase_source : d87251b9d09d722aee73bea62694666a4b182b3a
This commit is contained in:
Родитель
9fdb905a6e
Коммит
513ad73d4e
|
@ -27,7 +27,7 @@ import org.mozilla.gecko.favicons.Favicons;
|
|||
import org.mozilla.gecko.favicons.OnFaviconLoadedListener;
|
||||
import org.mozilla.gecko.favicons.decoders.IconDirectoryEntry;
|
||||
import org.mozilla.gecko.feeds.FeedService;
|
||||
import org.mozilla.gecko.feeds.action.CheckAction;
|
||||
import org.mozilla.gecko.feeds.action.CheckForUpdatesAction;
|
||||
import org.mozilla.gecko.firstrun.FirstrunAnimationContainer;
|
||||
import org.mozilla.gecko.gfx.DynamicToolbarAnimator;
|
||||
import org.mozilla.gecko.gfx.DynamicToolbarAnimator.PinReason;
|
||||
|
@ -3773,7 +3773,7 @@ public class BrowserApp extends GeckoApp
|
|||
}
|
||||
|
||||
// Launched from a "content notification"
|
||||
if (intent.hasExtra(CheckAction.EXTRA_CONTENT_NOTIFICATION)) {
|
||||
if (intent.hasExtra(CheckForUpdatesAction.EXTRA_CONTENT_NOTIFICATION)) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.NOTIFICATION, "content_update");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,12 +20,12 @@ import org.mozilla.gecko.AppConstants;
|
|||
import org.mozilla.gecko.GeckoProfile;
|
||||
import org.mozilla.gecko.GeckoSharedPrefs;
|
||||
import org.mozilla.gecko.db.BrowserDB;
|
||||
import org.mozilla.gecko.feeds.action.BaseAction;
|
||||
import org.mozilla.gecko.feeds.action.CheckAction;
|
||||
import org.mozilla.gecko.feeds.action.EnrollAction;
|
||||
import org.mozilla.gecko.feeds.action.SetupAction;
|
||||
import org.mozilla.gecko.feeds.action.SubscribeAction;
|
||||
import org.mozilla.gecko.feeds.action.WithdrawAction;
|
||||
import org.mozilla.gecko.feeds.action.FeedAction;
|
||||
import org.mozilla.gecko.feeds.action.CheckForUpdatesAction;
|
||||
import org.mozilla.gecko.feeds.action.EnrollSubscriptionsAction;
|
||||
import org.mozilla.gecko.feeds.action.SetupAlarmsAction;
|
||||
import org.mozilla.gecko.feeds.action.SubscribeToFeedAction;
|
||||
import org.mozilla.gecko.feeds.action.WithdrawSubscriptionsAction;
|
||||
import org.mozilla.gecko.preferences.GeckoPreferences;
|
||||
import org.mozilla.gecko.util.Experiments;
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class FeedService extends IntentService {
|
|||
public static void subscribe(Context context, String feedUrl) {
|
||||
Intent intent = new Intent(context, FeedService.class);
|
||||
intent.setAction(ACTION_SUBSCRIBE);
|
||||
intent.putExtra(SubscribeAction.EXTRA_FEED_URL, feedUrl);
|
||||
intent.putExtra(SubscribeToFeedAction.EXTRA_FEED_URL, feedUrl);
|
||||
context.startService(intent);
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class FeedService extends IntentService {
|
|||
return;
|
||||
}
|
||||
|
||||
BaseAction action = createActionForIntent(intent);
|
||||
FeedAction action = createActionForIntent(intent);
|
||||
if (action == null) {
|
||||
Log.d(LOGTAG, "No action to process");
|
||||
return;
|
||||
|
@ -108,24 +108,24 @@ public class FeedService extends IntentService {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
private BaseAction createActionForIntent(Intent intent) {
|
||||
private FeedAction createActionForIntent(Intent intent) {
|
||||
final Context context = getApplicationContext();
|
||||
|
||||
switch (intent.getAction()) {
|
||||
case ACTION_SETUP:
|
||||
return new SetupAction(context);
|
||||
return new SetupAlarmsAction(context);
|
||||
|
||||
case ACTION_SUBSCRIBE:
|
||||
return new SubscribeAction(context);
|
||||
return new SubscribeToFeedAction(context);
|
||||
|
||||
case ACTION_CHECK:
|
||||
return new CheckAction(context);
|
||||
return new CheckForUpdatesAction(context);
|
||||
|
||||
case ACTION_ENROLL:
|
||||
return new EnrollAction(context);
|
||||
return new EnrollSubscriptionsAction(context);
|
||||
|
||||
case ACTION_WITHDRAW:
|
||||
return new WithdrawAction(context);
|
||||
return new WithdrawSubscriptionsAction(context);
|
||||
|
||||
default:
|
||||
throw new AssertionError("Unknown action: " + intent.getAction());
|
||||
|
|
|
@ -38,9 +38,9 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CheckAction: Check if feeds we subscribed to have new content available.
|
||||
* CheckForUpdatesAction: Check if feeds we subscribed to have new content available.
|
||||
*/
|
||||
public class CheckAction extends BaseAction {
|
||||
public class CheckForUpdatesAction extends FeedAction {
|
||||
/**
|
||||
* This extra will be added to Intents fired by the notification.
|
||||
*/
|
||||
|
@ -50,7 +50,7 @@ public class CheckAction extends BaseAction {
|
|||
|
||||
private Context context;
|
||||
|
||||
public CheckAction(Context context) {
|
||||
public CheckForUpdatesAction(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -21,9 +21,9 @@ import org.mozilla.gecko.feeds.knownsites.KnownSiteMedium;
|
|||
import org.mozilla.gecko.feeds.knownsites.KnownSiteWordpress;
|
||||
|
||||
/**
|
||||
* EnrollAction: Search for bookmarks of known sites we can subscribe to.
|
||||
* EnrollSubscriptionsAction: Search for bookmarks of known sites we can subscribe to.
|
||||
*/
|
||||
public class EnrollAction extends BaseAction {
|
||||
public class EnrollSubscriptionsAction extends FeedAction {
|
||||
private static final String LOGTAG = "FeedEnrollAction";
|
||||
|
||||
private static final KnownSite[] knownSites = {
|
||||
|
@ -34,7 +34,7 @@ public class EnrollAction extends BaseAction {
|
|||
|
||||
private Context context;
|
||||
|
||||
public EnrollAction(Context context) {
|
||||
public EnrollSubscriptionsAction(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ import org.mozilla.gecko.db.BrowserDB;
|
|||
/**
|
||||
* Interface for actions run by FeedService.
|
||||
*/
|
||||
public abstract class BaseAction {
|
||||
public abstract class FeedAction {
|
||||
public static final boolean DEBUG_LOG = false;
|
||||
|
||||
/**
|
|
@ -16,14 +16,14 @@ import org.mozilla.gecko.feeds.FeedAlarmReceiver;
|
|||
import org.mozilla.gecko.feeds.FeedService;
|
||||
|
||||
/**
|
||||
* SetupAction: Set up alarms to run various actions every now and then.
|
||||
* SetupAlarmsAction: Set up alarms to run various actions every now and then.
|
||||
*/
|
||||
public class SetupAction extends BaseAction {
|
||||
public class SetupAlarmsAction extends FeedAction {
|
||||
private static final String LOGTAG = "FeedSetupAction";
|
||||
|
||||
private Context context;
|
||||
|
||||
public SetupAction(Context context) {
|
||||
public SetupAlarmsAction(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -17,16 +17,16 @@ import org.mozilla.gecko.feeds.FeedFetcher;
|
|||
import org.mozilla.gecko.feeds.subscriptions.FeedSubscription;
|
||||
|
||||
/**
|
||||
* SubscribeAction: Try to fetch a feed and create a subscription if successful.
|
||||
* SubscribeToFeedAction: Try to fetch a feed and create a subscription if successful.
|
||||
*/
|
||||
public class SubscribeAction extends BaseAction {
|
||||
public class SubscribeToFeedAction extends FeedAction {
|
||||
private static final String LOGTAG = "FeedSubscribeAction";
|
||||
|
||||
public static final String EXTRA_FEED_URL = "feed_url";
|
||||
|
||||
private Context context;
|
||||
|
||||
public SubscribeAction(Context context) {
|
||||
public SubscribeToFeedAction(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -17,14 +17,14 @@ import org.mozilla.gecko.db.UrlAnnotations;
|
|||
import org.mozilla.gecko.feeds.subscriptions.FeedSubscription;
|
||||
|
||||
/**
|
||||
* WithdrawAction: Look for feeds to unsubscribe from.
|
||||
* WithdrawSubscriptionsAction: Look for feeds to unsubscribe from.
|
||||
*/
|
||||
public class WithdrawAction extends BaseAction {
|
||||
public class WithdrawSubscriptionsAction extends FeedAction {
|
||||
private static final String LOGTAG = "FeedWithdrawAction";
|
||||
|
||||
private Context context;
|
||||
|
||||
public WithdrawAction(Context context) {
|
||||
public WithdrawSubscriptionsAction(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ import org.mozilla.gecko.TelemetryContract.Method;
|
|||
import org.mozilla.gecko.background.common.GlobalConstants;
|
||||
import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
|
||||
import org.mozilla.gecko.feeds.FeedService;
|
||||
import org.mozilla.gecko.feeds.action.CheckAction;
|
||||
import org.mozilla.gecko.feeds.action.CheckForUpdatesAction;
|
||||
import org.mozilla.gecko.permissions.Permissions;
|
||||
import org.mozilla.gecko.restrictions.Restrictable;
|
||||
import org.mozilla.gecko.tabqueue.TabQueueHelper;
|
||||
|
@ -73,7 +73,6 @@ import android.preference.Preference.OnPreferenceChangeListener;
|
|||
import android.preference.Preference.OnPreferenceClickListener;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.preference.PreferenceGroup;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.preference.TwoStatePreference;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
|
@ -388,7 +387,7 @@ OnSharedPreferenceChangeListener
|
|||
}
|
||||
|
||||
// Launched from "Notifications settings" action button in a notification.
|
||||
if (intentExtras != null && intentExtras.containsKey(CheckAction.EXTRA_CONTENT_NOTIFICATION)) {
|
||||
if (intentExtras != null && intentExtras.containsKey(CheckForUpdatesAction.EXTRA_CONTENT_NOTIFICATION)) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, Method.BUTTON, "notification-settings");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -273,12 +273,12 @@ gbjar.sources += ['java/org/mozilla/gecko/' + x for x in [
|
|||
'favicons/LoadFaviconTask.java',
|
||||
'favicons/OnFaviconLoadedListener.java',
|
||||
'favicons/RemoteFavicon.java',
|
||||
'feeds/action/BaseAction.java',
|
||||
'feeds/action/CheckAction.java',
|
||||
'feeds/action/EnrollAction.java',
|
||||
'feeds/action/SetupAction.java',
|
||||
'feeds/action/SubscribeAction.java',
|
||||
'feeds/action/WithdrawAction.java',
|
||||
'feeds/action/CheckForUpdatesAction.java',
|
||||
'feeds/action/EnrollSubscriptionsAction.java',
|
||||
'feeds/action/FeedAction.java',
|
||||
'feeds/action/SetupAlarmsAction.java',
|
||||
'feeds/action/SubscribeToFeedAction.java',
|
||||
'feeds/action/WithdrawSubscriptionsAction.java',
|
||||
'feeds/FeedAlarmReceiver.java',
|
||||
'feeds/FeedFetcher.java',
|
||||
'feeds/FeedService.java',
|
||||
|
|
Загрузка…
Ссылка в новой задаче