Android Wallpaper

Earlier this week, we told you about a mysterious image that when set as a wallpaper on a smartphone, the device would crash. We mentioned Samsung phones but non-Samsung devices have been victimized as well. The initial explanation going around was that the image’s aosp code has a piece that contains a value bigger than 255. Usual maximum index is 255 so when the number is beyond that, a phone would crash. A quick fix was provided. That is to add this specific line on the code: if (y > 255) y = 255.

This explanation was provided by the group behind Flowdor Theme. Other solutions were provided on reddit like removing the image’s color profile. As for XDA developers, EIC MishaalRahman (@MishaalRahman) shared that Google has started to review “potential fixes for the cursed wallpaper that causes phones to bootloop”.

Looking at the AOSP, some sound explanations have been given. The image is said to have been encoded in a color space named ‘Google/Skia/E3CADAB7BD3DE5E3436874D2A9DEE126’. It’s a long name when most photos are encoded in sRGB. It’s possible that the image was converted to sRBG and then a known bug occurred.

This explanation is related to the earlier reason we mentioned. The code calculates the luminance value of the pixels by following this formula: Luminance = .2126f * r + .7152f * g + .0722f * b. R, G, and B’s values usually vary but for this particular image, the sum exceeds 255. It happens because the results are rounded up. The result exceeds the limit. It’s only 255 versus 256 but the end result is not good as it causes bootloop.

Crashing happens because the maximum value is exceeded. The problem is said to be really specific because of the color space conversion error and rounding error. Interestingly, this kind of error won’t happen in Android 11. The main reason is that the photo’s Skia color space is not converted to sRGB by default.