Android 13 MTK平台添加自定义按键,以及CTS问题解决

添加自定义按键流程

一般来说上层添加以下几处修改

驱动层的键值上报,让驱动处理好即可

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; // 0x12b
    field public static final int KEYCODE_FEATURED_APP_4 = 300; // 0x12c
   + field public static final int KEYCODE_FINGER = 305; // 0x131
    field public static final int KEYCODE_FOCUS = 80; // 0

你可能感兴趣的:(android,java,开发语言)