'How can I bundle some wallpapers as part of my custom AOSP rom?

I am building AOSP from its 5.1 branch, I would like to know how to include static wallpapers in my custom build since there is only one in there by default.

I would like to know two things :

  1. Specifically where to define the wallpapers to be included in the AOSP structure. Which file(s) need to be edited.
  2. How to define, with some example of the syntax.


Solution 1:[1]

I will not suggest you to modify the AOSP tree structure. The AOSP provides the "device/your_company/device_name/overlay/" directory which is provided just to customize your device by adding resources files. Match the tree structure as defined in original directory tree structure. To change your default wallpaper you will have dir structure below aosp_root/device/your_company/your_device/overlay/frameworks/base/core/res/res/drawable-nodpi(or your device resolution)/default_wallpaper.jpg modify your picture with same name. compile the image and you should see the default wallpaper.

Update :

Above answer is more accurate but for understanding it in simple just go to the following path

Path : AOSP/frameworks/base/core/res/res/drawable-nodpi/

At this directory the default_wallpaper.jpg file is the main file wich is displaying to your emulator. You can replace it with other file but same name.

Solution 2:[2]

if you are looking to include it for one specific device i'd recommend you to include them in your device tree and copy it over . for generic purpose you could create a makefile and include it in your tree on general build config makefile..

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anurag Kushwaha
Solution 2 Ajay Katwe