Bug 1147473 - Follow-up: move ReadingListConstants to avoid build flag pain., a=readinglist
authorRichard Newman <rnewman@mozilla.com>
Fri, 27 Mar 2015 13:11:08 -0700
changeset 258211 c5baf4b4a350
parent 258210 32b6b2c4a69e
child 258212 ec6516ecdd71
push id4620
push userrnewman@mozilla.com
push date2015-04-02 16:21 +0000
treeherdermozilla-beta@27f61020a9e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersreadinglist
bugs1147473
milestone38.0
Bug 1147473 - Follow-up: move ReadingListConstants to avoid build flag pain., a=readinglist
mobile/android/base/android-services.mozbuild
mobile/android/base/background/ReadingListConstants.java
mobile/android/base/fxa/activities/FxAccountStatusFragment.java
mobile/android/base/reading/ReadingListClient.java
mobile/android/base/reading/ReadingListConstants.java
mobile/android/base/reading/ReadingListSyncAdapter.java
--- a/mobile/android/base/android-services.mozbuild
+++ b/mobile/android/base/android-services.mozbuild
@@ -828,16 +828,17 @@ sync_java_files = [
     'background/healthreport/upload/AndroidSubmissionClient.java',
     'background/healthreport/upload/HealthReportUploadService.java',
     'background/healthreport/upload/ObsoleteDocumentTracker.java',
     'background/healthreport/upload/SubmissionClient.java',
     'background/healthreport/upload/SubmissionPolicy.java',
     'background/nativecode/NativeCrypto.java',
     'background/preferences/PreferenceFragment.java',
     'background/preferences/PreferenceManagerCompat.java',
+    'background/ReadingListConstants.java',
     'browserid/ASNUtils.java',
     'browserid/BrowserIDKeyPair.java',
     'browserid/DSACryptoImplementation.java',
     'browserid/JSONWebTokenUtils.java',
     'browserid/MockMyIDTokenFactory.java',
     'browserid/RSACryptoImplementation.java',
     'browserid/SigningPrivateKey.java',
     'browserid/verifier/AbstractBrowserIDRemoteVerifierClient.java',
@@ -1165,17 +1166,16 @@ reading_list_service_java_files = [
     'reading/ClientMetadata.java',
     'reading/ClientReadingListRecord.java',
     'reading/FetchSpec.java',
     'reading/LocalReadingListStorage.java',
     'reading/ReadingListChangeAccumulator.java',
     'reading/ReadingListClient.java',
     'reading/ReadingListClientContentValuesFactory.java',
     'reading/ReadingListClientRecordFactory.java',
-    'reading/ReadingListConstants.java',
     'reading/ReadingListDeleteDelegate.java',
     'reading/ReadingListInvalidAuthenticationException.java',
     'reading/ReadingListRecord.java',
     'reading/ReadingListRecordDelegate.java',
     'reading/ReadingListRecordResponse.java',
     'reading/ReadingListRecordUploadDelegate.java',
     'reading/ReadingListResponse.java',
     'reading/ReadingListStorage.java',
rename from mobile/android/base/reading/ReadingListConstants.java
rename to mobile/android/base/background/ReadingListConstants.java
--- a/mobile/android/base/reading/ReadingListConstants.java
+++ b/mobile/android/base/background/ReadingListConstants.java
@@ -1,16 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package org.mozilla.gecko.reading;
+package org.mozilla.gecko.background;
 
 import org.mozilla.gecko.AppConstants;
 
+/**
+ * This is in 'background' not 'reading' so that it's still usable even when the
+ * Reading List feature is build-time disabled.
+ */
 public class ReadingListConstants {
   public static final String GLOBAL_LOG_TAG = "FxReadingList";
   public static final String USER_AGENT = "Firefox-Android-FxReader/" + AppConstants.MOZ_APP_VERSION + " (" + AppConstants.MOZ_APP_DISPLAYNAME + ")";
   public static final String DEFAULT_DEV_ENDPOINT = "https://readinglist.dev.mozaws.net/v1/";
   public static final String DEFAULT_PROD_ENDPOINT = "https://readinglist.services.mozilla.com/v1/";
 
   public static final String OAUTH_SCOPE_READINGLIST = "readinglist";
   public static final String AUTH_TOKEN_TYPE = "oauth::" + OAUTH_SCOPE_READINGLIST;
--- a/mobile/android/base/fxa/activities/FxAccountStatusFragment.java
+++ b/mobile/android/base/fxa/activities/FxAccountStatusFragment.java
@@ -8,28 +8,28 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
 import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.background.ReadingListConstants;
 import org.mozilla.gecko.background.common.log.Logger;
 import org.mozilla.gecko.background.fxa.FxAccountUtils;
 import org.mozilla.gecko.background.preferences.PreferenceFragment;
 import org.mozilla.gecko.db.BrowserContract;
 import org.mozilla.gecko.fxa.FirefoxAccounts;
 import org.mozilla.gecko.fxa.FxAccountConstants;
 import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount;
 import org.mozilla.gecko.fxa.login.Married;
 import org.mozilla.gecko.fxa.login.State;
 import org.mozilla.gecko.fxa.sync.FxAccountSyncStatusHelper;
 import org.mozilla.gecko.fxa.tasks.FxAccountCodeResender;
-import org.mozilla.gecko.reading.ReadingListConstants;
 import org.mozilla.gecko.sync.ExtendedJSONObject;
 import org.mozilla.gecko.sync.SharedPreferencesClientsDataDelegate;
 import org.mozilla.gecko.sync.SyncConfiguration;
 import org.mozilla.gecko.util.HardwareUtils;
 
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.content.ContentResolver;
--- a/mobile/android/base/reading/ReadingListClient.java
+++ b/mobile/android/base/reading/ReadingListClient.java
@@ -6,16 +6,17 @@ package org.mozilla.gecko.reading;
 
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.security.GeneralSecurityException;
 import java.util.Queue;
 import java.util.concurrent.Executor;
 
+import org.mozilla.gecko.background.ReadingListConstants;
 import org.mozilla.gecko.background.common.log.Logger;
 import org.mozilla.gecko.reading.ReadingListResponse.ResponseFactory;
 import org.mozilla.gecko.sync.ExtendedJSONObject;
 import org.mozilla.gecko.sync.net.AuthHeaderProvider;
 import org.mozilla.gecko.sync.net.BaseResource;
 import org.mozilla.gecko.sync.net.BaseResourceDelegate;
 import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
 import org.mozilla.gecko.sync.net.MozResponse;
--- a/mobile/android/base/reading/ReadingListSyncAdapter.java
+++ b/mobile/android/base/reading/ReadingListSyncAdapter.java
@@ -7,16 +7,17 @@ package org.mozilla.gecko.reading;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Collection;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import org.mozilla.gecko.background.ReadingListConstants;
 import org.mozilla.gecko.background.common.PrefsBranch;
 import org.mozilla.gecko.background.common.log.Logger;
 import org.mozilla.gecko.background.fxa.FxAccountUtils;
 import org.mozilla.gecko.db.BrowserContract.ReadingListItems;
 import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount;
 import org.mozilla.gecko.fxa.sync.FxAccountSyncDelegate;
 import org.mozilla.gecko.sync.net.AuthHeaderProvider;
 import org.mozilla.gecko.sync.net.BearerAuthHeaderProvider;