How can I add a " set as wallpaper" button?

my app allows the user to change a photo and then have the option to make said photo a wallpaper or lock screen for his android phone.
but i can’t figure out how to add this essential button “set as a wallpeper” . Any hep?

One of these suggestions in the old AI2 Forum might help.

Hello Zexo

I think it will be difficult to do - Firstly, the device User will need to switch from “Themes” to “Wallpaper”. Secondly, it’s a Google security issue, so you need the User to grant permission. I have no idea which permission might grant the setting of a wallpaper though.