Proximity Sensor Bug Fixed, .Screen turns off during call.ISSUE FIXED - Galaxy S 4 General

Methods that worked for me.
Method 1.
Blow Air it will solve your prob hopefully.
Method 2.
go to samsung code *#0*#. then SENSORS and Read your Proximity sensor values.
<<< DECISION >>>>>
####Calibration isnot needed if ####
.
your phone doesnt vibrate in normal but does so when u physically put your finger on the Sensor.
#### Calibration needed if ####
.
your phone is vibrating in this menu no matter what, you put your finger on the sensor or not
Follow these steps
1. download Android Terminal from store
2. type these commands to calibrate automatically
$ su
# echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
# echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
Reboot and see if it works.go to *#0*# and check if it continuously vibrating or only does so when you put your finger on the SENSOR.
<<<< IF Continuously Vibrating Follow these steps>>>>
you need to manually put values in ur /efs/prox_cal.it Reads Hexadecimal value. so you have to convert your decimal values into HEX.
##### FIND YOUR Decimal Values and pushing them into /efs/prox_cal ######
Method : finding two values for calibration . offset + normal value.
##.. FINDING OFFSET ######
cat /sys/devices/virtual/sensors/proximity_sensor/prox_cal
note down the values it returns.. mine is 5,64,100.. you only need the 1st value which is 5.
### FINDING NORMAL STATE ######
cat /sys/devices/virtual/sensors/proximity_sensor/state
note down the value if returns. mine is 64
now ADD OFFSET value + Normal Value
5 + 64 = 69
Convert in Hexadecimal which is 45.
NOTE: sometimes normal value is 0, its OK you do you math and convert 1st OFFSET into hex. using lower case for Hex values in steps below.
<<<<<<<<<<< Pushing the value in /efs/prox_cal >>>>>>>>>>>>>>
# echo -en $ '\x45' > /efs/prox_cal
then
# chown system:system /efs/prox_cal
# chmod 644 /efs/prox_cal
# sync
# Reboot
All done. after that go to *#0*# then SENSORS and move your finger on the sensor, yout phone will Vibrate only when you put your finger on the sensors.
Manual method worked for me.
ENJOY.
NOTE: I am not a developer. i was just stuck with this problem for so long so now i found it from "mcelicalderon". who posted this method some where

Wow thanks. Skype totally killed my phone because of this and I thought it was a bug but the manual calibration fixed it. Cheers.
Sent from my GT-I9505 using Tapatalk

THANKS
Manual Method worked for me,
ps there is no SPACE after $ sign e.g. $'\x0a'

no needed for 4.4.2
i_fain said:
Manual Method worked for me,
ps there is no SPACE after $ sign e.g. $'\x0a'
Click to expand...
Click to collapse

EclipseX said:
no needed for 4.4.2
Click to expand...
Click to collapse
Thank you very much, which rom are you using> I want to try if everything is working. Of course I need knox :silly:

just the leak release from samsung 4.4.2 the last one 2 january 2014
i_fain said:
Thank you very much, which rom are you using> I want to try if everything is working. Of course I need knox :silly:
Click to expand...
Click to collapse

EclipseX said:
just the leak release from samsung 4.4.2 the last one 2 january 2014
Click to expand...
Click to collapse
Yes, I have that, please tell me if there is anything not working that you have noticed. One more thing did you wipe data or apps remains working after install?
Sent from my GT-I9505 using Tapatalk

I came from 4.3 stock
Install via Odin without wipe.....after install I've wipe the dalvik cache
I have only one complain...the taskmanager don't work propretly
Everything else work like a charm
i_fain said:
Yes, I have that, please tell me if there is anything not working that you have noticed. One more thing did you wipe data or apps remains working after install?
Sent from my GT-I9505 using Tapatalk
Click to expand...
Click to collapse

Method 2. go to samsung code *#0*#. - doesn't work
Is there any reason why it shouldn't work on i9505g version 4.4.2?

Stunn2 said:
Is there any reason why it shouldn't work on i9505g version 4.4.2?
Click to expand...
Click to collapse
I fixed mine on an i9505 using an i9505g rom, so I guess not.
Sent from my GT-I9505G using Tapatalk 2

Edgio60 said:
I fixed mine on an i9505 using an i9505g rom, so I guess not.
Sent from my GT-I9505G using Tapatalk 2
Click to expand...
Click to collapse
I thought there would be an equivalent tester on the google edition....

10 Million thanks for this!!!
Ammar Saood said:
Methods that worked for me.
Method 1.
Blow Air it will solve your prob hopefully.
Method 2.
go to samsung code *#0*#. then SENSORS and Read your Proximity sensor values.
<<< DECISION >>>>>
####Calibration isnot needed if ####
.
your phone doesnt vibrate in normal but does so when u physically put your finger on the Sensor.
#### Calibration needed if ####
.
your phone is vibrating in this menu no matter what, you put your finger on the sensor or not
Follow these steps
1. download Android Terminal from store
2. type these commands to calibrate automatically
$ su
# echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
# echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
Reboot and see if it works.go to *#0*# and check if it continuously vibrating or only does so when you put your finger on the SENSOR.
<<<< IF Continuously Vibrating Follow these steps>>>>
you need to manually put values in ur /efs/prox_cal.it Reads Hexadecimal value. so you have to convert your decimal values into HEX.
##### FIND YOUR Decimal Values and pushing them into /efs/prox_cal ######
Method : finding two values for calibration . offset + normal value.
##.. FINDING OFFSET ######
cat /sys/devices/virtual/sensors/proximity_sensor/prox_cal
note down the values it returns.. mine is 5,64,100.. you only need the 1st value which is 5.
### FINDING NORMAL STATE ######
cat /sys/devices/virtual/sensors/proximity_sensor/state
note down the value if returns. mine is 64
now ADD OFFSET value + Normal Value
5 + 64 = 69
Convert in Hexadecimal which is 45.
<<<<<<<<<<< Pushing the value in /efs/prox_cal >>>>>>>>>>>>>>
# echo -en $ '\x45' > /efs/prox_cal
then
# chown system:system /efs/prox_cal
# chmod 644 /efs/prox_cal
# sync
# Reboot
All done. after that go to *#0*# then SENSORS and move your finger on the sensor, yout phone will Vibrate only when you put your finger on the sensors.
Manual method worked for me.
ENJOY.
NOTE: I am not a developer. i was just stuck with this problem for so long so now i found it from "mcelicalderon". who posted this method some where
Click to expand...
Click to collapse
10 million thanks for this!!!, I´d say you were sent by an angel, I was looking for my opperator's stock ROM to flash it and ask for warranty because of this problem and I accidentally found your thread. The manual method worked perfectly.
Now one question: Is it necessary to follow this procedure each time I install a new rom?

0ptimus82 said:
10 million thanks for this!!!, I´d say you were sent by an angel, I was looking for my opperator's stock ROM to flash it and ask for warranty because of this problem and I accidentally found your thread. The manual method worked perfectly.
Now one question: Is it necessary to follow this procedure each time I install a new rom?
Click to expand...
Click to collapse
Thanks Dear.. it delighted me that it worked for your ..
nope ... i flashed 100 other roms .. and it stays the same .. and sensor works properly.. :

Thank for this. It has fixed my wifes samsung s3. A few things that might help others..
My problem stared when I replaced a cracked screen
The echo 0 & 1 worked, but didn't keep after a reboot
After putting the new calibration value in /efs/prox_cal, I forgot (read 'too lazy') to do the chown and chmod and it was lost when I rebooted. The next time I did the chown & chmod and the value was saved.
For me, after I did the echo 0 & 1, I could see that /efs/prox_cal had been updated (which was then lost on reboot)
I tried doing a echo 0 & 1 (which updated /efs/prox_cal) and then I did the chown & chmod. This permanently saved the values for me.
Summary - If echo'ing 0 & 1 into prox_cal is lost after a reboot, try the following before going to the effort to calculate the calibration value
Code:
$ su
$ echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ chown system:system /efs/prox_cal
$ chmod 644 /efs/prox_cal
$ sync
YMMV

seamusph said:
Thank for this. It has fixed my wifes samsung s3. A few things that might help others..
My problem stared when I replaced a cracked screen
The echo 0 & 1 worked, but didn't keep after a reboot
After putting the new calibration value in /efs/prox_cal, I forgot (read 'too lazy') to do the chown and chmod and it was lost when I rebooted. The next time I did the chown & chmod and the value was saved.
For me, after I did the echo 0 & 1, I could see that /efs/prox_cal had been updated (which was then lost on reboot)
I tried doing a echo 0 & 1 (which updated /efs/prox_cal) and then I did the chown & chmod. This permanently saved the values for me.
Summary - If echo'ing 0 & 1 into prox_cal is lost after a reboot, try the following before going to the effort to calculate the calibration value
Code:
$ su
$ echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ chown system:system /efs/prox_cal
$ chmod 644 /efs/prox_cal
$ sync
YMMV
Click to expand...
Click to collapse
Just want to say that just performing these steps has fixed the problem. (which was that the sensor would turn the screen off and then would be stuck at " near possition" until the process using it was terminated and restared e.g a phone call)

I'm still watching on, but looks like it really works... in my case, my values were different and based on it I still had the problem, then I tried input 45 as in OP and it solved. Thank you very much for sharing!
Enviado de meu GT-I9500 usando Tapatalk

When I try this it says ussd code running..... Unable to process request.
Any idea why I can't access that menu?
Sent from my GT-I9505G using Tapatalk

I fixed my sensor by opening my phone and disconnecting the sensor and cleaning it from the inside! But good guide tho.

i changed the digitizer like twice.... then i start to have this issue when calling.... and i couldn't end the call because the screen won't turn on.... blowing air amazingly worked for me
Sent from dish washer

thank you
This is caused by dirt

Related

LED debugging in Hero (6-22-09)

WOW OK SO I FINALLY GOT LED's WORKING IN HERO!!!
This means they can be manipulated via Terminal but not the Android OS. That will be the next step.
*IMPORTANT 4:50pm CST*
-Correction, you should be copying/symlinking sensors.msm7k.so to sensors.trout.so and not sensors.hero.so to sensors.trout.so. Please see updated instructions below.
If you already copied sensors.hero.so to sensors.trout.so then do the following to fix it. Following the previous instructions could affect auto rotate
Code:
rm /system/lib/hw/sensors.trout.so
ln -s /system/lib/hw/sensors.msm7k /system/lib/hw/sensors.trout.so
*Update 4:44pm CST*
-Changed copy commands to symlink so we save space on /system. Thanks for the tip chunga
*Update 6:01pm CST*
-If you're getting an issue where auto-rotate is no longer working it's most likely you fudged on the symlinking sensors.msm7k.so over to sensors.trout.so.
*Update 9:37pm CST*
-Forgot to add that you need to have /system remounted as read/write. I have added the command below
*Update 8:00pm CST*
The following command does not persist across reboots, therefore it will need to be placed in /init.rc or in /system/init.rc if you have a modded rom that allows for it. Just so everyone is clear, you can NOT edit /init.rc directly. To do that you'll need to unpack boot.img, edit init.rc, then repack boot.img and fastboot flash it to your device. My advice is to download a modded ROM that gets released with this fix.
Code:
echo "1" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/blink
It was a pretty trick fix to figure out. Here is a revised post with the complete terminal commands. ROM devs you could place these chmod commands in /init.rc to get it working. Please give credit where credit is due if you use my fixes.
Code:
[B]TERMINAL COMMANDS[/B]
mount -o rw,remount /dev/block/mtdblock3 /system
ln -s /system/lib/hw/lights.msm7k.so /system/lib/hw/lights.trout.so
ln -s /system/lib/hw/copybit.msm7k.so /system/lib/hw/copybit.trout.so
ln -s /system/lib/hw/sensors.msm7k.so /system/lib/hw/sensors.trout.so
echo "1" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/blink
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/blue/brightness
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/red/brightness
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/green/brightness
What's left to fix?
1) Currently the system is only giving the LED's a brightness of 1 so the light that comes on is dim. We need to find where it's getting this default value and up it to 100.
Want to manually change the colors?
You can edit the "brightness" value under leds/[blue/red/green] . The acceptable values are from 0 - 100. If you mix them up you can make any color you want
Exampe to change colors manually:
Code:
echo "50" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/blue/brightness
echo "50" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/red/brightness
This would make a purplish color.
okay so does it change colors when its charging after its cut on.
I believe the hero has dual LEDs. It says something about it in logcat...Let me see if i can find it.
jaygajay said:
I believe the hero has dual LEDs. It says something about it in logcat...Let me see if i can find it.
Click to expand...
Click to collapse
Yes it does in fact have dual LED's. So the trick now that LED's work is to get it working just like it was in cupcake. I'll keep working at it you can be sure of that
wizern23 said:
okay so does it change colors when its charging after its cut on.
Click to expand...
Click to collapse
I haven't seen it change colors as my phone is fully charged so the green LED comes on. Since we don't have bluetooth I can't check for the blue LED working. Anyone have chompsms installed? I know you can pick which LED color you want. Anyone wanna test that it's all working?
Terminal codes?
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Try missed call, you can easily sample the different colors
phungshum said:
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Click to expand...
Click to collapse
I updated the main post so others can easily find it
phungshum said:
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Click to expand...
Click to collapse
this is actually editing the init.rc script... what do i open that in to edit it? and after edit can i just remount my system as writable and change the file names in my sys/lib/hw folder to the explained file names?
Zarboz said:
this is actually editing the init.rc script... what do i open that in to edit it? and after edit can i just remount my system as writable and change the file names in my sys/lib/hw folder to the explained file names?
Click to expand...
Click to collapse
You can type those commands from the terminal. If ROM devs want to make it so installing their ROM automatically does this, they would do it in init.rc.
You and I can do this from the terminal. It should hold those changes across a reboot. Hmmmm, lemme reboot and make sure otherwise it would require unpacking/repacking the boot.img and making the changes to init.rc in there. You can not edit init.rc directly. You have to extract boot.img (you can get this from the ROM you installed). Do a search for unpacking/repacking boot.img
great news
Good job shafty.
tried it, works, restarted my phone by itself after the echo though. Little confuse about the chmod stuff so not gonna try that yet. Oh did it in adb too, thanks.
EDIT: seemed to break my 'g-sensor', so no auto-rotate.
this is going into 1.65 Thanks shafty023 for the work!
running jacman hero and his lights.msm7k.so is already renamed do i need to worry about this and after the chmod lines after the /brightness/ can i enter a modifier to change the ammount of light given out?
just to clarify the terminal commands,
using JACMAN 1.64, files are already renamed.
Zarboz said:
running jacman hero and his lights.msm7k.so is already renamed do i need to worry about this and after the chmod lines after the /brightness/ can i enter a modifier to change the ammount of light given out?
Click to expand...
Click to collapse
Ya that's because he got it from justanothercrowd who got it from me. I was sending him most of my fixes directly since I'm using his ROM. Only seemed fair.
So you can ignore the line pertaining to lights.msm7k.
Yes you can feel free to change the value in brightness to whatever you want. I actually think the max is somewhere around 256. You can mix brightness values and that will allow you to change the colors manually. But unfortunately when you plug an a/c adapter it turns on the green led at a brightness value of only 1
so for example at the endo f my chmod 666 .... /brightness/100 ?? or would it be /brightness100
cool! thanks for the fix!
did nothing for me? wonder what i did wrong

[HOW TO] Create your own Frequency Table. Works on 2.2

Ok so I Overclocked/undervolted via Milestone Overclock - no problems, however it got me thinking, all we are doing with this app is changing the maximum frequency and the maximum vsel.
I was looking for some extra oomph but also wanted to maximise battery life. My current set up is a 900mhz/46vsel maximum, but what about the other available frequencies - 600/300mhz - we ain't touching the vsel on these - are we getting the most out of this??
I did a bit of delving around so firstly I found the following when performing a cat /proc/overclock/mpu_opps with my overclock in place:
mpu_opps[3] rate=900000000 opp_id=3 vsel=46
mpu_opps[2] rate=600000000 opp_id=2 vsel=48
mpu_opps[1] rate=300000000 opp_id=1 vsel=33
So this is showing that the vsel for 600mhz is actually higher than 900mhz - not very economical! so how can we change this, well delving around various forums i got the jist of how to change this so here's a tutorial
IMPORTANT READ THIS!!! Disclaimer: I will not be held responsible for any damage to your phone, your PC or indeed your life from following this guide. The steps in this guide worked for me. Doing this kind of thing could affect your warranty and all that so have a long hard think about it before you go ahead. If anything goes wrong and your phone freezes or reboots spontaneously, remove the sdcard and boot the phone which will disable the overclock module and enable you to reverse whatever you did! As always I would always recommend a backup using Clockworkmod recovery. This is hacking and bad things can happen so be prepared. This is only tested on a stock/rooted 2.21 UK Generic/2.34 Deblur ROM with no apps removed - I have no idea if this works on other ROMs like JBoogie's (stock roms should be ok), because I don't know what changes/tweaks the Dev has done - If you try it and find it does/doesn't work then report back, but I can't offer any support for that
1) Create a setscaling.sh (I have attached mine as a base) script, this is what mine looks like. You can change frequencies/vsels, but it MUST stay in the format below.
echo 46 > /proc/overclock/max_vsel
echo 900000 > /proc/overclock/max_rate
echo 1 300000000 28 > /proc/overclock/mpu_opps
echo 2 600000000 38 > /proc/overclock/mpu_opps
echo 3 900000000 46 > /proc/overclock/mpu_opps
echo 0 900000 > /proc/overclock/freq_table
echo 1 600000 > /proc/overclock/freq_table
echo 2 300000 > /proc/overclock/freq_table
Lines 1/2 are your custom vsel/freq as loaded into Milestone Overclock
Lines 3/4/5 are your freq's and the custom vsels you want to use at those freq's (you can see they are much less than what they were originally!)
Lines 6/7/8 are your frequency table
I can't stress enough you must keep the format the same, and make sure you use the corect number of. It is possible to for example add an extra step/Frequency in - I haven't tested this so just be careful. Also bear in mind if you lower the vsels too much then you will cause the phone to fall over. However if you do get this just pull the SD card an it will boot the phone with the overclock module disabled
when you have set your setscaling.sh up you then need to do the following.
copy it to your sdcard, then via adb (you can also use root explorer)
su
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /sdcard/setscaling.sh /system/xbin/setscaling.sh
chmod 755 /system/xbin/setscaling.sh
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
Then to after this to execute via adb you can just type:
setscaling.sh
Seriously though guys get root explorer as that will enable you to edit you setscaling.sh on the fly as you do your testing (finding optimum vsel), once edited you can then execute it by simply clicking on the file.
Once you have got your setscaling.sh just the way you want it, you can then get it to initialise automatically after boot - this had me stumpted for a while as the script was executing before the overclock module had loaded hence the settings weren't taking effect and I was having to start it manually. I'm more windows orientated and this actually turned out to be a really easy fix.
the key is another script called install-recovery.sh (again I have attached this to the post) and it contains the following info
#!/system/bin/sh
sleep 80
setscaling.sh
So what this does is it waits 80 secs before executing setscaling.sh - which gives the system more than enough time to boot up and load the overclock module. Intall this as per below after plaing on sdcard:
su
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /sdcard/install-recovery.sh /system/etc/install-recovery.sh
chmod 755 /system/etc/install-recovery.sh
reboot
Once rebooted do a cat /proc/overclock/mpu_opps and check your setscaling.sh has applied ok (i.e it is displaying your custom vsels)
Jobs a good un - enjoy!
##If you are reporting problems with it not working please post the exact steps of what you have done, otherwise I won't be able to assist##
Reserved...............
I've searched for an hour how to use Motorola Overclock. I've put the kernelmodule.tar.gz on the sdcard...
But i don't understand how to load it. Or where to place it...
The wiki on the googlecode page leaves me without a clue.
vanloque said:
I've searched for an hour how to use Motorola Overclock. I've put the kernelmodule.tar.gz on the sdcard...
But i don't understand how to load it. Or where to place it...
The wiki on the googlecode page leaves me without a clue.
Click to expand...
Click to collapse
mate just download milestone overclock from the market!
Higgsy said:
mate just download milestone overclock from the market!
Click to expand...
Click to collapse
That's what i did... And then i can't do anything in the app...
Oh Hey, i did forget to Re-Root after FrozenEclairing!
vanloque said:
That's what i did... And then i can't do anything in the app...
Click to expand...
Click to collapse
Do you have root?
after you apply this how do you tell if its worked?
edit: wow im retarded ignore this post -.-
A one right here
thanks, needed this for my overclock
I use gscript lite, and this info is perfet A 1
thanks for the idea and this should work with just adb; no need to download the scripts...
Code:
su
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
echo "#!/system/bin/sh
echo 46 > /proc/overclock/max_vsel
echo 900000 > /proc/overclock/max_rate
echo 1 300000000 28 > /proc/overclock/mpu_opps
echo 2 600000000 38 > /proc/overclock/mpu_opps
echo 3 900000000 46 > /proc/overclock/mpu_opps
echo 0 900000 > /proc/overclock/freq_table
echo 1 600000 > /proc/overclock/freq_table
echo 2 300000 > /proc/overclock/freq_table" > /system/xbin/setscaling.sh
chmod 755 /system/xbin/setscaling.sh
setscaling.sh
echo "#!/system/bin/sh
sleep 80
/system/xbin/setscaling.sh" > /system/etc/install-recovery.sh
chmod 755 /system/etc/install-recovery.sh
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
really glad others are using this and liking it, everyone who is using milestone overclock should be using it!
Hey Higgsy,
i installed your scripts through Root Explorer (incl. executing + rebooting), but checking the mpu_opps file still gives me standard frequencies. You got an idea for this?
Greets, Jack
basshamster said:
Hey Higgsy,
i installed your scripts through Root Explorer (incl. executing + rebooting), but checking the mpu_opps file still gives me standard frequencies. You got an idea for this?
Greets, Jack
Click to expand...
Click to collapse
is the milestone overlock installed and module loaded?
Custom setting in milestone overclock set to 900mhz/46vsel?
Did you set the permissions? (ie the chmod bit).
- Milestone Overclock installed and loaded (incl. startup-load)
- i use different settings 1000/50 (300/30, 600/40 -> in setscaling-script), but 1000/50 is also set in custom settings so it seems equal to me
- permissions of both scripts are "rwxr-xr-x"
hmmm....
little edit: mpu_opps gives me 300/33, 600/48, 1000/50 so it#s not completely standard
basshamster said:
- Milestone Overclock installed and loaded (incl. startup-load)
- i use different settings 1000/50 (300/30, 600/40 -> in setscaling-script), but 1000/50 is also set in custom settings so it seems equal to me
- permissions of both scripts are "rwxr-xr-x"
hmmm....
little edit: mpu_opps gives me 300/33, 600/48, 1000/50 so it#s not completely standard
Click to expand...
Click to collapse
yeah it is standard apart from the max overclock you set in Milestone Overclock.
Please attach your exact setscaling.sh so I can take a look at it.
Thx for helping!
basshamster said:
Thx for helping!
Click to expand...
Click to collapse
hmm looked ok on the face of it, however when I recreated the file it was 355bytes as opposed to yours that was 353bytes
anyway, i think I might know the problem, in root explorer, open setscaling.sh in text editor - look at the end of each line - is there a little box? If there is the delete them - save and then execute.
Your permissions were ok
This is working ok on my phone now
Unfortunately still not working ... don't know what's the problem. Maybe someone else joins us with another solution. Thx for your help anyway!
I posted on the google forum bugreport.
When i click LOAD that reboots the phone and when i relaunch the app the clocks are still empty, so i click load again and it reboots again... Etc.

Proximity sensor issue and solution.

Here is my experience with proximity sensor, and finally got it working back with manual recalibration. So sharing here with you if any one having same issue.
Symptoms : Weired behavior of proximity sensor, I had issue like screen was not turning On after call ends. Air call accept not working
Test : Dial *#0*#
Now this will open up menu, select sensor from there and putting hand near proximity sensor screen should turn green and vibrate. I have had that, but when moving hand away from proximity sensor it was not turning back to normal stat. So once proximity sensor gets activated, it was remaining On always.
Suggestion from net : There wa plenty of cases I have seen having same issue on note3. there was different suggestion like turning auto brightness off / removing Ext SD card was worked for other but not worked on my case. Also someone asked to blow compressed air in earpiece to clean sensor, that helped but just for few minutes only.
Solution that was worked for me.
First thing this setting files remains in EFS folder, so if you have EFS backup, you can try restoring it. In my case I had old EFS backup (MJ1) and have ROM MK2, and later I realized, there is some file difference in both version. (samsung have again screwed EFS, Thanks )
So finally I need to manually recalibrate proximity sensor and that worked fine and since couple of hrs using it without issue.
Requirements :
-Adb access and rooted device.
You should have rooted device, also make sure USB debugging is ON
Connect device to PC and run adb shell
Type following command
Code:
cd /sys/devices/virtual/sensors/proximity_sensor/
then
Code:
cat state #blank value
You will get some value(blank value), note that value. In my case it was 85.
Now enter this command to get actual configuration value
Code:
cat prox_cal
you will get some value, note that value too. In my case it was 46,166,126
Now make total of blank value and actual value(first part) , e.g. in my case it was 85+46 (red above) = 131
Now you need to find HEX value for 131. Get from here OR Here
So in my case it was (HEX value for 131) 83
Now you need to write this value in prox_cal file in EFS folder. For this you need,
Type this with adb
Code:
su
Grant supersu permission from device if ask.
then
Code:
echo -en $'\x83' > /efs/prox_cal
here 83 is my value, you have to replace with your.
then
Code:
sync
Now last step you needs to change permission. here is three steps for that.
Code:
chown system:system /efs/prox_cal
chmod 644 /efs/prox_cal
sync
Reboot device and check proximity sensor is working fine.
GoodLuck !
Referred too many threads on XDa and google, main credit goes to @greaty for clear instruction.
Sorry intended to post on Note3 general forum.
Mod please move this thread.
Hi dr.Ketan,
Good morning!
Sometime back I wrote to you about the proximity sensor not working and also about the weird results I was getting with adb. You told me to wait for some time as you were busy with the kitkat rom for note 2. If you are relatively free now, would you please guide me in this regard. I'm pasting the results I get on adb:
"Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\Admin>adb devices
List of devices attached
4df723a360****** device
C:\Users\Admin>adb shell
[email protected]:/ $ cd /sys/devices/virtual/sensors/proximity_sensor/
cd /sys/devices/virtual/sensors/proximity_sensor/
[email protected]:/sys/devices/virtual/sensors/proximity_sensor $ cat state #blank valu
e
#blank value <
1
[email protected]:/sys/devices/virtual/sensors/proximity_sensor $ cat prox_cal
cat prox_cal
11,9
[email protected]:/sys/devices/virtual/sensors/proximity_sensor $"
You would have noticed that:
1. Once I punch in a command in adb, it puts the cursor at the end of the line rather that at a new line;
2. 'cat prox_cal' is giving me only two values;
3. If I add the blank value, i.e., 1 and the first digit of the cat prox_cal, i.e., 11, I would get 12 and a hex value for the same as 'C'.
Is it normal? If you are busy , would appreciate if you can indicate some resources regarding adb and android
regards,
dcpathak
yeah ut can be any so better first use that value and see if that works or not. If doesn't work then let me know.
you have to use this
echo -en $'\xC' > /efs/prox_cal
Click to expand...
Click to collapse
as per instruction and don't forget to do it with Supreuser (root access)
Did that and it seems to have solved the problem.
Interesting observation: this time the blank value increased to 14 so corresponding hex was E. used that and problem solved.
Any idea why commands were starting from the same line as the previous command?
Thanks and regards,
dcpathak
Thanks man, finally a solution for the promity sensor i really appresiate that you are sharing this with us i finally will get my prox sensor working
i wonder if this value is a normal value
[email protected]:/sys/devices/virtual/sensors/proximity_sensor $ cat prox_cal
cat prox_cal
2013274108,2013274228,2013274188
Hi,
you my friend are a legend, this works finally for me again after over month putting up with it.
Thanks
what should i do it's said not found?
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>adb devices
List of devices attached
4df79c57088840c5 device
C:\Windows\system32>adb shell
[email protected]:/ $ cd/sys/devices/virtual/sensors/proximity_sensor/
cd/sys/devices/virtual/sensors/proximity_sensor/
/system/bin/sh: cd/sys/devices/virtual/sensors/proximity_sensor/: not found
127|[email protected]:/ $
SOLVED
my one has returned back to the same issue again just randomly.
Thanks
Sent from my SM-N9005 using Tapatalk
Thanks @dr.ketan for share this method...and now my proximity sensor is back... i'm on leaked lollipop ????????????????????????????????? i'm very happy?
I had this issue too. After Samsung refused to repair my n9005 because of the triggered Knox counter, I just opened my phone and cleaned the dust that gathers between the prox. sensor and the front glass with isopropanol and a microfiber cloth. Now it's working again. The method described by OP and other methods didn't work for me.
i had the same problem and solved it typing in a terminal emulator
HTML:
$ su
$ echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ chown system:system /efs/prox_cal
$ chmod 644 /efs/prox_cal
$ sync
Jager23 said:
i had the same problem and solved it typing in a terminal emulator
HTML:
$ su$ echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal$ echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal$ chown system:system /efs/prox_cal$ chmod 644 /efs/prox_cal$ sync
Click to expand...
Click to collapse
Yes it's definitely works for me...
SM-N900 cihazımdan Tapatalk kullanılarak gönderildi
@dr.ketan..
u are a legend, thanks alot. and for the other how found this..
for whom how is noob like me :angel: u could use terminal emulator from playstore after rooting(of course)..
thank you
Just followed the method using terminal emulator, rebooted and now works perfectly so far!!! Was getting different faults on different ROMs. On lollipop the proximity sensor just wouldn't work at all. Then went back to 4.4.4 and would work but only once (soon as you put the phone to ear during a call then remove it , although the screen would come on, the key pad would be unresponsive.) Which meant I had many voice mails that had built up and was unable to delete them lol.
Thanks again for this method....though I'm not entirely sure what this has exactly done....its worked.
Omg thank you. This works for lollipop n9005 too ?
I've been having this issue since upgrading to Lollipop, I'll be sure to try this!
how?
Jager23 said:
i had the same problem and solved it typing in a terminal emulator
HTML:
$ su
$ echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ chown system:system /efs/prox_cal
$ chmod 644 /efs/prox_cal
$ sync
Click to expand...
Click to collapse
thanks, but it didnt work for me. I installed terminal emulator from the play market, then started typing the above, but it said su is not found, and echo etc is not allowed.
ive never used the emulator before and googling the subject did not help. could you explain what am i doing wrong?
You have device rooted?
Sent from my SM-N910G using xda premium

[APP/FIX] Date/Time 1970 bug workaround v2.2

Hope this helps someone. I got fairly sick of the date/time bug giving me error alerts upon reboot. This fix takes the RTC date/time and applies an offset specific to your own phone to set the correct date/time at startup. I have attached an APK to make life easy. It should also give the ability to have recovery use the files it creates to set the clock correctly on startup.
The app requires root. If running AOSP, your ROM must have initscript support.
The app has 3 functions:
Install offset only (for use with a compatible recovery, not used by the ROM)
Install offset and initscript (to correct ROM clock offset, also for use with a compatible recovery)
Uninstall (Remove /data/local/userinit.sh /data/media/rtc_offset and /sdcard/rtc_offset)
Feel free to include the app in your own ROMs, just give me credit
As of version 2.0, the script will create /data/media/rtc_offset which can be used by recovery to correct the date/time on boot. Note this will require the recovery to specifically support this correction.
Version 2.1 uses /system/bin/toolbox for compatibility across roms (rather than relying on whatever /system/bin/date points to)
Version 2.2 places the rtc_offset file both in /sdcard/rtc_offset and also in /data/media/rtc_offset if available. The initscript will use either file that is available. This is for possible compatibility with older phones that may not have /data/media, at the request of Phil3759
Special thanks to Atze001, sniperle and Phil3759.
Hope this helps, enjoy.
dougiebee said:
Hope this helps someone. I got fairly sick of the date/time bug giving me error alerts upon reboot. My solution was to get the modification date of the /data/system directory and set that as the current date at boot time. Not great, but better than 1970. This or something similar may be posted elsewhere but I haven't seen it.
I'm running CM11 - not sure whether this works on other AOSP ROMS.
1) Create a file named 01datehack with the following content:
Code:
#!/system/bin/sh
olddate=`ls -ld /data/system | awk '{print $4, $5}' | sed -e 's/-//g' -e 's/ /./g' -e 's/://g' -e 's/$/00/g'`
date -s $olddate
Then run the following commands:
Code:
adb root
adb shell "mkdir -p /data/local/userinit.d"
adb push 01datehack /data/local/userinit.d
adb shell "chmod 755 /data/local/userinit.d/01datehack"
As it lives in /data it will survive flashing an update as long as you don't wipe. It's only a couple of fairly noddy linux commands, there's quite possibly a command line switch that would negate the need for all the SED'ing - also possibly a better directory/file to look at.
Hope this helps, enjoy.
Click to expand...
Click to collapse
I'm on the latest cm11 nightly. Tried your code but didn't make any difference. Phone still started up in February and then changed to today's date after network/WiFi started.
murdoch1 said:
I'm on the latest cm11 nightly. Tried your code but didn't make any difference. Phone still started up in February and then changed to today's date after network/WiFi started.
Click to expand...
Click to collapse
What do you get from "adb shell ls -ld /data/system"? Have you enabled ADB root access in developer options?
1970
dougiebee said:
What do you get from "adb shell ls -ld /data/system"? Have you enabled ADB root access in developer options?
Click to expand...
Click to collapse
Yes enabled ADB root access in Developer options. Running the command you provided results me with the following:-
drwxrwxr-x system system 2013-12-23 08:47 system
Cheers
deleted
Try this. I have made a flashable zip for TWRP
http://forum.xda-developers.com/showpost.php?p=48760802&postcount=13
Its a userinit.sh script in data/local
Atze001 said:
Try this. I have made a flashable zip for TWRP
https://dl.dropboxusercontent.com/u/20033515/TimeDateFix.zip[/U
Its a userinit.sh script in data/local
Click to expand...
Click to collapse
Will this work for me as I'm running philz cwm?
You can try it. If it dont work you get an Installation error and nothing more happens.
If you get an Error please tell me i will fix it for CWM.
Atze001 said:
You can try it. If it dont work you get an Installation error and nothing more happens.
If you get an Error please tell me i will fix it for CWM.
Click to expand...
Click to collapse
Just installed. Worked perfectly phone booted up with the correct date immediately.
Many thanks. Have a good Xmas.
Thanks go to dougiebee for this work.
Works perfectly on CM11 and TWRP.
Thanks a lot dougiebee and Atze001. :laugh:
Works on CM11/D802/TWRP!
Gesendet von meinem LG-D802 mit Tapatalk
Here are the new Links for the flashable fix.
This one ist with userinit.sh in data/local
https://dl.dropboxusercontent.com/u/20033515/TimeDateFix/TimeDateFix_Local.zip
and this ist the original with 01datehack in data/local/userinit.d
https://dl.dropboxusercontent.com/u/20033515/TimeDateFix/TimeDateFix_org.zip
Atze001 said:
Here are the new Links for the flashable fix.
This one ist with userinit.sh in data/local
https://dl.dropboxusercontent.com/u/20033515/TimeDateFix/TimeDateFix_Local.zip
and this ist the original with 01datehack in data/local/userinit.d
https://dl.dropboxusercontent.com/u/20033515/TimeDateFix/TimeDateFix_org.zip
Click to expand...
Click to collapse
thanks, but you didn't set permission to 755 in your script, that's why it doesn't work. i'm sure you can fix it
I personally use the first zip and it works. Many people confirmed that it works.
But if you want i can set the permissons to 755
Permissions fixed
I now have a much better fix. It uses the RTC rather than relying on file timestamps. It's easy to implement, but creation of a flashable zip will not be straight forward.
I ran the following using ADB once the system was up and the date/time was correct:
Code:
expr $(date +%s) - $(cat /sys/class/rtc/rtc0/since_epoch)
Which gave me 1384422218 - which is "Thu Nov 14 09:43:38 GMT 2013" - the exact date/time I first powered on my phone after I got it.
So I edited my userinit file to read:
Code:
#!/system/bin/sh
realdate=$(expr 1384422218 + `cat /sys/class/rtc/rtc0/since_epoch` | awk '{print strftime("%Y%m%d.%H%M%S",$1)}')
date -s $realdate
This takes my hard-coded (device-specific) power-on time and adds the current RTC time since then to give me the correct date/time, much better than using the timestamp of a file or directory.
I'll update the OP if others confirm this works for them. Note: you need to replace 1384422218 with the number specific to your phone. Creating a flashable zip would be a bit of a challenge, as it would need to be device specific.
Wouldn't it be possible to add a script to the flashable zip that determines the correct value and modifies the flashable file with the value before or after flashing?
PS: I don't know anything about this stuff...
dougiebee said:
I now have a much better fix. It uses the RTC rather than relying on file timestamps. It's easy to implement, but creation of a flashable zip will not be straight forward.
I ran the following using ADB once the system was up and the date/time was correct:
Code:
expr $(date +%s) - $(cat /sys/class/rtc/rtc0/since_epoch)
Which gave me 1384422218 - which is "Thu Nov 14 09:43:38 GMT 2013" - the exact date/time I first powered on my phone after I got it.
So I edited my userinit file to read:
Code:
#!/system/bin/sh
realdate=$(expr 1384422218 + `cat /sys/class/rtc/rtc0/since_epoch` | awk '{print strftime("%Y%m%d.%H%M%S",$1)}')
date -s $realdate
This takes my hard-coded (device-specific) power-on time and adds the current RTC time since then to give me the correct date/time, much better than using the timestamp of a file or directory.
I'll update the OP if others confirm this works for them. Note: you need to replace 1384422218 with the number specific to your phone. Creating a flashable zip would be a bit of a challenge, as it would need to be device specific.
Click to expand...
Click to collapse
Just applied your new version. Works a treat. As you say its better than basing the date on a file timestamp. I basically used the flash zip and amended the unserinit.sh script with the code generated on my device.
All done.
Cheers again.
With 01datehack in userinit.d it dont work for me. With userinit.sh in local it works.
I will take a look to make a Batch or a zip out of this.
dougiebee said:
I now have a much better fix. It uses the RTC rather than relying on file timestamps. It's easy to implement, but creation of a flashable zip will not be straight forward.
I ran the following using ADB once the system was up and the date/time was correct:
Code:
expr $(date +%s) - $(cat /sys/class/rtc/rtc0/since_epoch)
Which gave me 1384422218 - which is "Thu Nov 14 09:43:38 GMT 2013" - the exact date/time I first powered on my phone after I got it.
So I edited my userinit file to read:
Code:
#!/system/bin/sh
realdate=$(expr 1384422218 + `cat /sys/class/rtc/rtc0/since_epoch` | awk '{print strftime("%Y%m%d.%H%M%S",$1)}')
date -s $realdate
This takes my hard-coded (device-specific) power-on time and adds the current RTC time since then to give me the correct date/time, much better than using the timestamp of a file or directory.
I'll update the OP if others confirm this works for them. Note: you need to replace 1384422218 with the number specific to your phone. Creating a flashable zip would be a bit of a challenge, as it would need to be device specific.
Click to expand...
Click to collapse
Does this survive flashing or do I need to do this every time I flash?
Sent from my LG-VS980 using Tapatalk

Get double tap to wake in any rom

I'll be showing you how to get dt2w(double tap to wake) working in any rom
Install terminal emulator app from play store and then run these commands
su
ls /proc
cat /proc/tp_wakeup_gesture
echo 1 > /proc/tp_wakeup_gesture
NOTE:After a reboot it won't work until you enter the commands again
NOTE: Only works on goodix panels(to check if you have goodix panel install device info hw app and check if touchscreen says goodix-ts that means that you have a goodix panel)
Credits:33bca/Offain
Not working getting permission denied so probably do need root.
Thank you! Works for me. Can it be implemented as Magisk module?
worked for me too
but; as root,
also
Code:
mad.duck.ffs:/ # echo 1> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
0
while
Code:
mad.duck.ffs:/ # echo "1"> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
1
then just added it in "boot shell" app to be run every time my device started,
works perfectly, thanks.
czkb said:
worked for me too
but; as root,
also
Code:
mad.duck.ffs:/ # echo 1> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
0
while
Code:
mad.duck.ffs:/ # echo "1"> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
1
then just added it in "boot shell" app to be run every time my device started,
works perfectly, thanks.
Click to expand...
Click to collapse
Thanks! Can you guide step by step how to add commands in boot shell?
gkornaks said:
Thanks! Can you guide step by step how to add commands in boot shell?
Click to expand...
Click to collapse
click on the "+"
add command
give it a name (first line)
add the command (second line)
check run on boot
save and you're good to go.
i dont have 10 post yet so i cant post pics, but that's pretty much it.
czkb said:
click on the "+"
add command
give it a name (first line)
add the command (second line)
check run on boot
save and you're good to go.
i dont have 10 post yet so i cant post pics, but that's pretty much it.
Click to expand...
Click to collapse
Thank you! The command which starts with echo, right?
czkb said:
worked for me too
but; as root,
also
Code:
mad.duck.ffs:/ # echo 1> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
0
while
Code:
mad.duck.ffs:/ # echo "1"> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
1
then just added it in "boot shell" app to be run every time my device started,
works perfectly, thanks.
Click to expand...
Click to collapse
So, only work with root?
gkornaks said:
Thank you! The command which starts with echo, right?
Click to expand...
Click to collapse
yep
Code:
echo "1"> /proc/tp_wakeup_gesture
Batmany said:
So, only work with root?
Click to expand...
Click to collapse
no idea, i only tried as root since another member said that permission was denied when not elevated.
gkornaks said:
Thank you! Works for me. Can it be implemented as Magisk module?
Click to expand...
Click to collapse
No
czkb said:
worked for me too
but; as root,
also
while
then just added it in "boot shell" app to be run every time my device started,
works perfectly, thanks.
Click to expand...
Click to collapse
No Problem
You should maybe meantion that it just will work with goodix touchscreens...
I'll implement a toggle into my LineageOS once I've fixed it on Focaltech touchscreens too.
Thank you !! It worked for me.
33bca said:
You should maybe meantion that it just will work with goodix touchscreens...
I'll implement a toggle into my LineageOS once I've fixed it on Focaltech touchscreens too.
Click to expand...
Click to collapse
Ok,should i add it or just remove the thread?
Does it results in more battery drain?
I mean whether the phone goes to deep sleep or not?
00norman00 said:
Does it results in more battery drain?
I mean whether the phone goes to deep sleep or not?
Click to expand...
Click to collapse
For me battery is the same
czkb said:
worked for me too
but; as root,
also
Code:
mad.duck.ffs:/ # echo 1> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
0
while
Code:
mad.duck.ffs:/ # echo "1"> /proc/tp_wakeup_gesture
mad.duck.ffs:/ # cat /proc/tp_wakeup_gesture
1
then just added it in "boot shell" app to be run every time my device started,
works perfectly, thanks.
Click to expand...
Click to collapse
dude such a great help. thanks.
Thanks for sharing ? But I even turned off dt2w on stock rom, just because it too often randomly wake up and input numbers randomly while in my pocket.
I hope there is a way for dt2w to check the proximity sensor before proceeds to wake up the phone.
zogajg26 said:
I'll be showing you how to get dt2w(double tap to wake) working in any rom
Install terminal emulator app from play store and then run these commands
su
ls /proc
cat /proc/tp_wakeup_gesture
echo 1 > /proc/tp_wakeup_gesture
NOTE:After a reboot it won't work until you enter the commands again
NOTE: Only works on goodix panels(to check if you have goodix panel install device info hw app and check if touchscreen says goodix-ts that means that you have a goodix panel)
Credits:33bca/Offain
Click to expand...
Click to collapse
So this is temporary solution? If we restart the phone, it will be back to original right? (I will try, i have goodix, but odds i dont have menu to activate from the stock rom oreo)
**** Wow it worked man.. thanks
I'm getting permission denied even with root.
Sent from my Phh-Treble vanilla using Tapatalk

Categories

Resources