wake up / unlock device using custom buttons - Android Q&A, Help & Troubleshooting

We are building a custom hand held device with MT 6580 chipset and Android 5.1.
- Device has 4 buttons that will be used to capture user input data like counts.
- A pre loaded app runs on the device to receive the key events and process the data.
We want the device to wake up and resume the activity when the user presses any of the 4 buttons while the device is in sleep mode.
Tried anything similar? Is it doable?
Thanks

Related

[APP][Updated 17-12-2009] TouchLockPro version 2.9 with *NEW* Zoombar unlocking

TouchLockPro is not exactly new (currently at version 1.9), but it was posted in the Diamond thread, because there things started. But because other phones are also supported, maybe the TouchLockPro thread could move to here. If this cross posting is not wanted, I hope the moderators let me know how to continue. At the Diamond thread or in this one?
But Windows Mobile has an OEM screen locker!
Yes, Windows Mobile locks the screen, but unlocks the Answer and Ignore buttons as soon as a call rings, so it is useless. The same happens when any notification pops up, the Snooze and Dismiss buttons are enabled even when screen is locked, leaving them vulnerable to any accidental touch.
Supported phones (known)
Touch Diamond
Touch Pro
Sprint CDMA Diamond
Touch HD (only triple touch capacitive sensor for unlock does not work)
Summary
There are already a lot of applications to disable touchpanel and/or hardware keys for the Touch Diamond and Pro. I added yet another one:
* lock using the Power button, BattClock and/or Stylus Sensor
* auto-unlock by the Light Sensor
* unlock using triple touch of the Capacitive Sensor
* unlock using Stylus Sensor
* unlock when on AC/USB power
Why is TouchLockPro better than other locking solutions
TouchLockPro is designed not to interfere with running applications and is a multipurpose locking application. Other locking solutions are often specific for locking only incoming calls/SMS. A lot of locking solutions also place a (transparant looking) Window on top of the running application (e.g. slide 2 unlock), so the information of the background application is no longer visible. This is not the case for TouchLockPro, so it can be kept lean and mean. Also the used resources is very very low.
Does TouchLockPro use much battery, RAM, CPU
Not at all, TouchLockPro is designed to be lean and mean!
TouchLockPro does not have noticeable effect on battery life. It only uses 33 Kb RAM in memory, whereas other solutions often use much more. For example S2U2 uses 4 Mb (125 times more) and PocketShield 1.7Mb (50 times more) memory. TouchLockPro uses 0% CPU (check it with a task manager!) and is totally event driven. Polling is kept to a minimum (currently only for polling once per second the light sensor when LOCKED and the screen is on). Requested features which would violate the "lean and mean" principle are rejected. Note that larger UI related stuff is done in a separate TouchLockAction.exe (e.g. editing settings), so the memory is only used when that program is active for a small moment.
Which other solutions exist
This is a list of other solutions, which may suit you better:
* Built in locking of Windows Mobile
* Stylus(BattC)lock
* Get A Reward! Create A "answer Only With Hw Buttons" Option!
* S2U2
* PDAVIET's dialer
* CSDEVCTRL
* SensorLock
* Answerkeys Disabler
* PocketShield
* ThrottleLock
Interested in *FREE* TouchLockPro?
I just posted TouchLockPro version 1.8.
I also posted the source code belonging to version 1.8. Hope you will learn something from it and you are inspired to make great programs too. At the end programming Windows Mobile is not so difficult if you have programming experience. Prerequisites for programming:
* Visual Studio, Express editions are free!
* Windows Mobile 6 Professional SDK (also free)
Note that others pointed out, that Express editions are not suitable for Windows Mobile development. See Smart Development for what is supported by which version. I used myself Visual Studio 2008 Professional SP1.
Note that TouchLockPro is written in C++ and TouchLockAction in C# (and deployed using .NET Framework 2.0).
Enjoy the software and source code
you can lock specific programs? waaahhh? this is what I've been waiting for for a very long time. downloading right now.
lennie said:
you can lock specific programs? waaahhh? this is what I've been waiting for for a very long time. downloading right now.
Click to expand...
Click to collapse
I do not know if HTC x7501 has the same sensor like capabilities. Does it work for you? Or do you have another phone too?
anybody tried with tytan II ?
shuren said:
anybody tried with tytan II ?
Click to expand...
Click to collapse
TouchLockPro uses the unique sensors since Touch Diamond was brought out:
* auto-unlock by the Light Sensor
* unlock using triple touch of the Capacitive Sensor
So probably those functions will not work on your phone. BUT I continue without those functions when the loading of the needed HTC libraries fails.
There is also a stylus sensor, but TouchLockPro just observes a registry key for detecting if the stylus is in or out. So you can check if that registry key also exists on your phone, before you try to install:
HKCU\ControlPanel\Keybd\StylusOutStatus
1 = out
0 = in
If this registry key does not exists, probably TouchLockPro will not work for your phone.
For the rest it is standard Windows Mobile programming, although the locking of the hardware keys may also not work. But the locking of only the TouchPanel should work (setting "LockTouchPanelOnly = 1". TouchLockAction is written in C# and needs .NET Compact Framework 2.0.
Note that controlling the locking only with the stylus is also doable, actually my first version only supported this:
StylusLock
So you could use TouchLockPro with only the Stylus (if that registry key is written) and/or LockTouchPanelOnly, you miss only some of the unlocking features. Actually if you only lock the touchpanel, you can assign the command "\Windows\TouchLockAction.exe unlock" to a hardware key for unlocking.
Hope this helps......
So you say it won't lock some hardware buttons...this won't get around the problem with Samsung i730 and the power off key?
No program I have found yet can lock that hardware key to prevent it from powering off while in my pocket
EDIT: Nevermind...it isn't supported on the i730 anyway
First of all:
Congratulations for your post. Didn't see a long time an informative post like this - your own program is introduced, the reason for doing it AND other existing solutions!!! Hat off to you.
ZuinigeRijder said:
I also posted the source code belonging to version 1.8. Hope you will learn something from it and you are inspired to make great programs too. At the end programming Windows Mobile is not so difficult if you have programming experience.
Click to expand...
Click to collapse
Thank you very much for sharing the source code. It is for sure helpful in both ways - to learn and to get inspired. I already took my hat off otherwise I would do it again.
StrykerC3 said:
So you say it won't lock some hardware buttons...this won't get around the problem with Samsung i730 and the power off key?
No program I have found yet can lock that hardware key to prevent it from powering off while in my pocket
EDIT: Nevermind...it isn't supported on the i730 anyway
Click to expand...
Click to collapse
Actually it does lock ALL hardware keys, even "Power Off" key.
But maybe you meant the "Power On" key (actually, the same key).
That is why TouchLockPro does also lock immediately at Power On or Screen On (due to an external event, incoming call, or via pressing the power on key).
Code:
// --------------------------------------------------------------------------
// HTC Touch Panel
//
// Reverse engineered from HTC's TPEnable.exe and TPDisable.exe
// --------------------------------------------------------------------------
#define IOCTL_HTC_HAL_ENABLE_TOUCHPANEL CTL_CODE(FILE_DEVICE_HAL, 2698, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct STouchPanel {
BYTE n1;
BOOL bEnable;
};
DWORD nBytesReturned;
STouchPanel s = { 0, !disable };
KernelIoControl(IOCTL_HTC_HAL_ENABLE_TOUCHPANEL, &s, sizeof(s), NULL, 0, &nBytesReturned);
But indeed, it will not work on your phone
ZuinigeRijder said:
Actually it does lock ALL hardware keys, even "Power Off" key.
But maybe you meant the "Power On" key (actually, the same key).
That is why TouchLockPro does also lock immediately at Power On or Screen On (due to an external event, incoming call, or via pressing the power on key).
Code:
// --------------------------------------------------------------------------
// HTC Touch Panel
//
// Reverse engineered from HTC's TPEnable.exe and TPDisable.exe
// --------------------------------------------------------------------------
#define IOCTL_HTC_HAL_ENABLE_TOUCHPANEL CTL_CODE(FILE_DEVICE_HAL, 2698, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct STouchPanel {
BYTE n1;
BOOL bEnable;
};
DWORD nBytesReturned;
STouchPanel s = { 0, !disable };
KernelIoControl(IOCTL_HTC_HAL_ENABLE_TOUCHPANEL, &s, sizeof(s), NULL, 0, &nBytesReturned);
But indeed, it will not work on your phone
Click to expand...
Click to collapse
Well right, power off/power on, but when the phone is powered off, I am not worried about it being power on by accident, only the other way around
Why can't any one make a program for WM5 that can disable the Power On/Off key?!?! Ugh!
Finally!
So far, this seems to be the best solution to accidentally pressing hardware buttons or screen buttons while the phone is in my pocket. When using bluetooth I was constantly hanging up on people. Also, I would accidentally call people with the phone in my pocket when an SMS or e-mail would "wake up" the phone and then 2 unknown presses of the hardware "answer" button would first bring up call history and then call the first person on the list. I'll wait a few more days and, if all is well, I'll make a donation. Thank you so much for your effort. (tried Sensorlock, S2U2 and Answerkeydisabler but none did the trick)
mspingeld said:
So far, this seems to be the best solution to accidentally pressing hardware buttons or screen buttons while the phone is in my pocket. When using bluetooth I was constantly hanging up on people. Also, I would accidentally call people with the phone in my pocket when an SMS or e-mail would "wake up" the phone and then 2 unknown presses of the hardware "answer" button would first bring up call history and then call the first person on the list. I'll wait a few more days and, if all is well, I'll make a donation. Thank you so much for your effort. (tried Sensorlock, S2U2 and Answerkeydisabler but none did the trick)
Click to expand...
Click to collapse
I am a bit surprised the other locking solutions do not work well together with bluetooth. Others reported indeed that TouchLockPro does not interfere with bluetooth and you can pick up the phone with bluetooth, although the keys are locked.
Enjoy the software
The other solutions worked with bluetooth but the bluetooth call connection would wake up the phone and activate either the screen, the hardware buttons, or both causing the accidental hang ups or calls. TouchLockPro locks both the screen and the hardware buttons. btw I have the touches set to 2 and the light sensor set to 500. Very convenient!
mspingeld said:
The other solutions worked with bluetooth but the bluetooth call connection would wake up the phone and activate either the screen, the hardware buttons, or both causing the accidental hang ups or calls. TouchLockPro locks both the screen and the hardware buttons. btw I have the touches set to 2 and the light sensor set to 500. Very convenient!
Click to expand...
Click to collapse
Good to know.
In the upcoming version TouchLockPro 1.9 I will introduce the ScreenOffWhenCallConnected option, so you cannot accidently press stuff with your ears. Also I will introduce the option UnlockWhenCallConnected, so you can still use the hardware keys, when the screen is off (e.g. for ending the call) and it is not locked when the call is ended from the other side.
Dependent of the bluetooth usage, if you have the phone in your pocket, you may want to disable these settings.
TouchLockPro version 1.9
I just uploaded version 1.9.2 on my new website.
See TouchLockPro thread for more details.
Many thanks to Dennis van de Sande, alias Mr_Q from XDA-Developers, for sponsoring/donating the website and domain.
I wish you a merry christmas and a happy new year!
Version 2.0
I uploaded version 2.0, which fixes some (small) issues and added some features, like unlocking when sliding the keyboard out (if available). See Version 2.0
[APP][Updated 11-01-2009] TouchLockPro version 2.1
I just uploaded TouchLockPro version 2.1. Hope this version is again more perfect.
TouchLockPro 2.2.1 with GSENSOR support for unlocking
I just uploaded TouchLockPro 2.2.1 with GSENSOR support for unlocking.
TouchLockPro version 2.3
TouchLockPro version 2.3 is available.
How to unlock using touchprolock?
Im using xperia (no gsensor, no light, etc) ??
royalbloodvi said:
How to unlock using touchprolock?
Im using xperia (no gsensor, no light, etc) ??
Click to expand...
Click to collapse
Then you must unlock with a key sequence, using TouchLockPro 2.8.2.
See http://www.zuinigerijder.com

[REQ] Tiny app turn OFF screen when call connect

Hi,
I wish I had the knowledge to create such an application, but I don't so I'll try to explain this idea as clearly as I can see if someone finds it interesting enough.
As you know some phones already have the built-in feature to turn OFF the screen when a call is established. This prevents accidental actions with your cheek and ear on the touchscreen.
Some phones have fancy sensors like light sensor and proximity sensor.
But many other phones don't have, so this tiny app would be very useful to all of them:
How should it work?
Very simple:
1. Detect when a call is established
2. Call the "Turn OFF screen" command (same as pressing the power button)
That's it.
This would be exactly like pressing the power button after call is connected, so there wouldn't be incompatibilities with other apps. Plus the phone behavior when call is finished would be the same as always, since it only called the same command as power button.
This tiny app then could be cooked inside many ROM's.
Well, it's very easy explained like this, but as I said, I don't have the knowledge to do it myself
If you feel like programming the app I will gladly be your tester (or should I say guinea pig? )
+1
Having the problem with accidental touching the buttons and so fort pausing or hanging up a established Call.
+1
Add the functionality of turning the screen back on after the call is dis-connected and I'm sold
A software like this would be manufacturer dependant. For HTC devices, check out Touch InCall Screen Tweak. This app works on all HTC devices, and is a great app.
You can also use DiamondTweak or Advanced Config and setup the device to suspend quickly when in call (but these apps might only work on Diamond).
longice said:
A software like this would be manufacturer dependant. For HTC devices, check out Touch InCall Screen Tweak. This app works on all HTC devices, and is a great app.
You can also use DiamondTweak or Advanced Config and setup the device to suspend quickly when in call (but these apps might only work on Diamond).
Click to expand...
Click to collapse
Thank you!
Although I have an Elf, and it's got no G-sensor and no light sensor, so it won't work on my device
But it's pretty close to what I'm looking for! Thanks!
Is there really no way to disable the "Green" "Home" "Left arrow" and "Red" button when I'm in a call.
Ive tried to disable the buttons with AEB-plus, but it still doesn't work while Im in a Call.
Is it just me that have the problem with time and time Pausing or Hanging up established calls, "thanks" to the "Hardware" buttons.
PS
Using Touch HD

[Q] JB 4.2 Deep sleep severe Issue

Hi folks,
I am searching for several days for a deep sleep issue solution, but i can say i am completly stuck.
My phone: Star B943 quad core MT6589, linux kernel 3.4.5, JB 4.2.1
At the phone start, deep sleep mode works fine, but as soon as i receive an email or SMS, the phone will never go back in powersaving mode. Just as if the service crashed and the phone still "Awake".
I've tested several solutions and apps:
- Deep Sleep Battery Saver: Failed
- One power guard: Failed
- Powersaving tweaks from Pimpmyrom: Failed
Of course i've checked if a service or apps aren't involved in the problem, but there is nothing. I've checked with Betterbatterystats, wakelock detector...Deep Sleep mode just crash and never restart . And we are a several people in this case...
i imagine the gotosleep void in powermanager can't do his job
"public void goToSleep (long time)
Added in API level 1
Forces the device to go to sleep.
Overrides all the wake locks that are held. This is what happens when the power key is pressed to turn off the screen.
Requires the DEVICE_POWER permission.
Parameters
time The time when the request to go to sleep was issued, in the uptimeMillis() time base. This timestamp is used to correctly order the go to sleep request with other power management functions. It should be set to the timestamp of the input event that caused the request to go to sleep.
See Also
userActivity(long, boolean)
wakeUp(long)"
Thanks for ur help, if you can
So i found that the powersaving is managed by the kernel, and by some files in /sys/power. I have autosleep (set on OFF) and some others: wake_lock, wake_unlock, wakeup_count, wait_for_fb_sleep, wait_for_fb_wake.... This last ones are very difficult to open. Wakeup_count is totaly buggy for example. The others are stuck the most part of time, except after restart. This files could be the source of the probleme ?
Strange situation:
http://forum.xda-developers.com/showpost.php?p=40682880&postcount=230
Has anybody else tried to use 2 SIMS?

Android 5.1 How to switch the motion and proximity sensing OFF

I now have two 5.1 phones, a Moto G 2015 and an Elephone S2. Both have this really TERRIBLE feature that switches the display on when the phone is moved about, or even when one's hand is waved about near them. I am astounded to find that some people think this is useful. I do not: if I want to get to the lockscreen, then I want to just press the power button, as in the past.
Neither of the phones appears to have anything relevant in their settings. I have read other posts and it's clear some phones do have settings for this, but these two do not.
Both my phones are rooted of course and using Titanium backup I've found that freezing 'Moto Display' does prevent the Moto G from having this dire and unwelcome 'feature'.
The Elephone S2 is a pretty bog standard version of 5.1, but I can't see anything in the Titanium list of app modules that seems relevant to preventing the motion and proximity sensors from starting up the phone. If anyone has any solutions to this problem, I'd be delighted to hear from them.!
Turn off ambient display.
Wakamatsu said:
Turn off ambient display.
Click to expand...
Click to collapse
The nearest setting to that which the Elephone has is 'smart wake ', and I already had everything switched to off there. It seems to be the user interface for an app 'motion recognition' and is the settings for custom screen draw actions, not to do with position or proximity sensors..
But I think I have found the cure in my particular instance. It is another app 'Pocket Lock' which I installed because I used to use it on my Moto G 2013. It's to prevent the screen waking up by accidentally pressing the power button while the phone was in my pocket.
I automatically installed it on the Elephone, but there it seems to have the reverse effect of encouraging the sensors to kick the screen into action. I've de installed it and now it doesn't want to wake up unless I press the power button. Which is fine!

Ugoos AM2 power down not working

Hi all - I've installed the Ugoos AM2 ROM on my Minix U1 box:
Android 6.0.1 Firmware V1.1.1 for AM2 Android 6.0.1 Firmware V1.1.1 for AM2 440.33MiB 21/06/2017
at http://ugoos.net/downloads.
Everything is fine, except that I cannot use the power button on the A2 lite remote. It will start the box, but will not power down. I've read that this could be due to a limitation of android 6, but am not sure. And no matter what setting is entered in Settings->Display->Daydream, I cannot get the unit to fully power down - only sleep ( green light ). So far i have tried:
- changing "stay awake" to "off" in developer mode
- power key action to "shutdown" in display->daydream settings
- HDMI CEC setting = off
... but nothing works. And as mentioned, the A2Lite remote will turn the box on from a dead state, but the power key becomes unresponsive once the rom loads - tested with a keymap app and it wouldn't even register a keypress when I pressed the power button.
I think I found the answer here, but not sure how to enter the data:
https://kodi.wiki/view/MINIX_A2#keyboard.xml_per_Window_customization.2C_refining_remote_actions
#5
5 remote.conf example for amlogic boxes
/etc/amremote/remote.conf
Example settings needed to map the power button (note - this only applies once the device has booted, the initial power on detection appears to be in hardware)
....
factory_code = 0xfe010001
key_begin
0x18 116 # power
key_end
....
..
Very much appreciated - thanks!
A couple questions: 1) Do you get full 4K HDR res - either youtube or personal videos? 2) The power button thing is a mystery - I think the Kodi wiki nailed it when it mentioned that the remote activates the box from a dead state (hardware-based), but becomes unresponsive after boot-up. Any chance I could have a look at the remote.conf of your ROM and see if I can modify it to add functionality?
Also, what the heck happened to the forum - It's still an active company, no? I've been looking at the posts through search engine caching, but those are gradually disappearing ..

Categories

Resources