Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,988 Members 45,127 Now Online
XDA Developers Android and Mobile Development Forum

[HOWTO] Remap hardware button to ICS recent apps

Tip us?
 
evilisto
Old
(Last edited by evilisto; 21st March 2012 at 07:44 PM.) Reason: update
#1  
evilisto's Avatar
Senior Member - OP
Thanks Meter 2341
Posts: 486
Join Date: Nov 2010
Default [HOWTO] Remap hardware button to ICS recent apps



this is simple howto about this mod.. : [MOD] Search key to ICS recent apps


1) change source code related to APP_SWITCH keycode.

platform/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

from :
Code:
        } else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
            if (down && repeatCount == 0) {
                showOrHideRecentAppsDialog(RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS);
            }
            return -1;
        }

to :
Code:
        } else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
            if (down && repeatCount == 0 && !keyguardOn) {
            try {
                mStatusBarService.toggleRecentApps();
            } catch (RemoteException e) {
                Slog.e(TAG, "RemoteException when showing recent apps", e);
            }
        }
            return -1;
        }

2) edit your keylayout files..

/system/usr/keylayout/

for example, if you want to use search key to recent apps on nexus s...

cypress-touchkey.kl
Code:
key 139    MENU           VIRTUAL
key 102    HOME           VIRTUAL
key 158    BACK           VIRTUAL
key 217    APP_SWITCH     VIRTUAL
and mxt224_ts_input.kl (it would be better to edit both files..)
Code:
key 158   BACK              WAKE
key 139   MENU              WAKE
key 217   APP_SWITCH        WAKE
key 102   HOME              WAKE

3) done

---------------------------------------------------------------------------------------------------

- and if you cannot compile android.policy.jar for some reason, try with my files instead.
you can find my files in these thread :
[MOD] Search key to ICS recent apps
[MOD] Add ICS 'Recent Apps' button to Status bar
and be careful. you should use suitable version to your rom. so if your cm9 rom was built few weeks ago, do not try with latest version of my mod.
The Following 18 Users Say Thank You to evilisto For This Useful Post: [ Click to Expand ]
 
etoy
Old
#2  
etoy's Avatar
Senior Member
Thanks Meter 514
Posts: 1,534
Join Date: Dec 2009
dumb question, but what does originally the "APP_SWITCH" action do without the java change?
 
thejaredhuang
Old
(Last edited by thejaredhuang; 17th January 2012 at 06:26 PM.)
#3  
Member
Thanks Meter 3
Posts: 95
Join Date: Jan 2007
It brings up a recent apps window that looks like the original switcher from 1.5.

For OP, does this still mess up the other key functions that you said in your other thread?
 
evilisto
Old
#4  
evilisto's Avatar
Senior Member - OP
Thanks Meter 2341
Posts: 486
Join Date: Nov 2010
Quote:
Originally Posted by etoy View Post
dumb question, but what does originally the "APP_SWITCH" action do without the java change?
that will bring old version app switcher.

Quote:
Originally Posted by thejaredhuang View Post
For OP, does this still mess up the other key functions that you said in your other thread?
if you use proper version for your rom(currently stock, cm9 and aokp), key problems will not happen. but that will happen on other roms like peter alfonso's ics..
 
jerkysh
Old
#5  
jerkysh's Avatar
Senior Member
Thanks Meter 173
Posts: 488
Join Date: Feb 2011
Location: Chisinau
where the hell is this direction?
platform/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java , i would love to try this mod on my cappy, to see if it works
 
Smasher816
Old
#6  
Smasher816's Avatar
Senior Member
Thanks Meter 166
Posts: 389
Join Date: Jan 2011
Location: Missouri

 
DONATE TO ME
Its in the android source code...
Someone needs to make a modded rom based on that (ex a cm9 kang).
and remember use the THANKS button

Retired: Samsung Captivate
Current: Samsung Galaxy S III

Glitch Updater App (Developed by yours truly)
 
RaptorOne3
Old
#7  
RaptorOne3's Avatar
Senior Member
Thanks Meter 30
Posts: 257
Join Date: Dec 2010
If you don't mind me asking, what is the significance of this?

Long pressing the "Home" capacitive key brings up the "Recent Apps" screen... Why change it?

Forgive my short sighted confusion, but I just don't understand why you want your search button to bring up the Recent Apps screen when the home button already does it...

 
nonione
Old
#8  
nonione's Avatar
Senior Member
Thanks Meter 164
Posts: 592
Join Date: Aug 2009
Location: S.S.
cause its faster just like in the GN you only tap and theres your multitask
I've been granted superuser permissions!!!

Follow me on twitter @noniwun!!!
 
thejaredhuang
Old
#9  
Member
Thanks Meter 3
Posts: 95
Join Date: Jan 2007
Quote:
Originally Posted by RaptorOne3 View Post
If you don't mind me asking, what is the significance of this?

Long pressing the "Home" capacitive key brings up the "Recent Apps" screen... Why change it?

Forgive my short sighted confusion, but I just don't understand why you want your search button to bring up the Recent Apps screen when the home button already does it...

If you've ever used webOS you'll understand how frustrating it is to hold the Home button down for 2 seconds.

I would be bagging on Android for copying webOS but in the end its the same person who designed it.
 
qtwrk
Old
#10  
qtwrk's Avatar
Senior Member
Thanks Meter 805
Posts: 2,490
Join Date: Sep 2011
Location: Barcelona
this is great , i have my nexus s for 5 moths and almost never use SEARCH BUTTON..., problem is , i am using KANGY by HAKA, ok , this is not the issue

but i also applied http://forum.xda-developers.com/show....php?t=1439681 this MOD .... that brings me a problem ...

and i don't have access to source code of this MOD , how am i supposed to do it ?
if my words are useful or helpful to you , i will appreciate it you click thanks button
GT-i9023 Nexus S
GT-i9250 Galaxy Nexus
GT-i9300 Galaxy S III
GT-s5830 Galaxy Ace
GT-i9300 Galaxy S III
GT-i9506 Galaxy S IV 4G+
GT-i9505 Galaxy S IV (current)

Tags
ics button recent multitask swicher
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes