Bug 1497977 p4 - Trigger an upload of our own client record after FxA device registration. r=nalexander
authorEdouard Oger <eoger@fastmail.com>
Wed, 17 Oct 2018 18:23:09 +0000
changeset 500268 ea10b0217cec23ce84efefcf437e9a81c33e31fd
parent 500267 5238702906f63d95d2fae62f33aa53cb61de7e49
child 500269 60c949b40f469cdb459a1ec9d31efce727593c3a
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 p4 - Trigger an upload of our own client record after FxA device registration. r=nalexander Depends on D8609 Differential Revision: https://phabricator.services.mozilla.com/D8610
mobile/android/services/src/main/java/org/mozilla/gecko/fxa/devices/FxAccountDeviceRegistrator.java
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/devices/FxAccountDeviceRegistrator.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/devices/FxAccountDeviceRegistrator.java
@@ -237,16 +237,18 @@ public class FxAccountDeviceRegistrator 
       }
 
       @Override
       public void handleSuccess(FxAccountDevice result) {
         Log.i(LOG_TAG, "Device registration complete");
         Logger.pii(LOG_TAG, "Registered device ID: " + result.id);
         Log.i(LOG_TAG, "Setting DEVICE_REGISTRATION_VERSION to " + DEVICE_REGISTRATION_VERSION);
         fxAccount.setFxAUserData(result.id, DEVICE_REGISTRATION_VERSION, System.currentTimeMillis());
+        // Ask for a re-upload of the local client record to account for the FxA device ID change.
+        fxAccount.requestImmediateSync(new String[] { "clients" }, null, true);
       }
     });
   }
 
   private static FxAccountDevice buildFxAccountDevice(Context context, AndroidFxAccount fxAccount) {
     return makeFxADeviceCommonBuilder(context, fxAccount).build();
   }