android 4.4 添加物理按键

kernel下添加


linux-3.4/drivers/input/keyboard/Makefile

linux-3.4/drivers/input/keyboard/sw-keyboard.c

 sw_scankeycodes[]={

[1] = KEY_GPS,

}


android 下添加

device/softwinner/wing-k70/configs/sw-keyboard.kl

key 249 GPS WAKE


frameworks/base/core/res/values/attrs.xml

<enum name="KEYCODE_GPS" value="249" />


frameworks/native/libs/input/input.cpp

 isSystemKey( int32_t keyCode){

        case AKEYCODE_GSP:

        return true;

}

frameworks/native/include/android/keycodes.h


       AKEYCODE_GPS = 249,


frameworks/base/core/java/android/view/keyEvent.java


public static final int KEYCODE_GPS = 249;

private static final int LAST_KEYCODE = KEYCODE_GSP;


populateKeycodeSymbolicName()

names.append(KEYCODE_MEDIA_AUDIO_TRACK,"KEYCODE_GPS");


frameworks/base/policy/src/com/android/internal/policy/impl/phoneWindowManager.java


interceptKeyBeforeDispatching()

else if(keyCode == KeyEvent.KEYCODE_GPS){ //frameworks 中处理物理按键

}


你可能感兴趣的:(android 4.4 添加物理按键)