FORUMS

XDA Recap: This Week In Android (May 17 – 23)

Another week, another recap. The Sunday tradition marches on this week with a fresh … more

Huawei To Sell Honor Smartphones Via Indian Retail Outlets

World’s fourth largest smartphone maker Huawei plans to now sell its … more

Sunday Debate: Are Smaller Bezels Better or Worth It?

Bezels have been getting smaller and smaller as the years go by, and while devices … more

LG G4 First Impressions and Unboxing – XDA TV

The latest in LG’s signature line of “G phones” has been released. … more
Post Reply Subscribe to Thread Email Thread

[HOWTO] Remap hardware button to ICS recent apps

17th January 2012, 06:46 AM |#1  
evilisto's Avatar
OP Senior Member
Thanks Meter: 2,352
 
More


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.
Last edited by evilisto; 21st March 2012 at 07:44 PM. Reason: update
The Following 18 Users Say Thank You to evilisto For This Useful Post: [ View ]
 
 
17th January 2012, 09:16 AM |#2  
etoy's Avatar
Senior Member
Thanks Meter: 586
 
More
dumb question, but what does originally the "APP_SWITCH" action do without the java change?
17th January 2012, 06:19 PM |#3  
Member
Thanks Meter: 3
 
More
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?
Last edited by thejaredhuang; 17th January 2012 at 06:26 PM.
17th January 2012, 07:58 PM |#4  
evilisto's Avatar
OP Senior Member
Thanks Meter: 2,352
 
More
Quote:
Originally Posted by etoy

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

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..
17th January 2012, 10:03 PM |#5  
jerkysh's Avatar
Senior Member
Flag Chisinau
Thanks Meter: 180
 
More
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
17th January 2012, 10:32 PM |#6  
Smasher816's Avatar
Senior Member
Flag Missouri
Thanks Meter: 166
 
Donate to Me
More
Its in the android source code...
Someone needs to make a modded rom based on that (ex a cm9 kang).
17th January 2012, 10:53 PM |#7  
RaptorOne3's Avatar
Senior Member
Thanks Meter: 30
 
More
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...

17th January 2012, 11:06 PM |#8  
nonione's Avatar
Senior Member
S.S.
Thanks Meter: 164
 
More
cause its faster just like in the GN you only tap and theres your multitask
18th January 2012, 01:17 AM |#9  
Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by RaptorOne3

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.
18th January 2012, 02:10 AM |#10  
qtwrk's Avatar
Senior Member
Flag Barcelona
Thanks Meter: 818
 
More
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 ?
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes