I've been trying to find a way to pass a message to my Wallpaper Service from a Settings Activity.
In the settings I do this:
Context context = getApplicationContext();
Intent i = new Intent(context, RainWallpaper.class);
i.setAction("my_action");
context.startService(i);
In my Manifest I have the action in the intent filter section for the Service
<action android:name="my_action" />
Finally in the WallpaperService I have overridden onStartCommand()
.
When I run the code and call startService()
I get a security exception.
W/ActivityManager( 2466): Permission Denial: Accessing service ComponentInfo{com.myclassname} from pid=2466, uid=1000 requires android.permission.BIND_WALLPAPER
So this seems to say that I need to give the settings dialog permission to BIND_WALLPAPER
. So when I add that permission the settings dialog now crashes with a security exception.