Hi,

Thanks for the answer, actually it is true that by default it comes
with the F1 key so i did not need to add a mapping for F5.

In any case, the problem is not there but on the batteries.

I tried using a fake battery driver for the linux kernel that i found
here:

# git clone 
git://git.linuxconsulting.ro/kernel-2.6.30-android-atmel-g45-minibox.git
kernel-atmel
# drivers/power/adbattery.c, Kconfig, Makefile

But i kept having the same problem: could not unlock the screen, or if
i unlocked it by commeting out showLocked()  in phone/com/android/
internal/policy/impl/KeyguardViewMediator.java i could not use the
menu or home key.

Finally ive tried adapting the dummy-battery.patch in
http://labs.beatcraft.com/en/index.php?plugin=attach&refer=bc9%2FSoftware%2FAndroid%2FALSA_integrated_userland&openfile=dummy-battery.patch
to Froyo.

This actually worked more or less, although it is not completely
working...

Somebody knows how to add a fake battery to android froyo??

On Jul 23, 4:29 pm, abukustfan <abukust...@gmail.com> wrote:
> Hi,
>
> I also use USB keyboard, but MENU key is mapped as [F1] key.
>
> On Jul 20, 4:58 pm, Daniel <daniel.sangor...@gmail.com> wrote:
>
> > Hi,
>
> > I am trying to port Android (2.2_r1.1) to an ARM11 board which runs on
> > AC power (no batteries!!) and where im using a USB keyboard as input
> > device.
>
> > So far, Android initializes without problems and I get to the first
> > screen when you have to press MENU to unlock it. I have modified the
> > qwerty.kl file so that MENU is mapped to F5 key.
>
> > qwerty.kl:
> > key 63    MENU              WAKE_DROPPED
>
> > (NOTE: also tried with WAKE instead of WAKE_DROPPED)
>
> > When I press the F5 key i see this on the logcat log:
>
> > D/KeyguardViewMediator(  702): wakeWhenReadyLocked(82)
> > D/KeyguardViewMediator(  702): handleWakeWhenReady(82)
> > D/KeyguardViewMediator(  702): pokeWakelock(5000)
> > I/power   (  702): *** set_screen_state 1
>
> > It seems that KeyguardViewMediator is receiving the MENU key correctly
> > (since that is the code in KeyEvent.java):
>
> > public static final int KEYCODE_MENU  = 82;
>
> > Therefore, the keyboard seems to be OK. Unfortunately the screen is
> > not unlocked!!
>
> > NOTE: I have also tried using the sendevent tool, but the result is
> > the same.
>
> > The android system that i built works correctly when i run it on the
> > Emulator (../android-sdk-linux_86/tools/emulator -avd avd22 -
> > system ....) where i can unlock the screen without problems, for
> > example using the sendevent or using the artificial keyboard in the
> > emulator.
>
> > I tried to put the same fake battery properties in the init.rc for the
> > board:
>
> >     setprop status.battery.state Slow
> >     setprop status.battery.level 5
> >     setprop status.battery.level_raw  50
> >     setprop status.battery.level_scale 9
>
> > But nothing changed...
>
> > So far, my conclusion is that the problem is probably related with the
> > wakelocks and the lack of batteries or appropriate power management
> > support for my board. The reason for thinking that is that in the
> > Emulator, the messages that appear when i press the MENU key is just:
>
> > D/KeyguardViewMediator(   61): pokeWakelock(5000)
>
> > That is, no message related to set_screen_state as it happens in the
> > board.
>
> > In the kernel (android-2.6.32) i have selected a generic power driver
> > because i dont have any battery and this options (of course, android
> > drivers such IPC binder, low memory killer etc are enabled):
>
> > CONFIG_POWER_SUPPLY=y
> > CONFIG_PDA_POWER=y
> > CONFIG_PM=y
> > CONFIG_HAS_WAKELOCK=y
> > CONFIG_HAS_EARLYSUSPEND=y
> > CONFIG_WAKELOCK=y
> > CONFIG_WAKELOCK_STAT=y
> > CONFIG_USER_WAKELOCK=y
> > CONFIG_EARLYSUSPEND=y
> > CONFIG_CONSOLE_EARLYSUSPEND=y
>
> > These are the error messages related to the batteries at
> > initialization time:
>
> > E/BatteryService(  702): acOnlinePath not found
> > E/BatteryService(  702): usbOnlinePath not found
> > E/BatteryService(  702): batteryStatusPath not found
> > E/BatteryService(  702): batteryHealthPath not found
> > E/BatteryService(  702): batteryPresentPath not found
> > E/BatteryService(  702): batteryCapacityPath not found
> > E/BatteryService(  702): batteryVoltagePath not found
> > E/BatteryService(  702): batteryTemperaturePath not found
> > E/BatteryService(  702): batteryTechnologyPath not found
> > ...
> > E/SurfaceFlinger(  702): Couldn't open /sys/power/wait_for_fb_sleep
> > or /sys/power/wait_for_fb_wake
>
> > NOTE: the last one and the ones about  usbOnlinePath,
> > batteryVoltagePath and batteryTemperaturePath appear also in the
> > emulator version
>
> > Could somebody give me a hint of what should i do to make it work?
>
> > Could it be related to the wakelocks and the fact that the device
> > doesnt have batteries?
>
> > Is there any way to fake the batteries without modifying the code of
> > the KeyGuard java file?
>
> > Note: in the emulator case, i can see some code related to power in
> > hardware/libhardware_legacy/power/. Should i write something like
> > that?
>
> > Thanks in advance
> > Daniel

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

Reply via email to