On Jun 1, 11:22 am, "Ericson, Anders"
<[email protected]> wrote:

> Why should only the Home application send commands to the wallpaper? 
> Shouldn't any application that displays the wallpaper as background be able 
> to send commands?

>From what Romain said, this is indeed the case - any application can
issue this call. It's just that it's not documented where to get the
required parameters. That does include the offsets, as you mention
below.

How about it Romain, little help? :^)

String

> Also, the documentation for WallpaperManager.sendWallpaperCommand() is a bit 
> unclear. The documentation for the parameter windowToken says "he window who 
> these offsets should be associated with, as returned by 
> View.getWindowToken().". What offsets are referred to here? I can understand 
> the same documentation in setWallpaperOfffsets() or clearWallpaperOffsets, 
> but not in sendWallpapperCommand().
>
> /Anders Ericson
>
>
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Romain Guy
> Sent: den 1 juni 2010 11:49
> To: [email protected]
> Subject: Re: [android-developers] sendWallpaperCommand() behavior changed in 
> 2.2
>
> Hi,
>
> From where are you sending a command? Commands are supposed to be sent
> by the Home application. In which case you have views and you can get
> the window token from any of these views.
>
> On Tue, Jun 1, 2010 at 2:44 AM, String <[email protected]> wrote:
> > I'm seeing a bothersome change in behavior of the live wallpaper SDK
> > in Android 2.2. Specifically, it's the windowToken parameter to
> > WallpaperManager.sendWallpaperCommand(); in the docs it's described as
> > "The window who these offsets should be associated with, as returned
> > by View.getWindowToken()." Which sounds fine, but if the live
> > wallpaper I'm trying to send a command to is the "main" one - on the
> > home screen - what view should this be?
>
> > In 2.1, I could send a null for this parameter, and it worked fine -
> > my live wallpaper got the command. In 2.2, the null produces a crash
> > by the system. Here's a logcat trace, FWIW:
>
> > E/WindowManager(   85): Window Session Crash
> > E/WindowManager(   85): java.lang.IllegalArgumentException: Requested
> > window null does not exist
> > E/WindowManager(   85):         at
> > com.android.server.WindowManagerService.windowForClientLocked(WindowManager 
> > Service.java:
> > 9244)
> > E/WindowManager(   85):         at
> > com.android.server.WindowManagerService
> > $Session.sendWallpaperCommand(WindowManagerService.java:6827)
> > E/WindowManager(   85):         at android.view.IWindowSession
> > $Stub.onTransact(IWindowSession.java:345)
> > E/WindowManager(   85):         at
> > com.android.server.WindowManagerService
> > $Session.onTransact(WindowManagerService.java:6694)
> > E/WindowManager(   85):         at
> > android.os.Binder.execTransact(Binder.java:288)
> > E/WindowManager(   85):         at
> > dalvik.system.NativeStart.run(Native Method)
>
> > Fortunately, this crash is invisible to the user, but that's small
> > consolation as the command never reaches my wallpaper.
>
> > Has anyone worked out how to get a window token for the home screen?
> > Or any other way around this? Or any other way to send a message to
> > the currently running live wallpaper?
>
> > Thanks,
>
> > String
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Romain Guy
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to