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 490163 ea10b0217cec23ce84efefcf437e9a81c33e31fd
parent 490162 5238702906f63d95d2fae62f33aa53cb61de7e49
child 490164 60c949b40f469cdb459a1ec9d31efce727593c3a
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersnalexander
bugs1497977
milestone64.0a1
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();
   }