> When I change the sys file properties of the files in OLD_PATHS and
> NEW_PATHS to 666 mouse movement events are processed. What??? yes
> (OLD_PATHS and NEW_PATHS are defined
> in /hardware/libhardware_legacy/power/power.c)
> 
The power.c runs as system I think, and the files in /sys/power has rw
for the system group. It should be able to be accessed by power.c

BTW-- on all the x86 systems I ever used, I did not see OLD_PATHS in
sysfs. Do you see it in your env?
> So I wonder how can this work anyway on any machine or is it just
> QEMU ..............
No, it seems that only you have the problem.
Really, I only seen the same problem when we did not enable the wakelock
driver in the kernel. And that was 10 months ago.

Yi
On Wed, 2009-12-30 at 20:49 +0100, hedwin wrote:
> Hi,
> 
> Dug a little deeper now.
> 
> Handling mouse movement indirectly depends on the power state of
> android. Eh what ????
> 
> Mouse events are handled by the InputDeviceReader. This thread calls
> method 'preprocessEvent' in the WindowManagerService. The method
> itself then calls mPowerManager.screenIsOn. This method returns false
> for reason I explain later. This eventually results in preprocessEvent
> to return 0 and as a result the mouse movement events are not handled.
> Therefor not moving mouse pointer.
> 
> Ok
> 
> Now to the why screenIsOn return false. When android starts it will
> eventually execute initInThread in PowerManagementService. At the end
> setPowerState(ALL_BRIGHT) is called. So far
> so good. The method setPowerState will call
> Power.setScreenState(true). Still going ok. Power.setScreenState is a
> function implemented in /base/core/jni/android_os_power.cpp. 
> The function Power.setScreenState will eventually call function
> set_screen_state implemented
> in /hardware/libhardware_legacy/power/power.c. The function
> set_screen_state will at the begining
> call initialize_fds. And here is where it goes wrong because
> initialize_fds cannot open the files mentioned in the array OLD_PATHS
> and NEW_PATHS. The reason why it cannot
> open the files is because the filesystem properties are set to 660 in
> init.rc. For this reason the power change never takes places and
> indirectly prevents the move movement events from 
> being handled. 
> 
> When I change the sys file properties of the files in OLD_PATHS and
> NEW_PATHS to 666 mouse movement events are processed. What??? yes
> (OLD_PATHS and NEW_PATHS are defined
> in /hardware/libhardware_legacy/power/power.c)
> 
> So I wonder how can this work anyway on any machine or is it just
> QEMU ..............
> 
> Hedwin
> 
> On Sat, Dec 26, 2009 at 8:55 PM, Yi Sun <beyo...@gmail.com> wrote:
>         If you use the latest qemu, would you still need these
>         changes?
>         Yi
>         
>         On Sat, 2009-12-26 at 20:14 +0100, hedwin wrote:
>         > The serial is just added to see the kernel boot an have
>         access to the
>         > console later on.
>         > I use a slight older qemu, the one supplied with fedora.
>         Newer qemu
>         > versions use usb per
>         > default. That might be the reason why you did no have to
>         provide the
>         > usb arguments.
>         >
>         > Hedwin
>         >
>         > On Sat, Dec 26, 2009 at 7:39 PM, Yi Sun <beyo...@gmail.com>
>         wrote:
>         >         Thanks for the help.
>         >         FYI-- in my env, I did not really add "-serial stdio
>         -usb
>         >         -usbdevice
>         >         mouse" for my usb mouse to work with qemu. I'm not
>         sure why
>         >         you need it.
>         >         I may have to check on the qemu manual.
>         >         Yi
>         >
>         >         On Sat, 2009-12-26 at 19:32 +0100, hedwin wrote:
>         >         > agree, so consider it a workaround. I will take a
>         further
>         >         look into
>         >         > this
>         >         >
>         >         > Hedwin
>         >         >
>         >         > On Sat, Dec 26, 2009 at 7:29 PM, Yi Sun
>         <beyo...@gmail.com>
>         >         wrote:
>         >         >         BTW-- the patch does not look like a fix
>         but a hack
>         >         when we
>         >         >         don't know
>         >         >         what really went wrong. Would it possible
>         for you to
>         >         find out
>         >         >         why the
>         >         >         Android thinks that the screen is not on
>         in your
>         >         case. We may
>         >         >         have a bug
>         >         >         somewhere else.
>         >         >             boolean screenIsOn() {
>         >         >                 synchronized (mLocks) {
>         >         >         +           mPowerState |= SCREEN_ON_BIT;
>         >         >                     return (mPowerState &
>         SCREEN_ON_BIT) !=
>         >         0;
>         >         >                 }
>         >         >             }
>         >         >
>         >         >
>         >         >         On Sat, 2009-12-26 at 19:13 +0100, hedwin
>         wrote:
>         >         >
>         >         >
>         >         >         > www.android-x86.org
>         >         >         >
>         >         >         > Reason it doesn't work is that android
>         thinks the
>         >         screen is
>         >         >         off.
>         >         >         > Issue 62 contains the solution to get it
>         working.
>         >         >         >
>         >         >         > Hedwin
>         >         >         >
>         >         >         > On Sat, Dec 26, 2009 at 6:52 PM, Yi Sun
>         >         <beyo...@gmail.com>
>         >         >         wrote:
>         >         >         >         The mouse should work on
>         Android-x86.org
>         >         out of box.
>         >         >         Where did
>         >         >         >         you get
>         >         >         >         your source code for your
>         android-x86?
>         >         >         >         Yi
>         >         >         >
>         >         >         >         On Wed, 2009-12-23 at 12:44
>         +0100, hedwin
>         >         wrote:
>         >         >         >         > Meant to say is that it did
>         not work
>         >         because
>         >         >         android thinks
>         >         >         >         the screen is off.
>         >         >         >         >
>         >         >         >         > Will provide the details when
>         I am back
>         >         home.
>         >         >         >         >
>         >         >         >         > Hedwin
>         >         >         >         >
>         >         >         >         > On Wed, Dec 23, 2009 at 12:43
>         PM, hedwin
>         >         >         >         <hedwin.kon...@gmail.com> wrote:
>         >         >         >         > > Got the mouse working on
>         android-x86
>         >         donut.
>         >         >         >         > >
>         >         >         >         > > Reason it did work is
>         because android
>         >         thinks the
>         >         >         screen is
>         >         >         >         off.
>         >         >         >         > >
>         >         >         >         > > Hedwin
>         >         >         >         > >
>         >         >         >         > > On Sat, Dec 19, 2009 at 9:20
>         AM, jian
>         >         qin
>         >         >         >         <qinjiana0...@gmail.com> wrote:
>         >         >         >         > >> yeah,I want do this,because
>         I havn't
>         >         any touch
>         >         >         >         screen,thanks you guys,I will
>         >         >         >         > >> try.
>         >         >         >         > >>
>         >         >         >         > >> 2009/12/18 hedwin
>         >         <hedwin.kon...@gmail.com>
>         >         >         >         > >>>
>         >         >         >         > >>> Working on that, were
>         would you
>         >         expect the
>         >         >         mouse
>         >         >         >         handling to take
>         >         >         >         > >>> place in android?
>         >         >         >         > >>>
>         >         >         >         > >>> On Thu, Dec 17, 2009 at
>         8:32 AM, Yi
>         >         Sun
>         >         >         >         <beyo...@gmail.com> wrote:
>         >         >         >         > >>> > Yes, that is mips, so do
>         check the
>         >         upstream
>         >         >         otherwise
>         >         >         >         it is confusing.
>         >         >         >         > >>> >
>         >         >         >         > >>> > On Wed, Dec 16, 2009 at
>         11:07 PM,
>         >         hedwin
>         >         >         >         <hedwin.kon...@gmail.com>
>         >         >         >         > >>> > wrote:
>         >         >         >         > >>> >> USB mouse and keyboard
>         do work,
>         >         only
>         >         >         enabled them in
>         >         >         >         the kernel and it
>         >         >         >         > >>> >> worked without any
>         change to
>         >         android.
>         >         >         >         > >>> >> But then again was
>         using the mips
>         >         android
>         >         >         so not sure
>         >         >         >         yet if specific
>         >         >         >         > >>> >> changes were made there
>         that
>         >         makes it work.
>         >         >         >         > >>> >>
>         >         >         >         > >>> >> Hedwin
>         >         >         >         > >>> >>
>         >         >         >         > >>> >> On Wed, Dec 16, 2009 at
>         7:09 PM,
>         >         Yi Sun
>         >         >         >         <beyo...@gmail.com> wrote:
>         >         >         >         > >>> >>> Android does not
>         support mouse
>         >         by default.
>         >         >         But you
>         >         >         >         can pick up all the
>         >         >         >         > >>> >>> changes from
>         android-x86.org for
>         >         the mouse
>         >         >         support.
>         >         >         >         Check the git logs
>         >         >         >         > >>> >>> in frameworks/base and
>         >         >         frameworks/policy/base. You
>         >         >         >         will be abel to
>         >         >         >         > >>> >>> find
>         >         >         >         > >>> >>> the changes
>         >         >         >         > >>> >>> And, yes, you need to
>         enabled
>         >         your mouse
>         >         >         driver in
>         >         >         >         the kernel first.
>         >         >         >         > >>> >>> Yi
>         >         >         >         > >>> >>> On Wed, 2009-12-16 at
>         14:56
>         >         +0100, hedwin
>         >         >         wrote:
>         >         >         >         > >>> >>>> You need to enable
>         this in the
>         >         linux
>         >         >         kernel.
>         >         >         >         > >>> >>>>
>         >         >         >         > >>> >>>> Hedwin
>         >         >         >         > >>> >>>>
>         >         >         >         > >>> >>>> On Wed, Dec 16, 2009
>         at 4:02
>         >         AM, jian qin
>         >         >         >         <qinjiana0...@gmail.com>
>         >         >         >         > >>> >>>> wrote:
>         >         >         >         > >>> >>>> > I want know how to
>         use mouse
>         >         in
>         >         >         Android,please
>         >         >         >         help me.
>         >         >         >         > >>> >>>> >
>         >         >         >         > >>> >>>> > --
>         >         >         >         > >>> >>>> > unsubscribe:
>         android-porting
>         >         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > >>> >>>> > website:
>         >         >         >
>         >         http://groups.google.com/group/android-porting
>         >         >         >         > >>> >>>>
>         >         >         >         > >>> >>>> --
>         >         >         >         > >>> >>>> unsubscribe:
>         android-porting
>         >         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > >>> >>>> website:
>         >         >         >
>         >         http://groups.google.com/group/android-porting
>         >         >         >         > >>> >>>
>         >         >         >         > >>> >>>
>         >         >         >         > >>> >>> --
>         >         >         >         > >>> >>> Android-x86
>         >         >         >         > >>> >>> www.android-x86.org
>         >         >         >         > >>> >>>
>         >         >         >         > >>> >>> --
>         >         >         >         > >>> >>> unsubscribe:
>         android-porting
>         >         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > >>> >>> website:
>         >         >         >
>         >         http://groups.google.com/group/android-porting
>         >         >         >         > >>> >>
>         >         >         >         > >>> >> --
>         >         >         >         > >>> >> unsubscribe:
>         android-porting
>         >         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > >>> >> website:
>         >         >         >
>         >         http://groups.google.com/group/android-porting
>         >         >         >         > >>> >
>         >         >         >         > >>> >
>         >         >         >         > >>> >
>         >         >         >         > >>> > --
>         >         >         >         > >>> > Android-x86
>         >         >         >         > >>> >
>         http://www.android-x86.org
>         >         >         >         > >>> >
>         >         >         >         > >>> > --
>         >         >         >         > >>> > unsubscribe:
>         android-porting
>         >         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > >>> > website:
>         >         >         >
>         >         http://groups.google.com/group/android-porting
>         >         >         >         > >>>
>         >         >         >         > >>> --
>         >         >         >         > >>> unsubscribe:
>         android-porting
>         >         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > >>> website:
>         >         >
>         http://groups.google.com/group/android-porting
>         >         >         >         > >>
>         >         >         >         > >> --
>         >         >         >         > >> unsubscribe:
>         android-porting
>         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > >> website:
>         >         >
>         http://groups.google.com/group/android-porting
>         >         >         >         > >
>         >         >         >         >
>         >         >         >
>         >         >         >         > --
>         >         >         >
>         >         >         >         > unsubscribe: android-porting
>         >         >         +unsubscr...@googlegroups.com
>         >         >         >         > website:
>         >         >
>         http://groups.google.com/group/android-porting
>         >         >         >
>         >         >         >
>         >         >         >         --
>         >         >         >         Android-x86
>         >         >         >         www.android-x86.org
>         >         >         >
>         >         >         >         --
>         >         >         >         unsubscribe: android-porting
>         >         >         +unsubscr...@googlegroups.com
>         >         >         >         website:
>         >         >
>         http://groups.google.com/group/android-porting
>         >         >         >
>         >         >         >
>         >         >         >
>         >         >
>         >         >         > --
>         >         >
>         >         >         > unsubscribe: android-porting
>         >         +unsubscr...@googlegroups.com
>         >         >         > website:
>         >         http://groups.google.com/group/android-porting
>         >         >
>         >         >
>         >         >         --
>         >         >         Android-x86
>         >         >         www.android-x86.org
>         >         >
>         >         >         --
>         >         >         unsubscribe: android-porting
>         >         +unsubscr...@googlegroups.com
>         >         >         website:
>         >         http://groups.google.com/group/android-porting
>         >         >
>         >         >
>         >         >
>         >
>         >         > --
>         >
>         >         > unsubscribe: android-porting
>         +unsubscr...@googlegroups.com
>         >         > website:
>         http://groups.google.com/group/android-porting
>         >
>         >
>         >         --
>         >         Android-x86
>         >         www.android-x86.org
>         >
>         >         --
>         >         unsubscribe: android-porting
>         +unsubscr...@googlegroups.com
>         >         website:
>         http://groups.google.com/group/android-porting
>         >
>         >
>         >
>         
>         > --
>         
>         > unsubscribe: android-porting+unsubscr...@googlegroups.com
>         > website: http://groups.google.com/group/android-porting
>         
>         
>         --
>         Android-x86
>         www.android-x86.org
>         
>         --
>         unsubscribe: android-porting+unsubscr...@googlegroups.com
>         website: http://groups.google.com/group/android-porting
> 
> 
> 
> -- 
> unsubscribe: android-porting+unsubscr...@googlegroups.com
> website: http://groups.google.com/group/android-porting


-- 
Android-x86
www.android-x86.org

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to