Closed Bug 1029032 Opened 10 years ago Closed 10 years ago

Distribution themes aren't inited correctly

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Not sure if this is an old bug (because we don't test this often) or if I regressed this with delayed distro stuff.

(It shouldn't be the latter, because the distro prefs are there, just as they always are, by the time Gecko starts...)

What seems to be happening is this:

* The default prefs are set:

  "Preferences": {
    "lightweightThemes.isThemeSelected": true,
    "lightweightThemes.persisted.footerURL": true,
    "lightweightThemes.persisted.headerURL": true,
    "lightweightThemes.usedThemes": "[{\"id\":\"523146\",\"name\":\"the birth of colours\",\"headerURL\":\"https://addons.cdn.mozilla.net/_files/523146/header.png?1402935629\",\"footerURL\":\"https://addons.cdn.mozilla.net/_files/523146/footer.png?1402935629\",\"textcolor\":\"#ffffff\",\"accentcolor\":\"#616161\",\"iconURL\":\"https://addons.cdn.mozilla.net/_files/523146/icon.png?1402935629\",\"previewURL\":\"https://addons.cdn.mozilla.net/_files/523146/preview.png?1402935629\",\"author\":\"beeflon\",\"description\":\"None\",\"updateURL\":\"https://versioncheck.addons.mozilla.org/en-US/themes/update-check/523146\",\"version\":\"1.0\",\"updateDate\":1403538390628,\"installDate\":1403538390628}]",
    "distribution.test.string": "test",
    "distribution.test.boolean": true,
    "distribution.test.int": 5
  },

* isThemeSelected is true in about:config at runtime.

* Java gets a message like:

{"textcolor":"#ffffff","previewURL":"https:\/\/addons.cdn.mozilla.net\/_files\/523146\/preview.png?1402935629","accentcolor":"#616161","headerURL":"file:\/\/\/data\/data\/org.mozilla.fennec_rnewman\/files\/mozilla\/9sjr1knq.default\/lightweighttheme-header?523146;1.0","updateDate":1403538390628,"version":"1.0","id":"523146","author":"beeflon","installDate":1403538390628,"description":"None","name":"the birth of colours","updateURL":"https:\/\/versioncheck.addons.mozilla.org\/en-US\/themes\/update-check\/523146","iconURL":"https:\/\/addons.cdn.mozilla.net\/_files\/523146\/icon.png?1402935629","footerURL":"file:\/\/\/data\/data\/org.mozilla.fennec_rnewman\/files\/mozilla\/9sjr1knq.default\/lightweighttheme-footer?523146;1.0"}

Note that the headerURL has been switched for the local persisted path.

* The load fails, because _persistImage was never called:

 java.io.FileNotFoundException: /data/data/org.mozilla.fennec_rnewman/files/mozilla/9sjr1knq.default/lightweighttheme-header: open failed: ENOENT (No such file or directory)
 	at libcore.io.IoBridge.open(IoBridge.java:409)
 	at java.io.FileInputStream.<init>(FileInputStream.java:78)
 	at libcore.net.url.FileURLConnection.connect(FileURLConnection.java:82)
 	at libcore.net.url.FileURLConnection.getInputStream(FileURLConnection.java:181)
 	at java.net.URL.openStream(URL.java:470)
 	at org.mozilla.gecko.gfx.BitmapUtils.decodeUrl(BitmapUtils.java:226)
 	at org.mozilla.gecko.gfx.BitmapUtils.decodeUrl(BitmapUtils.java:222)
 	at org.mozilla.gecko.LightweightTheme$1.run(LightweightTheme.java:94)



So either:

* You can apply a theme just by setting a pref, and LightweightThemeManager is screwing up by detecting the theme but not fetching the images, or
* You can't do that, and we shouldn't be trying to.
This is what you get when you copy and paste out of a live profile.

    "lightweightThemes.persisted.footerURL": true,
    "lightweightThemes.persisted.headerURL": true,

tell LWTM that we've already persisted the images to disk. We haven't.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.