Bug 1220892 - Part 4: Clean up FxAccountAbstractSetupActivity. r=mcomella
authorNick Alexander <nalexander@mozilla.com>
Mon, 30 Nov 2015 15:51:44 -0800
changeset 309374 f659e1c2d182ae4194d5a57706e106d4ec6a4a35
parent 309373 61f2a1360c6d2556ada47b4dc68eeec16f7919b4
child 309375 62e4fa9f1000018cf278361853a461de38b61df5
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1220892
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1220892 - Part 4: Clean up FxAccountAbstractSetupActivity. r=mcomella The web based Activity sub-classes never used the other intent extras, and in fact, filter them out immediately; so it doesn't hurt to clean this all up.
mobile/android/base/android-services.mozbuild
mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountAbstractSetupActivity.java
mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountStatusFragment.java
--- a/mobile/android/base/android-services.mozbuild
+++ b/mobile/android/base/android-services.mozbuild
@@ -847,17 +847,16 @@ sync_java_files = [TOPSRCDIR + '/mobile/
     'browserid/verifier/BrowserIDRemoteVerifierClient20.java',
     'browserid/verifier/BrowserIDVerifierClient.java',
     'browserid/verifier/BrowserIDVerifierDelegate.java',
     'browserid/verifier/BrowserIDVerifierException.java',
     'browserid/VerifyingPublicKey.java',
     'fxa/AccountLoader.java',
     'fxa/activities/CustomColorPreference.java',
     'fxa/activities/FxAccountAbstractActivity.java',
-    'fxa/activities/FxAccountAbstractSetupActivity.java',
     'fxa/activities/FxAccountConfirmAccountActivityWeb.java',
     'fxa/activities/FxAccountFinishMigratingActivityWeb.java',
     'fxa/activities/FxAccountGetStartedActivityWeb.java',
     'fxa/activities/FxAccountStatusActivity.java',
     'fxa/activities/FxAccountStatusFragment.java',
     'fxa/activities/FxAccountUpdateCredentialsActivityWeb.java',
     'fxa/activities/FxAccountWebFlowActivity.java',
     'fxa/activities/PicassoPreferenceIconTarget.java',
deleted file mode 100644
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountAbstractSetupActivity.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/* 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.fxa.activities;
-
-abstract public class FxAccountAbstractSetupActivity extends FxAccountAbstractActivity {
-  public static final String EXTRA_EMAIL = "email";
-  public static final String EXTRA_PASSWORD = "password";
-  public static final String EXTRA_PASSWORD_SHOWN = "password_shown";
-  public static final String EXTRA_YEAR = "year";
-  public static final String EXTRA_MONTH = "month";
-  public static final String EXTRA_DAY = "day";
-  public static final String EXTRA_EXTRAS = "extras";
-
-  public static final String JSON_KEY_AUTH = "auth";
-  public static final String JSON_KEY_SERVICES = "services";
-  public static final String JSON_KEY_SYNC = "sync";
-  public static final String JSON_KEY_PROFILE = "profile";
-
-  public FxAccountAbstractSetupActivity() {
-    super(CANNOT_RESUME_WHEN_ACCOUNTS_EXIST);
-  }
-
-  protected FxAccountAbstractSetupActivity(int resume) {
-    super(resume);
-  }
-
-  private static final String LOG_TAG = FxAccountAbstractSetupActivity.class.getSimpleName();
-}
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountStatusFragment.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountStatusFragment.java
@@ -239,35 +239,27 @@ public class FxAccountStatusFragment
     if (preference == removeAccountPreference) {
       FxAccountStatusActivity.maybeDeleteAndroidAccount(getActivity(), fxAccount.getAndroidAccount(), null);
       return true;
     }
 
     if (preference == needsPasswordPreference) {
       final Intent intent = new Intent(FxAccountConstants.ACTION_FXA_UPDATE_CREDENTIALS);
       intent.putExtra(FxAccountWebFlowActivity.EXTRA_ENDPOINT, FxAccountConstants.ENDPOINT_PREFERENCES);
-      final Bundle extras = getExtrasForAccount();
-      if (extras != null) {
-        intent.putExtras(extras);
-      }
       // Per http://stackoverflow.com/a/8992365, this triggers a known bug with
       // the soft keyboard not being shown for the started activity. Why, Android, why?
       intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
       startActivity(intent);
 
       return true;
     }
 
     if (preference == needsFinishMigratingPreference) {
       final Intent intent = new Intent(FxAccountConstants.ACTION_FXA_FINISH_MIGRATING);
       intent.putExtra(FxAccountWebFlowActivity.EXTRA_ENDPOINT, FxAccountConstants.ENDPOINT_PREFERENCES);
-      final Bundle extras = getExtrasForAccount();
-      if (extras != null) {
-        intent.putExtras(extras);
-      }
       // Per http://stackoverflow.com/a/8992365, this triggers a known bug with
       // the soft keyboard not being shown for the started activity. Why, Android, why?
       intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
       startActivity(intent);
 
       return true;
     }
 
@@ -300,28 +292,16 @@ public class FxAccountStatusFragment
         FirefoxAccounts.requestSync(fxAccount.getAndroidAccount(), FirefoxAccounts.FORCE, null, null);
       }
       return true;
     }
 
     return false;
   }
 
-  protected Bundle getExtrasForAccount() {
-    final Bundle extras = new Bundle();
-    final ExtendedJSONObject o = new ExtendedJSONObject();
-    o.put(FxAccountAbstractSetupActivity.JSON_KEY_AUTH, fxAccount.getAccountServerURI());
-    final ExtendedJSONObject services = new ExtendedJSONObject();
-    services.put(FxAccountAbstractSetupActivity.JSON_KEY_SYNC, fxAccount.getTokenServerURI());
-    services.put(FxAccountAbstractSetupActivity.JSON_KEY_PROFILE, fxAccount.getProfileServerURI());
-    o.put(FxAccountAbstractSetupActivity.JSON_KEY_SERVICES, services);
-    extras.putString(FxAccountAbstractSetupActivity.EXTRA_EXTRAS, o.toJSONString());
-    return extras;
-  }
-
   protected void setCheckboxesEnabled(boolean enabled) {
     bookmarksPreference.setEnabled(enabled);
     historyPreference.setEnabled(enabled);
     tabsPreference.setEnabled(enabled);
     passwordsPreference.setEnabled(enabled);
     // Since we can't sync, we can't update our remote client record.
     deviceNamePreference.setEnabled(enabled);
     syncNowPreference.setEnabled(enabled);