Bug 1497977 p1 - Renew the fxa device registration/client record on FxA account reconnection. r=nalexander
authorEdouard Oger <eoger@fastmail.com>
Wed, 17 Oct 2018 18:22:57 +0000
changeset 500265 3901ae585e3ae25f76b20e0fb8f44f1a9a4dfff0
parent 500264 affe4a683227c556ec3d21bbf9e9024fa4a71a4a
child 500266 e720c16aa7c6da10135d26da34cd4030b2c83713
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1497977
milestone64.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 1497977 p1 - Renew the fxa device registration/client record on FxA account reconnection. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D8606
mobile/android/base/java/org/mozilla/gecko/AccountsHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/AccountsHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/AccountsHelper.java
@@ -188,16 +188,22 @@ public class AccountsHelper implements B
             }
 
             final State state = new Engaged(email, uid, verified, unwrapkB,
                                             sessionToken, keyFetchToken);
 
             final AndroidFxAccount fxAccount = new AndroidFxAccount(mContext, account);
             fxAccount.setState(state);
             fxAccount.updateFirstRunScope(mContext);
+            // This will force a device registration later.
+            fxAccount.resetDeviceRegistrationVersion();
+            fxAccount.setDeviceRegistrationTimestamp(0L);
+            // Trigger a sync to try to update the device registration and
+            // upload a fresh client record.
+            fxAccount.requestImmediateSync(null, null, false);
 
             if (callback != null) {
                 callback.sendSuccess(true);
             }
 
         } else if ("Accounts:Create".equals(event)) {
             // Do exactly the same thing as if you tapped 'Sync' in Settings.
             final Intent intent = new Intent(FxAccountConstants.ACTION_FXA_GET_STARTED);