[WIP]Gingerbread Sense Trackpad 2 Unlock - Desire Android Development

Hi guys, as the title says it's a work in progress, so please don't flame.
I was tired of waiting for the Trackpad2Unlock mod for GB-Sense roms to come, so i decided to give it a shot.
When i was on RCMix HD, i flashed a v1.84 update.zip to enable the trackpad2unlock feature.
So i unziped that file, and noticed that it only replaces the original HTCLockscreen.apk by another one.
I then decompiled both of them to see what were the differences.
Quick md5 hashes showed that only one file was modified: HtcLockScreen.smali
I then compared the original and modified files:
Original:
Code:
.line 800
.local v0, msg:Landroid/os/Message;
const/16 v1, 0x14
if-eq p1, v1, :cond_3e
const/16 v1, 0x13
if-eq p1, v1, :cond_3e
const/16 v1, 0x15
if-eq p1, v1, :cond_3e
const/16 v1, 0x16
if-eq p1, v1, :cond_3e
.line 804
iget-object v1, p0, Lcom/htc/lockscreen/HtcLockScreen;->mReminderView:Lcom/htc/lockscreen/HtcLSViewInterface;
if-eqz v1, :cond_3e
.line 805
iget-object v1, p0, Lcom/htc/lockscreen/HtcLockScreen;->mReminderView:Lcom/htc/lockscreen/HtcLSViewInterface;
invoke-interface {v1, p1, p2}, Lcom/htc/lockscreen/HtcLSViewInterface;->onKeyDown(ILandroid/view/KeyEvent;)V
:cond_3e
move v1, v4
.line 809
goto :goto_20
.end method
Modified:
Code:
.line 801
.local v0, msg:Landroid/os/Message;
const v1, 0x17
if-ne p1, v1, :cond_2d
invoke-virtual {p0}, Lcom/htc/lockscreen/HtcLockScreen;->goToUnlockScreen()V
:cond_2d
const/16 v1, 0x14
if-eq p1, v1, :cond_46
const/16 v1, 0x13
if-eq p1, v1, :cond_46
const/16 v1, 0x15
if-eq p1, v1, :cond_46
const/16 v1, 0x16
if-eq p1, v1, :cond_46
.line 805
iget-object v1, p0, Lcom/htc/lockscreen/HtcLockScreen;->mReminderView:Lcom/htc/lockscreen/HtcLSViewInterface;
if-eqz v1, :cond_46
.line 806
iget-object v1, p0, Lcom/htc/lockscreen/HtcLockScreen;->mReminderView:Lcom/htc/lockscreen/HtcLSViewInterface;
invoke-interface {v1, p1, p2}, Lcom/htc/lockscreen/HtcLSViewInterface;->onKeyDown(ILandroid/view/KeyEvent;)V
:cond_46
move v1, v4
.line 810
goto :goto_20
.end method
Basically it just inserts another check for var 0x17 (trackpad?) and then unlock the lockscreen if true.
So i did manage to update the Gingerbread Sense HTCLockscreen with this little hack.
No more need to slide down to disable the lockscreen, pressing down the Trackpad does it.
However... it doesn't wake the phone through the trackpad.
We still need to press Power :-/
To make a long story short, i managed to get tp2unlock, but not tp2Wake&Unlock...
I did try several other methods, like this one but with no go:
http://forum.xda-developers.com/showthread.php?t=683902
So if someone wanna give a hand... Feel free, the whole community is waiting for this mod.
Thanks for reading and your help
PS:
Provided in the link are the uncompiled files for
v1.84 original (the original RCmixHD a2sd htclockscreen.apk files)
v1.84 modified (the modified version to enable trackpad 2 wake and unlock)
gb sense tp2u (the modified Gingerbread Sense version to enable trackpad 2 unlock).
Edit:
I forgot to provide the HTCLockscreen.apk, just push it (with QtADB!) to system/app/.

nice work at least this is a start and maybe some who nows a little bit more will help

I don't think it depends on framework settings. As I developed AOSP for other device it was always a matter of editing keylayout file with adding/removing WAKE flag. Maybe just adding that flag to PROPER keycode will solve this? I tried but without success.
What else - I'd like to point you to frameworks/policies/base - there are files that describes some power management.

Delete... Wrong tread..

KameoRE said:
To make a long story short, i managed to get tp2unlock, but not tp2Wake&Unlock...
I did try several other methods, like this one but with no go:
http://forum.xda-developers.com/showthread.php?t=683902
So if someone wanna give a hand... Feel free, the whole community is waiting for this mod.
Click to expand...
Click to collapse
Why don't you try with this one

Good work...
but i think that are 2 things needed...the changed lockscreen and this trackpad to wake up...maybe try the same way with the file from this thread:
http://forum.xda-developers.com/showthread.php?t=696907
with kind regards...Alex

bg_man said:
Why don't you try with this one
Click to expand...
Click to collapse
I did does it work reliably for you? over a week now with this mod and ~50% fail rate

I'm using CoolAcesv2 rom and looking at the inputs with the adb shell and the getevent command, seems like for the trackpad is still needed the curcial-oj.kl file as described here http://forum.xda-developers.com/showthread.php?p=7236745#post7236745.
This is what i got:
Code:
add device 1: /dev/input/event9
name: "compass"
add device 2: /dev/input/event8
name: "curcial-oj"
add device 3: /dev/input/event7
name: "dummy_keypad"
add device 4: /dev/input/event6
name: "lightsensor-level"
add device 5: /dev/input/event5
name: "bravo-keypad"
add device 6: /dev/input/event4
name: "proximity"
add device 7: /dev/input/event3
name: "synaptics-rmi-touchscreen"
add device 8: /dev/input/event2
name: "projector-Keypad"
add device 9: /dev/input/event1
name: "projector_input"
add device 10: /dev/input/event0
name: "h2w headset"
/dev/input/event8: 0001 0110 00000001
Btw i already pushed the curcial-oj.kl in the phone but it doesn't do anything so i beleive it need the modded apk too.
I hope this helped a bit.

I did try it... Here are my tests so far:
- created, edited and pushed system/usr/keylayout/curcial-oj.kl with the following, and it doesn't work.
Code:
key 272 DPAD_CENTER WAKE_DROPPED
- also edited the system/usr/keylayout/bravo-keypad.kl with the same line, no go.
Gonna dig with other tests, there must be a way to get the code to trigger the power button.
Once i get it, i think that i can replicate the snippet and get this to work.
Wish me luck.

Good luck mate
If you look around there are a couple of threads where people have tried editing curcial-oj.kl and bravo-keypad.kl which seems to have no effect on trackpad. WAKE_DROPPED when added to menu or home in bravo-keypad.kl does give an unreliable wakeup but half the time it doesn't work. General consensus seemed to be GB uses a different location

Thanks Ziggy.
In fact when i edit my bravo-keypad.kl, it works all the time with Power or Home or Menu, but not a single time (and believe me, i tried like 25 times in a row) with the Trackpad.
key 102 HOME WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 158 BACK
key 217 SEARCH
key 272 DPAD_CENTER WAKE_DROPPED
key 107 ENDCALL WAKE_DROPPED
key 116 POWER WAKE_DROPPED
Click to expand...
Click to collapse
I'll investigate a little bit more.

Well thats a step in the right direction
Could you please upload your bravo-keypad.kl with reliable menu home wake, myself and several others all have it working, but unreliably. Have you tried it for over 24H, for me if the phone has been recently used it seems to work but after a prolonged period in standby it generally seems to fail

KameoRE said:
Thanks Ziggy.
In fact when i edit my bravo-keypad.kl, it works all the time with Power or Home or Menu, but not a single time (and believe me, i tried like 25 times in a row) with the Trackpad.
I'll investigate a little bit more.
Click to expand...
Click to collapse
Can you share that file which works all the time for Menu button? That's all I need and it will solve my problem.. Can you do that? Thanks in advance..

Ok, bad news, you guys are right.
If the phone is off for a while (more than 2-3 minutes), the keys don't wake the phone.
As if they were not power supplied.
Looks like a powersave function, sorry guys.
We still stuck to the same position.
Anyway i tried decompiling other android files to check which one triggers the PowerOn function, but haven't found it yet.
Anyone got a clue (i tried Rosie/SystemUI/Core/AndroidPolicy...)?

I think it's obviously hidden very well (Damn HTC and their lack of sensible ergonomic design)
I did notice NeoPhyTe.x360's latest GB rom had "Wake UP desde Menu, unlock Trackpad" listed in the Features: sadly about 20mins after i queried this it was changed to "Wake UP from Menu" whether that's the same unreliable mod we have i don't know can't be arsed to flash just for that
But hey even more people will be looking for it now

Yep, hopefully we might found it.
Just noticed Neo's back, so gonna give his Ginger-ReflexS/SenseHD rom a try.

I think you are right about power save disabling menu wake when i put the phone on charge after 20 mins menu wake is still working
So presumably default setting is only Power button has power all the time maybe that's a solution allowing power to menu /trackpad always

ziggy1001 said:
I did does it work reliably for you? over a week now with this mod and ~50% fail rate
Click to expand...
Click to collapse
I've played with it but for half an hour.
I've found the GB still not stable enough and decide to wait for official HTC release.
So you are seems to be right.

Little update.
I managed to debug which functions are called when the relevant button is pressed (power and all the others enabled in bravo-keypad.ki but 272):
For example, while pressing Power (keycode 26 or $1a), i get this:
WindowManager - interceptKeyBeforeQueue keycode=26 screenIsOn=false keyguardActive=true
KeyguardViewMediator - wakeWhenReadyLocked(26)
InputDispatcher - notifyKey - deviceId=0x0, source=0x101, policyFlags=0x32000002, action=0x0, flags=0x9, keyCode=0x1a, scanCode=0x74, metaState=0x0, eventTime=5904047125987
Click to expand...
Click to collapse
Then it triggers other functions (turn lights on...) and then enable the lockscreen.
However, when i press the Trackpad, all i get is this:
InputDispatcher - notifyMotion - eventTime=1313024185481, deviceId=0x20000, source=0x10004, policyFlags=0x2000000, action=0x0, flags=0x0, metaState=0x0, edgeFlags=0x0, xPrecision=6.000000, yPrecision=6.000000, downTime=1313024185481
InputDispatcher - Pointer 0: id=0, x=0.000000, y=0.000000, pressure=1.000000, size=0.000000, touchMajor=0.000000, touchMinor=0.000000, toolMajor=0.000000, toolMinor=0.000000, orientation=0.000000
InputDispatcher - notifyMotion - eventTime=1313162113375, deviceId=0x20000, source=0x10004, policyFlags=0x2000000, action=0x1, flags=0x0, metaState=0x0, edgeFlags=0x0, xPrecision=6.000000, yPrecision=6.000000, downTime=1313024185481
InputDispatcher - Pointer 0: id=0, x=0.000000, y=0.000000, pressure=0.000000, size=0.000000, touchMajor=0.000000, touchMinor=0.000000, toolMajor=0.000000, toolMinor=0.000000, orientation=0.000000
Click to expand...
Click to collapse
Which looks like a motion/sensor tracking routine...
It got me puzzled, i really don't know where to go from here... :-/
Full debug log for Power button down here:
Code:
WindowManager - interceptKeyBeforeQueue keycode=26 screenIsOn=false keyguardActive=true
KeyguardViewMediator - wakeWhenReadyLocked(26)
dalvikvm - --- called into dvmAbstractMethodStub
InputManager-JNI - An exception was thrown by callback 'interceptKeyBeforeQueueing'.
InputManager-JNI - java.lang.AbstractMethodError: abstract method not implemented
InputManager-JNI - at com.android.server.PowerManagerService.getProximitySensorActive(PowerManagerService.java)
InputManager-JNI - at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeQueueing(PhoneWindowManager.java:2749)
InputManager-JNI - at com.android.server.WindowManagerService$InputMonitor.interceptKeyBeforeQueueing(WindowManagerService.java:5255)
InputManager-JNI - at com.android.server.InputManager$Callbacks.interceptKeyBeforeQueueing(InputManager.java:404)
InputManager-JNI - at dalvik.system.NativeStart.run(Native Method)
InputDispatcher - notifyKey - deviceId=0x0, source=0x101, policyFlags=0x32000002, action=0x0, flags=0x9, keyCode=0x1a, scanCode=0x74, metaState=0x0, eventTime=5904047125987
LightsService - [LedInfo] setLight_native light=2 colorARGB=-11447983 flashMode=0 onMS=0 offMS=0 brightnessMode=0
lights - set_light_buttons_func: on=5329233 brightness=81
power - *** set_screen_state 1
SensorService - noteStartSensor: uid = 0x3e8, handle = 0x4
LightsService - [LedInfo] setLight_native light=0 colorARGB=-11447983 flashMode=0 onMS=0 offMS=0 brightnessMode=1
WindowManager - interceptKeyBeforeQueue keycode=26 screenIsOn=true keyguardActive=true
InputDispatcher - notifyKey - deviceId=0x0, source=0x101, policyFlags=0x2000002, action=0x1, flags=0x8, keyCode=0x1a, scanCode=0x74, metaState=0x0, eventTime=5904147369869
SurfaceFlinger - Screen about to return, flinger = 0x319288
LightsService - [LedInfo] setLight_native light=2 colorARGB=-8355712 flashMode=0 onMS=0 offMS=0 brightnessMode=0
lights - set_light_buttons_func: on=8421504 brightness=128
LightsService - [LedInfo] setLight_native light=1 colorARGB=-16777216 flashMode=0 onMS=0 offMS=0 brightnessMode=0
WindowManager - needSensorRunningLp, mCurrentAppOrientation =1
HtcLockScreen2.0 - HtcLockScreen: onResume

something new here? because this problem does not yet use Gingerbread Sense 2.1 ROM's for long time

Related

ActiveCall screen problem

Hi,
I have problem with ActiveCall screen (today plugin in fact). When I place a call it doesn't appear. I think this is what left after having HTC today plugin for 5 minutes... I think it messed up my registry.
So here's my request: could someone post screenshot (or values in any other way) of:
HKLM\Software\Microsoft\Today\Items\"Active Call" ?
I would be very thankful.
Registry entries
My registry shows the following entries:
DLL \windows\ActiveCallPlugin.dll
Enabled 0x1
hWnd 0x7C07AAB0
Options 0x1
Order 0x2
Selectability 0x2
Type 0x6
Hope this helps,
John
johnjtaylor said:
My registry shows the following entries:
DLL \windows\ActiveCallPlugin.dll
Enabled 0x1
hWnd 0x7C07AAB0
Options 0x1
Order 0x2
Selectability 0x2
Type 0x6
Hope this helps,
John
Click to expand...
Click to collapse
Thanks, but it doesn't work for me
I think I'll hardreset in the evening...

Info 2 how to toggle button burst button to btn_toggles_normal on notification pulldo

Info 2 how to toggle button burst button to btn_toggles_normal on notification pulldown?
Hello guys.. all things and functionality works applying spacecakers buttonburst mod except... if i toggle button burst button, so now it displays btn_tg or open face of quickpanel and if i close notification panel since recently button burst was toggled to open when i pull down the notification again, it still shows btn_tg or open face and logically its bug....
How to add or reinitialize button burst image to normal when i close or open notification panel.....
Heres how it looks:
Before I toggle button burst -----> When I toggle button burst -----> I close the notification 1st & when i reopen notification panel BUG on button burst image
it shud be normal face or initial face but since no method is handling to reinitialize button image on close notify panel or open notify panel... how to add this code from buttonburst.smali
code taken from buttonburst.smali
.prologue
.line 34
const v2, 0xffffff
invoke-virtual {p0, v2}, Lcom/spacecaker/ButtonBurst;->setBackgroundColor(I)V
.line 35
iget-object v2, p0, Lcom/spacecaker/ButtonBurst;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const v3, 0x7f03017e ---------> this is the correct register already for button normal compared to my public.xml
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
.line 36
.local v1, "on":Landroid/graphics/drawable/Drawable;
.line 40
invoke-virtual {p0, v1}, Lcom/spacecaker/ButtonBurst;->setBackgroundDrawable(Landroid/graphics/drawable/DrawableV
Theres so many methods inside my phonestatusbar.smali and tried adding it in this method but i got a force close...
.method private makeExpandedVisible(Z)V
more methods
.method private notifyUiVisibilityChanged()V
.method public animateCollapse(IF)V
.method public animateExpand()V
.method protected getExpandedViewMaxHeight()I
.method performExpand()V
.method protected updateNotificationIcons()V
and so many more im confused where to add the code to reinitialize button burst button image to normal on notify expand or notify close...
Or anyone knows how to edit and open systemui java code in eclipse.... have no idea... it wud be much easier for me to edit things if smali is in java code...
Attached is my working PhoneStatusBar.smali and ButtonBurst.smali

Xiaomi bluetooth gamepad right trigger problem

Hello everybody!
I just bought a new nvidia shield tablet k1, hoping to be able to use my Xiaomi Bluetooth gamepad with it.
At first everything seems OK, until I discovered that I'm not able to use the right trigger with all games on geforce now.
Is there a way to fix it?
I checked with the app "game controller tester" and all the buttons are perfectly recognised, that's an nvidia incompatibility.
Any help is appreciated!
EDIT: i'm sorry, I just realized i should post this question in Q&A
Bye
Same problem here, the pad also isn't recognised in a couple of other games either (Castle of Illusion and Dead Effect 2)
any updates on this issue?
any update on this?
I have same issue on Nvidia Shield TV. Right stick is not working and R1, which is main button in all race games.
Hello,
I had some issues with xiaomi gamepad too but I have another phone and my problem was a bit different but you still can try my solution, who knows, maybe it will help you. Implosion: Never Lose Hope didn't detect right stick so I was unable to shoot. I managed to solve this by custom .kl file which I got on 4pda (unfortunately I can't post links due to the restrictions of the forum).
What you need to do is:
1. Root your device
2. Create a file named Vendor_2717_Product_3144.kl and put the following in it:
Code:
# Xiaomi Gamepad
key 304 BUTTON_A
key 305 BUTTON_B
key 307 BUTTON_X
key 308 BUTTON_Y
key 310 BUTTON_L1
key 311 BUTTON_R1
key 312 BUTTON_L2
key 313 BUTTON_R2
key 315 BUTTON_START
key 314 BACK
key 172 HOME
key 317 BUTTON_THUMBL
key 318 BUTTON_THUMBR
axis 0x00 X
axis 0x01 Y
axis 0x02 Z
axis 0x05 RZ
axis 0x06 RTRIGGER
axis 0x0a LTRIGGER
axis 0x10 HAT_X
axis 0x11 HAT_Y
3. Put this file to a /usr/keylayout folder.
4. Change permissions for a file.
That's it, in my case there was no need in reboot, I just reconnected the gamepad to a phone and everything was fine.

Need help with MXQ Pro remote.conf

Hi!
I just got my MXQ Pro S905 android tv box and right out the box, the remote control didn't work. I googled and visited different website and I found a remote.conf file to replace the current one on the box, so I did. Now the remote partially works. I can use the arrows, volume up down, etc... The problem is I still can't get the power button or the mouse to work Any expert help on how to get it to work please?
Here is the new remote.conf file that partially works ( power button and mouse don't work):
#************************************************* ************************************************** ******
#this file is configuration for each factory remote device
# work_mode 0 :software mode 1 :hardware mode
# repeat_enable 0 :disable repeat 1 :enable repeat
#
# factory_code each device has it's unique factory code.
# pattern:custom_code(16bit)+index_code(16bit)
# examble: 0xff000001 = 0xff00(custom cod) 0001 (index)
#
# release_delay unit:ms.release will report from kernel to user layer after this period of time
# from press or repeat triggered.
#
# debug_enable 0 :debug disable 1 :debug disable
#
# SW MODE:
# bit_count how many bits in each frame
# tw_leader_act time window for leader active
# tw_bit0 time window for bit0 time.
# tw_bit1 time window for bit1 time
# tw_repeat_leader time window for repeat leader
# REG
# reg_base_gen set value for PREG_IR_DEC_BASE_GEN
# reg_control set value for PREG_IR_DEC_CONTROL
# reg_leader_act set value for PREG_IR_DEC_LEADER_ACTIVE
# reg_leader_idle set value for PREG_IR_DEC_LEADER_IDLE
# reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE
# reg_bit0_time set value for PREG_IR_DEC_BIT0_TIME
#************************************************* ************************************************** **********
#amlogic NEC remote
factory_code = 0x7f800001
work_mode = 0
repeat_enable = 1
repeat_delay = 40
repeat_peroid = 39
release_delay = 121
debug_enable = 1
fn_key_scancode = 0x15
left_key_scancode = 0x1c
right_key_scancode = 0x48
up_key_scancode = 0x44
down_key_scancode = 0x1d
ok_key_scancode = 0x5c
pageup_key_scancode = 0x04
pagedown_key_scancode = 0x1b
mouse_begin
0 0x1c
1 0x48
2 0x44
3 0x1d
mouse_end
key_begin
0x4d 113
0x56 114
0x4e 115
0x25 105
0x26 103
0x27 106
0x28 108
0x0d 97
0x1b 158
0x53 102
0x51 704
0x49 139
0x52 388
0x31 2
0x32 3
0x33 4
0x34 5
0x35 6
0x36 7
0x37 8
0x38 9
0x39 10
0x30 11
0x58 389
0x44 14
0xbd 122
0xbb 123
0x09 393
0x11 390
0x54 391
0x4f 392
key_end
repeat_key_begin
0x4d 113
0x56 114
0x4e 115
0x25 105
0x26 103
0x27 106
0x28 108
0x0d 28
0x1b 158
0x53 102
0x51 704
0x49 139
0x52 388
0x31 2
0x32 3
0x33 4
0x34 5
0x35 6
0x36 7
0x37 8
0x38 9
0x39 10
0x30 11
0x58 389
0x44 111
0xbd 122
0xbb 123
0x09 164
0x11 390
0x54 391
0x4f 392
repeat_key_end
try a reflash
guide here
http://forum.xda-developers.com/showthread.php?t=3400814
Sent from my SM-G920F using XDA-Developers mobile app

[GUIDE] Fix home button press in expanded status bar panel

What is expanded status bar panel? This is the view when you swipe down the status bar. Normally the status bar is visible but in expanded status bar panel, it is not.
In case anyone noticed that pressing home button is not working when you are on expanded status bar panel. This is a work around to fix it.
If you remember, you have changed 0x7de to 0x7d3 in StatusBarService.smali. 0x7d3 or 2003 or WindowManager.LayoutParams.TYPE_SYSTEM_ALERT is a window type that is used for alert dialogs(The kind of alert that shows when you press "power off" in power button menu) so the home button won't work when an alert dialog is showing on screen.
Now we have two options to fix this: edit StatusBarService.smali in SystemUI.apk ---OR--- edit PhoneWindowManager.smali in android.policy.jar
First option: Edit StatusBarService.smali in SystemUI.apk
- What happens here? - We will change the window type to TYPE_SYSTEM_DIALOG so the home button will work again because in this window type, the home button works.
STEPS:
1. Decompile SystemUI.apk
2. Open StatusBarService.smali
3. Find
Code:
0x7d3
and change it to
Code:
0x7d8
NOTE: There are two(2) of them so change both.
4. Save file and recompile SystemUI.apk
5. Push to /system/app, reboot, or use hackUI.apk
6. DONE!
Second option: Edit PhoneWindowManager.smali in android.policy.jar(Framework file)
- What happens here? - We will remove the flag that disables the home button when an alert dialog is showing. NOTE that all this enables the home button in ALL TYPES of alert dialogs, not just in expanded status bar panel.
STEPS:
1. Decompile android.policy.jar
2. Open PhoneWindowManager.smali
3. Find
Code:
const/4 v0, 0x2
new-array v0, v0, [I
fill-array-data v0, :array_26
and change it to
Code:
const/4 v0, 0x1
new-array v0, v0, [I
fill-array-data v0, :array_26
4. Find
Code:
0xd3t 0x7t 0x0t 0x0t
and delete the whole line
5. Recompile android.policy.jar
6. Push to /system/framework and reboot
7. DONE!

Categories

Resources