yashsingh1/xdaforums huggingface dataset:
[Hero, G2 Touch Themes and Apps] tomfreay:
Hmm, sounds like its starting up ok, then immediatly shutting itself down. Does restarting your phone fix it? I'll have a look at the code and try and figure it out, has it ever worked or always done this?

Many Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] tiagobt:
Thanks for the help, Tom.

Restarting the phone doesn't seem to help. I think the application always did that, but version 1.0 usually crashed at this point (as soon as the black screen showed up).

I'm not sure the application is shutting itself down completely. If I cover the LED another time, the black screen shows up again, but disappears in a fraction of a second, just like it did the first time (I guess that means test mode is still active). It looks like something is forcing the phone to go back to the home screen as soon as Proximity Sensor is launched.

If you think there's any kind of debugging I can do in my phone, please let me know.

Tiago

Edit: I'm not sure the following information is useful, but I have the following apps running on background: ShakeIt, WaveSecure, Advanced Task Killer, Voice Caller ID and Locale.
[Hero, G2 Touch Themes and Apps] e.japonica:
this is a very useful app for my gsm hero. thanks for your hard work =)
[Hero, G2 Touch Themes and Apps] mlgz:
Works fine on mine (v 1.5 build 2.73.405.5, french UMTS and backlight activated)

thanks for this great job

happy end year for all team
[Hero, G2 Touch Themes and Apps] tomfreay:
I've sent you a pm, hopefully be able to work out whats causing this!
[Hero, G2 Touch Themes and Apps] jeremy89632:
Hey Tom,

I found some issues with the app.

So I made a simple YouTube video to show some problems.

Thanks A million for this app :)

http://www.youtube.com/watch?v=aDY0pI9FGBA

Jeremy
[Hero, G2 Touch Themes and Apps] ichirumama:
My old Touch Pro's Energy ROM, it uses G-sensor as Proximity Sensor, when the phone is standing = light off, when it lie down 45 degrees or more = light on. It's good :D
[Hero, G2 Touch Themes and Apps] tomfreay:
Hi,

Thank you for the video, makes the problem very clear!

I think I know what the problem might be, but can I send you a version of my app which will allow me to check?

Also did you say that sometimes it force closes when its doing this?

Last thing, when testing the app you don't need to call anyone, it will work anyway. Does the problem occur if you just test it or just call someone?

Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] jeremy89632:
Sure, sure, send me, I can help you check.

Yeah, it force closes when doing this.

How could it work without calling someone?

Jeremy
[Hero, G2 Touch Themes and Apps] tomfreay:
Well it is activated when a call is made, then turned off when the call is stopped, the test mode simply activates it manually, hence the warning to disable it when your finished.

Have sent you a PM with the test version
[Hero, G2 Touch Themes and Apps] tiagobt:
Jeremy,

Your problem looks very similar to mine. The black screen is only launched when the light reading is 0x0. But my phone usually reports a light reading of 0x1 or 0x2 when I cover the light sensor. The reading 0x0 is rare and happens for a short time, causing the black screen to disappear soon after it appears.

The light readings for my phone range from 0x2E0 (in very bright light) to 0x1 (when the sensor is covered). You could compare these values to yours and see if the problem is the same.

Tiago
[Hero, G2 Touch Themes and Apps] tomfreay:
Yep thats what I think it is, just sent you an email with a version which should fix this

Tom Reay
[Hero, G2 Touch Themes and Apps] jeremy89632:
Alright, tested out the test version.

Still the same problem, start than close, and its back to the loop. However, there was more lock screen delays. (It stayed in the lock screen longer)

Than after that, it crashed.

Log will be sent shortly.

Log has already been sent to your dev account
[Hero, G2 Touch Themes and Apps] tiagobt:
Weird. It worked for me! The new Config dialog doesn't seem to work properly, but setting the threshold manually to 1 or 2 (Menu >> Settings) solved my problem. I had tried setting the threshold in previous versions, but I saw no change. This is the first version that seems to work for me.

Have you tried that?
[Hero, G2 Touch Themes and Apps] tiagobt:
That's a good idea! It could help the proximity sensor work in low lighting conditions. If the light sensor reports a low value, but the phone is not standing, there's no need to lock the screen.
[Hero, G2 Touch Themes and Apps] jeremy89632:
I second that idea. Light + G-Sensor probably?

I think G-Sensor is easier to debug, I guess.
[Hero, G2 Touch Themes and Apps] jeremy89632:
OHMY. THATS WORKING!

Changing it to 2 works!!!!!
[Hero, G2 Touch Themes and Apps] jeremy89632:
Alright, I tried it again, the app crashed again, but the app crashed as I was recording a second round of video to YouTube.

Okay, I am going to call this video as, Proximity Sensor 1.2 Beta / Video (1) Threshold: 2

So here is the video:

http://www.youtube.com/watch?v=XZU0ZtIlY-E

And here is the Log, which I pressed capture in the video:

http://pastebin.ca/1731605
[Hero, G2 Touch Themes and Apps] jeremy89632:
Alright, I did another video, on the Proximity Sensor 1.2 BETA (Video 2).

This works really well and did not crash. Threshold: 2

http://www.youtube.com/watch?v=nGDqtelzjvo

The Logs of this video can be found here:

http://pastebin.ca/1731615
[Hero, G2 Touch Themes and Apps] tomfreay:
Thanks for the videos and logs, helps me track down errors, the part that is crashing it is this:

getLightReading() = 7

V/callInProgress(18829): run(): stopping dialog

V/callInProgress(18829): run():getLightReading() = 7

V/callInProgress(18829): run(): stopping dialog

V/callInProgress(18829): run():getLightReading() = 7

V/callInProgress(18829): run(): stopping dialog

V/callInProgress(18829): run():getLightReading() = 7

V/callInProgress(18829): run(): stopping dialogV/callInProgress(18829): run():getLightReading() = 7

V/callInProgress(18829): run(): stopping dialogI/Process (18829): Sending signal. PID: 18829 SIG: 9I/ActivityManager( 58): Process TomReay.proxSensor (pid 18829) has died.W/ActivityManager( 58): Scheduling restart of crashed service TomReay.proxSensor/.callInProgress in 5000msI/WindowManager( 58): WIN DEATH:

Seems like a logic error in my code, its only supposed to call stopping dialog once! Having a look now.

Also the treshold was only for the Samsung Moment/Droid before, hence why it didn't work in previous betas. The config utility is designed to read the sensor when its covered, and set the threshold to it. Was done in a hurry though so will need some work!

Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] kalairn:
sorry, i can't get this app to work i'm running gsm hero on the modaco 3.0 mod i just can't get it to work
[Hero, G2 Touch Themes and Apps] tomfreay:
Ok, how far do you get? Going to release an update soon which will fix a couple of issues, hopefully yours is one of these!
[Hero, G2 Touch Themes and Apps] jeremy89632:
Yeah, great! I hope G- Sensor can be incorporated into it.
[Hero, G2 Touch Themes and Apps] flexgrip:
Sorry, but I was unable to get this to work on my CDMA Sprint Hero. Tried it with both autobacklight on and off. I tried it in test and call mode. I am running Modaco 1.3a.

I am rooted, so if there are any logs you would like me to grab, let me know. Should I try it with a different rom?
[Hero, G2 Touch Themes and Apps] Las_Vegas:
I installed your Proximity Sensor off of the Ap Market on my CDMA Sprint Hero. Turned AutoBacklight on as instructed and it worked a charm! Unfortunately, With AutoBacklight on, my screen dims to an unreadable state, so I turned it back off. Surprise! The Proximity Sensor still works when I get or make a call! I'm using Fresh's 1.1 ROM right now. Perhaps that's made a difference...
[Hero, G2 Touch Themes and Apps] tomfreay:
Interesting, can anyone else running that ROM confirm this?

Thanks
[Hero, G2 Touch Themes and Apps] Leukay:
Just tested with auto backlight off, and it didn't seem to work for me :/ on fresh 1.1 also. auto backlight on works, but it's low light threshold is a little high, meaning the proximity sensor is activated when phone is away from face in medium light situations.
[Hero, G2 Touch Themes and Apps] tomfreay:
Ok thanks, once I have got some bugs ironed out I will be releasing an update which lets you change the threshold, so that should help!
[Hero, G2 Touch Themes and Apps] tomfreay:
v1.2 Beta

Can some of you install and test this for me, the only major change is the addition of a threshold and configuration.

So if you install it and go into the app, then press menu->config and make sure this works.

Test it works as in previous versions, locking and unlocking the screen as its supposed too

Finally go to menu->settings and change the threshold to 99, then test again, this time it should just always lock the screen.

Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] flexgrip:
Thanks man. I was the one with the problem of it not working at all on my CDMA hero. Now it works just how it is supposed to.

I did set the threshold to 99 and when i place a call and cover the light sensor it locks the screen. But it doesn't lock it if I don't cover it at all.

Is that what you meant for it to do or is it just supposed to lock the phone no matter what when set to 99 after placing a call? if so, it didn't work for me.
[Hero, G2 Touch Themes and Apps] tomfreay:
Great! Can I ask did you do a menu->config before it worked? If so what value did it set it too?

If you have one of the Heros with really sensitive light sensors then setting the threshold to 99 might not do what I wanted, because the light level might still be doing above 99 in a bright room.

Basically I'm trying to confirm that the threshold works, can you do the following please?

1) Go into a dimly lit room

2) Do menu->config, but don't cover the sensor as it tells you to

3) Go to the menu->settings and set the threshold to anything above what the menu->config gave you in step 2

4) Now run the test mode, it should lock the screen even with the sensor uncovered

If this works then I can release the update to market

Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] kalairn:
i just did this and it worked for me
[Hero, G2 Touch Themes and Apps] rdisanza:
I have read through this entire thread, saw the problems some of you have experienced but most importantly, I saw the developer Tom right here with us doing his very best to help each of you. It's because of my need for this kind of app and the fact that the Developer was Johnny on the Spot to help us that made me give Proximity Sensor a try.

I can report that is works perfectly on my CDMA Sprint Hero running 1.5 OS.

My hat is off to Tom, thanks Buddy for a great app and backing your baby with almost instant support. The sign of a GREAT Developer!! I look forward to more of your Jewels. :D
[Hero, G2 Touch Themes and Apps] flexgrip:
It works like it is supposed to. I was in a VERY well lit room the first time I tried it. But when I got home last night and got a few calls it locked without having to cover anything. It was pretty quick too. I would notice it locked right after the call officially started. Like, when it went from dialing to showing the timer.

I guess the brightness at work was just over the 99 threshold at work. I will test it again to see if it is the brightness that did it or maybe the phone restart I did last night.
[Hero, G2 Touch Themes and Apps] tomfreay:
Thank you, very kind.

Wonderful thats what I'm looking for, with the high threshold it should lock the screen no matter what. Then when a menu->config has been performed it should lock/unlock the screen as you cover/uncover the screen

Seeing as this is all working I will be releasing this to market probably with afternoon/evening

Thanks all
[Hero, G2 Touch Themes and Apps] tomfreay:
v1.2 in the market now!

Thanks to my beta testers, as always PLEASE report and bugs/problems/suggestions to me, otherwise I can't fix them!
[Hero, G2 Touch Themes and Apps] tomfreay:
Getting reviews on the market of people getting FC's in calls with the new update, can anyone confirm this and if possible provide a log for when it happens?

Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] fabioccoelho:
For me works fine! I´m using Modaco 3.1

Nice app.

Cheers.
[Hero, G2 Touch Themes and Apps] tiagobt:
It's working fine here (no FCs so far). The configuration dialog is setting the threshold properly now. I'm also using MoDaCo 3.1.
[Hero, G2 Touch Themes and Apps] posguy99:
I've noticed that it crashes all the way out to the desktop if you try to use teh test button. Is that the expected behavior, or should it go back to the application screen?
[Hero, G2 Touch Themes and Apps] tomfreay:
By crashes do you mean force close? The expected behaviour is for it to go to the home screen, then lock the screen if you cover the sensor, unlock it if you uncover the sensor

Many Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] posguy99:
Ah! I don't think that's actually documented anywhere, I assumed that testing would cover and uncover the application screen.

This explains a few things.
[Hero, G2 Touch Themes and Apps] tomfreay:
Sorry your right its not documented! I might have a look at changing that.
[Hero, G2 Touch Themes and Apps] rivera63:
will this work for hd2?
[Hero, G2 Touch Themes and Apps] tomfreay:
The HD2 is a winmo phone? So no, it won't!

Version 1.3 is out, mainly a tidy up!

Should be a bit faster locking/unlocking and a few bugs fixed!

As always, let me know if there are any problems!

Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] tomfreay:
Also added a donate version, please consider it if you like the app!
[Hero, G2 Touch Themes and Apps] tiagobt:
Tom,

Do you think it is possible to remove the automatic screen rotation from the application? What happens is that I lean the phone backwards when I'm answering it, causing the lock screen to switch to landscape mode. When I finish the call, I put the phone in the upright position again, making it switch back to portrait mode. However, the screen rotation operation takes a few seconds, and the lock screen does not disappear until the rotation is complete. The end result is that the lock screen takes much longer to disappear than necessary.

Does that make sense?

Thanks,

Tiago
[Hero, G2 Touch Themes and Apps] tomfreay:
1.4 out, just more FC fixes
[Hero, G2 Touch Themes and Apps] tomfreay:
If you update to the latest (just released) version I have changed this for you

Thanks

Tom Reay
[Hero, G2 Touch Themes and Apps] tiagobt:
Tom,

I've just upgraded and it works great. Thanks for the fast feedback as usually.

Tiago
[Hero, G2 Touch Themes and Apps] Smirge:
omg nice app!!!! Will test the free version for a cpl of days - if no major glitches i will definately get the donate version!!!

/Smirge
[Hero, G2 Touch Themes and Apps] Yukikaze_nuce:
Not work on Wildheroc Rose 3.6. :D
[Hero, G2 Touch Themes and Apps] tanisdlj:
Installed, will see and preparing a feedback :)
[Android Software Development] jahrome:
Hi all,

Here are my findings about how to boot android from an SD card, useful for example to test development Android builds without messing your phone. This procedure was inspired by legacy GNU/Linux boot process and then should work on most hardware with a flashable recovery.

########################################

I can't stress enough the fact that this procedure is targeted to experienced user. A good knowledge of linux/android booting process is more than required. This procedure is not meant to be useful to most people given its limitations (no recovery mode, rebuild of boot.img required)

########################################

I won't propose a step by step tutorial as it's better to understand how to do it and adapt the procedure to each need.

Two modifications are required:

1. Declare to mount sd card partitions instead of internal flash volumes. This has to be done in the init.rc script.

For example:

mount yaffs2 mtd@system /system

mount yaffs2 mtd@system /system ro remount

with

mount ext2 /dev/block/mmcblk0p6 /system

2. For some reasons, in the boot process, sd card partitions generally show up later than the mount actions, so it is generally necessary to add a timer in init binary to give to to the kernel to detect sd card partitions before mounting them (adding a sleep(5) after the "A N D R O I D" text in init.c is enough).

Build your special boot.img embedding those two modifications and flash it on the recovery volume of your phone. Now, booting into recovery will launch the system on your sd.

Regards,
[Android Software Development] jahrome:
I would like to report success on booting the G1 from a system located on sd card (cyanogenmod 4.2.7.1). I will describe the procedure step by steps when every thing is okay.

There is just an issue that you might have encountered during cyanogenmod ROM cooking, all wireless connexions (wifi, BT, GSM) do not work. The same system on flash if okay. I made a diff on boot log messages and the only notable difference is this error :

E/MemoryHeapBase( 83): error opening /dev/pmem_gpu0: Permission denied

E/MemoryHeapBase( 83): error opening /dev/pmem_gpu1: Permission denied

E/MemoryHeapBase( 83): error opening /dev/hw3d: Permission denied

I tried to chmod 0555 /dev/pmem* with no success.... Any idea ?
[Android Software Development] jahrome:
Although I finally managed to have a usable system, this work is still experimental. Please fell free to test and report success, failures here so I can improve the thing.

Let's see how we can boot a copy of cyanogen ROM 4.2.7.1 located on sd card. The main purpose is to test future ROMs (eclair ?) without messing up your phone...

DISCLAIMER : This procedure is targeted to experienced user. I am not responsible if you loose your data, your phone or your Mom !

Prerequisites are :

- adb and fastboot operationnal on your host computer

- Boot image file boot.img :

http://www28.zippyshare.com/v/19654421/file.html

- files data.cpio.gz, system.cpio.gz (data.cpio.gz and system.cpio.gz are unmodified images of a fresh install of cyanogen ROM that fit the modified boot.img) from :

http://www15.zippyshare.com/v/57489279/file.html

http://www15.zippyshare.com/v/13077582/file.html

1.

Create 3 partitions on sd card. The first one (vfat) is to store your music, videos etc. The second and the third will hold /data and /system. Result shoul look like this :

# fdisk /dev/block/mmcblk0

Command (m for help): p

Disk /dev/block/mmcblk0: 1977 MB, 1977614336 bytes

64 heads, 63 sectors/track, 957 cylinders

Units = cylinders of 4032 * 512 = 2064384 bytes

Device Boot Start End Blocks Id System

/dev/block/mmcblk0p1 1 864 1741792+ c Win95 FAT32 (LBA)

/dev/block/mmcblk0p2 865 903 78624 83 Linux

/dev/block/mmcblk0p3 904 957 108864 83 Linux

Command (m for help):

2.

Copy data.cpio and system.cpio on the first partition of your sd card.

3.

Connect to your device with adb :

adb shell

4.

Mount mmcblk0p2 on temporary folder and extract user.cpio.gz archive :

mkdir /dev/tmp

mount /dev/block/mmcblk0p2 /dev/tmp

cd /dev/tmp

gunzip -c /sdcard/data.cpio.gz | cpio -i

cd /

umount /dev/tmp

5.

Mount mmcblk0p3 on temporary folder and extract system.cpio.gz archive :

mount /dev/block/mmcblk0p3 /dev/tmp

cd /dev/tmp

gunzip -c /sdcard/system.cpio.gz | cpio -i

cd /

umount /dev/tmp

6.

Reboot the phone in bootloader :

adb reboot bootloader

7.

Boot the phone with custom boot image :

unzip boot.img.zip

fastboot boot boot.img

Reports are welcome !
[Android Software Development] richbayliss:
I haven't tried this, but great idea. Well done.

Maybe a nice additional idea would be a boot-menu style idea. Eg, detect OS on mem card and display a menu of "Internal" or "SD Card"?
[Android Software Development] jahrome:
I'm on it but as it will imply flashing people's phone, I need more testing and suggestions from experienced hackers. I only own my G1 for 5 days...
[Android Software Development] naguz:
I acytually just started a thread about this in the Dream development subforum! :P

Some suggestions:

-Use a recovery image to boot the ROM on the sd card (look at modifying the CM recovery image) if this is possible. This way, you can boot from sd card when you want to, by booting into recovery image, without interfering with the flashed rom at all. No worries that flashin a new rom will require a reflash of your bootloader. Also, you can use the ROM installed in flash after a reboot without any hassle, which would be very useful when testing a ROM from the SD if it doesn't work very well and you need a working phone.

-Have the /data and /system-partition as folders on the 4th partition on the SD card, or as logical volumes on a primary one. Why?

Well, many people have their sd-cards set up with fat, extX, swap in that order. The partition layout you have described here simply isn't compatible with that, and will require a separate SD card just for this testing (which everyone might not have).

I must say, I think this is a GREAT idea! I so often want to test a few ROMS, but often they don't get the test-time they deserve because I need to swicth back to my working environment for job/uni the day after. This would be a great way to test a ROM thoroughly. And also it would be the best way to give a ROM a quick testdrive. switchroming back and forth is, for all its simplicity, hassle.
[Android Software Development] jahrome:
Using the recovery is the only way I found at the moment to boot from the sd card and was about to extend cm recovery with a dedicated menu ;) Nevertheless, there will be a limitation with that: it will not be possible to use a different kernel for the system on sd as it will have to use the kernel of the recovery... Anyway, many custom roms around here use cm kernel (even those I saw with eclair) so it is not so problematic I think (tested Eugene373 AOSP20 yesterday). Anyway, it is possible to adapt the recovery with a test kernel...

I think I found a workaround for sd partitionning scheme pb, using bind mounts but I have not tested already. I will work on it this WE.
[Android Software Development] naguz:
If I remember correctly you can use the command "reboot recovery" from the recovery shell to reboot again into recovery. It could mean that it is possible to choose what (kernel) to boot after the reboot. Even cyanogenmod has made quite a few changes to the kernel since the recovery image came out, and I think it would not be a very good solution to use the same kernel as the recovery image for all ROMs loaded via SD. (Especially the Hero ones won't work at all, I'm afraid.

It could also be possible maybe, to tweak the built-in bootloader into booting form either SD-card or from the internal flash? It already has the possibility to boot different things on different keypresses (home for recovery mode, and camera for fastboot). I have (again) no idea of its capabilities for reading anything off of the sd card, though.
[Android Software Development] jahrome:
I get your point naguz ;). I am not satisfied either with the solution of using the recovery kernel to boot the system on sd. I found that it adds quite much complexity to the init process: I tweaked the recovery executable to add an entry to boot from sd but I faced troubles in services startup and pre-init definitions. I think that the solution of using the recovery menu to choose to boot from sd have to be abandoned as it will require heavy additional changes to the init.rc scripts of the second system and will break its advanced features.

The ideal solution (as you suggested) would be to tweak the bootloader to boot natively from the sd card but unfortunately, we do not have the sources of the SPL (tell me if I am wrong) so it is definitely not possible.

The remaining solution is to use the recovery partition to flash the boot image of the second system. I works well, just press the home key and the second system boots ! The drawback is that you do not have recovery any more... Personnaly, I don't find that so problematic as I is still possible to boot a recovery image with fastboot when needed, so I think I will stick to this solution. I somebody have another solution, I am ok to investigate...