Why did a simple wallpaper collapse a bunch of Android smartphones?

How can a normal picture make a Android smartphone hang?

Recently, the famous technology blogger, Ice Universe, posted a picture on his personal Twitter. Comes with the image warning people not to use it as a wallpaper on Android smartphones because this will cause the machine to hang (soft brick).

According to statistics, many smartphone models of Samsung and Google are affected. Meanwhile, some users of OnePlus, Nokia and Xiaomi smartphones also reported that their device was suspended. Huawei smartphones rarely have problems with phone wallpapers.

So why can a simple wallpaper cause a series of Android smartphones to hang? Let's find out.

According to Android Authority, most people in the industry believe that this problem comes from the color space of the image that exceeds the processing capacity of SystemUI on Android.

To better understand, please read the explanation of Davide Bianco, a veteran Android developer. Davide is currently responsible for the POSP custom ROM development project:

"SystemUI only does the job of processing and turning sRGB photos into wallpapers and doesn't have any checks with non-sRGB images. This can create a problem, conflict in the ImageProcessHelper class when which a variable used to access the array exceeds the bounds of the array.

This variable is called y and it is the total RGB pixel value of the image. The number of pixels is collected by scanning every row and gray bar on the surface of the image. Each time a pixel is detected, the value y increases by 1. Typically, the variable y has a maximum value of 255 and is used to access an element of the chart array (with a maximum size of 256) to perform its function. In this case, the variable y has the function to declare the image that will be used as the wallpaper.

For regular photos, the total RGB value is always 255. However, for some reason this image has the variable y beyond the limit. Any overexpression in SystemUI can cause serious problems, resulting in an infinite crash loop because the image needs to be processed every time SystemUI starts up, " Davide said.

Davide also proposed a solution that is to write the command to set the variable y back to 255 whenever it is detected that it exceeds the maximum limit. This solution helps the smartphone not to hang when setting the image as a wallpaper but reduces image quality.

Picture 1 of Why did a simple wallpaper collapse a bunch of Android smartphones?
Some smartphone models have no problems after installing this image as a wallpaper

Davide also tried using Photoshop and Gimp to create an image that could cause Android crashes but failed. He realized that SystemUI always transferred his images to a safe color space before setting it as the wallpaper of the machine. Davide tried extracting the color profile of the above image for use in a new image but could not cause any Android smartphone to hang.

Meanwhile, according to Dylan Roussel, another experienced developer, the issue doesn't appear on Android 11. The reason is because Android 11 always converts images to sRGB before being used for features. as setting as wallpaper.

In fact, this is not the first time an Android smartphone has crashed when installing a special wallpaper. However, so far Google has not had any solution to this problem. 

If someone pranks you or is curious to install this wallpaper and hangs, you can't fix it by rebooting it. Instead, you have to restore the factory settings or enter safe mode and then delete the image above.

Update 02 June 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile