Issue
For testing purposes, I would like to stop and restart my Android Wear watch face service via ADB. Stopping it appears to work normally:
adb shell am force-stop com.package.name
but starting the service back up again has me stumped. Watch faces are not activities, so it cannot be started via am start
. I attempted to use the monkey
command on the package, but that didn't work. I tried starting the service manually:
adb shell am startservice com.package.name/.watch_face_service
but that doesn't seem to work; either the service isn't started, or the service IS started but is not the current wallpaper.
It MUST be possible, since Eclipse manages to start the watch face when I run or debug it. But how?
Solution
After many days of research, I have come to the conclusion that this is impossible.
All WallpaperServices are required to require the BIND_WALLPAPER
permission:
String: BIND_WALLPAPER: Must be required by a WallpaperService, to ensure that only the system can bind to it.
...which means that only the system service has the ability to start a wallpaper.
The Android operating system probably has some hardcoded voodoo magic that will automatically start any watchface installed via Eclipse or Android Studio -- that's my best guess considering neither IDE runs any ADB commands to start the wallpaper.
Answered By - Anonymous
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.