添加自定義按鍵流程
一般來說上層添加以下幾處修改
驅動層的鍵值上報,讓驅動處理好即可
frameworks / base/core/java/android/view/KeyEvent.java
public static final int KEYCODE_DEMO_APP_4 = 304;/** add by songhui for fingerprint Key code */+ public static final int KEYCODE_FINGER = 305; /*** Integer value of the last KEYCODE. Increases as new keycodes are added to KeyEvent.* @hide*/@TestApi+ public static final int LAST_KEYCODE = KEYCODE_FINGER;//KEYCODE_DEMO_APP_4; /** add by songhui for fingerprint Key code */
frameworks / base/core/api/current.txt
field public static final int KEYCODE_FEATURED_APP_3 = 299; // 0x12bfield public static final int KEYCODE_FEATURED_APP_4 = 300; // 0x12c+ field public static final int KEYCODE_FINGER = 305; // 0x131field public static final int KEYCODE_FOCUS = 80; // 0