修改一下文件
一, kernel ,,,不说了
二, android
1,android\frameworks\base\data\keyboards\qwerty.kl
2,android\frameworks\base\data\keyboards\Generic.kl
3,frameworks/base/core/res/res/values/attrs.xml
4,frameworks/base/include/androidfw/KeycodeLabels.h
static const KeycodeLabel KEYCODES[] = {
{ "SOFT_LEFT", 1 },
{ "SOFT_RIGHT", 2 },
{ "HOME", 3 },
{ "BACK", 4 },
{ "CALL", 5 },
{ "ENDCALL", 6 },
{ "0", 7 },
5,,frameworks/native/include/android/keycodes.h
6,,vi frameworks/base/core/java/android/view/KeyEvent.java
public static final int KEYCODE_ASSIST = 219;
++ public static final int KEYCODE_KNOCK_RIGHT = 252;//add by jiangdou
++ public static final int KEYCODE_KNOCK_LEFT = 253;//add by jiangdou
.....()...
private static void populateKeycodeSymbolicNames() {
SparseArray<String> names = KEYCODE_SYMBOLIC_NAMES;
names.append(KEYCODE_UNKNOWN, "KEYCODE_UNKNOWN");
names.append(KEYCODE_ASSIST, "KEYCODE_ASSIST");
++ names.append(KEYCODE_KNOCK_RIGHT, "KEYCODE_KNOCK_RIGHT");//add by jiangdou
++ names.append(KEYCODE_KNOCK_LEFT, "KEYCODE_KNOCK_LEFT");//add by jiangdou
......()....
7, vi frameworks/base/libs/androidfw/Input.cpp
...............()....
bool KeyEvent::hasDefaultAction(int32_t keyCode) {
switch (keyCode) {
case AKEYCODE_HOME:
case AKEYCODE_MEDIA_RECORD:
++ case AKEYCODE_KNOCK_RIGHT:
++ case AKEYCODE_KNOCK_LEFT:
..............().........
8,,,,vi external/webkit/Source/WebKit/android/plugins/ANPKeyCodes.h
.......()....
kAppSwitch_ANPKeyCode = 187,
++ kKnockRight_ANPKeyCode = 252,
++ kKnockLeft_ANPKeyCode = 253,
9编译ERROR
编译出错:
out/target/common/obj/PACKAGING/public_api.txt:22549: error 17: Field android.view.KeyEvent.KEYCODE_STAR has changed value from 17 to 227
out/target/common/obj/PACKAGING/public_api.txt:22636: error 17: Field android.view.KeyEvent.KEYCODE_POUND has changed value from 18 to 228
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
******************************
解决办法:
自己找到了在framework/base/api 下有n(n取决于你源码的版本,如果你源码的版本是4.0.4 ,那么就 有分别以 1~ 15命名的xml或txt,就是api level)个xml或txt文档,分别对应android api 的不同版本。 在这些xml中,把你在framework层中修改的地方对应进去。 如我这个错误的地方,在15.txt 和 current.xml 中找到“KEYCODE_STAR”,把里面的value 值改成和你代码中值一致就可以了。
modify
1, vi framework/base/api/15.txt
field public static final int KEYCODE_ZOOM_IN = 168; // 0xa8
++ field public static final int KEYCODE_KNOCK_RIGHT = 252; // 0xFC
++ field public static final int KEYCODE_KNOCK_LEFT = 253; // 0xFD
field public static final int KEYCODE_ZOOM_OUT = 169; // 0xa9
2, vi framework/base/api/16.txt
field public static final int KEYCODE_ZOOM_IN = 168; // 0xa8
++ field public static final int KEYCODE_KNOCK_RIGHT = 252; // 0xFC
++ field public static final int KEYCODE_KNOCK_LEFT = 253; // 0xFD
field public static final int KEYCODE_ZOOM_OUT = 169; // 0xa9
3, vi framework/base/api/17.txt
field public static final int KEYCODE_ZOOM_IN = 168; // 0xa8
++ field public static final int KEYCODE_KNOCK_RIGHT = 252; // 0xFC
++ field public static final int KEYCODE_KNOCK_LEFT = 253; // 0xFD
field public static final int KEYCODE_ZOOM_OUT = 169; // 0xa9
4 2, vi framework/base/api/16.txt
field public static final int KEYCODE_ZOOM_IN = 168; // 0xa8
++ field public static final int KEYCODE_KNOCK_RIGHT = 252; // 0xFC
++ field public static final int KEYCODE_KNOCK_LEFT = 253; // 0xFD
field public static final int KEYCODE_ZOOM_OUT = 169; // 0xa9
5,,, vi frameworks/base/api/current.txt
field public static final int KEYCODE_ZOOM_IN = 168; // 0xa8
++ field public static final int KEYCODE_KNOCK_RIGHT = 252; // 0xFC
++ field public static final int KEYCODE_KNOCK_LEFT = 253; // 0xFD
field public static final int KEYCODE_ZOOM_OUT = 169; // 0xa9
====================================我是分割线=============================================
====================================我是分割线=============================================
修改android默认语言
vi vi device/softwinner/wing-common/ProductCommon.mk