Skip to content

Extension update job might never work on Android

This is where the extensions are supposed to check for updates: https://searchfox.org/firefox-esr140/rev/0717b5233e7861fa5e4d8ed493b05c0d9db10a17/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/update/AddonUpdater.kt#596-644

However, I tried to log there, and we never get to it.

The sequence should be:

  1. An addon is registered for updates: https://searchfox.org/firefox-esr140/rev/0717b5233e7861fa5e4d8ed493b05c0d9db10a17/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/update/AddonUpdater.kt#172-176 (I see a log trace until here!)
  2. The registration creates a periodic work request: https://searchfox.org/firefox-esr140/rev/0717b5233e7861fa5e4d8ed493b05c0d9db10a17/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/update/AddonUpdater.kt#254-268
  3. The code linked above is run.

I think that the main problem is that getWorkerConstrains (SIC) requires NetworkType.CONNECTED, but we don't give it permissions: https://developer.android.com/reference/android/app/job/JobInfo.Builder#setRequiredNetworkType(int).

I tried to remove that constraint, and run the worker more often, but I still don't see my custom log.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information