mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 12:35:33 -04:00
universal7885: Import KeyLogger
This lib helps to log input keycodes
This commit is contained in:
parent
8b275247f9
commit
8582551795
4 changed files with 54 additions and 0 deletions
6
universal7885-common/keyhandler/Android.bp
Normal file
6
universal7885-common/keyhandler/Android.bp
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
java_library {
|
||||||
|
name: "keyhandler",
|
||||||
|
srcs: [
|
||||||
|
"src/com/eurekateam/keyhandler/KeyHandler.java",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 The LineageOS Project
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.eurekateam.keyhandler;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
|
import com.android.internal.os.DeviceKeyHandler;
|
||||||
|
|
||||||
|
public class KeyHandler implements DeviceKeyHandler {
|
||||||
|
private static final String TAG = "KeyHandler";
|
||||||
|
// private static final KEYCODE_SIDE_FP = -1;
|
||||||
|
public KeyHandler(Context context) {
|
||||||
|
Log.i(TAG, "KeyHandler constructor called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeyEvent handleKeyEvent(KeyEvent event) {
|
||||||
|
int scanCode = event.getScanCode();
|
||||||
|
Log.i(TAG, "handleKeyEvent=" + scanCode);
|
||||||
|
/*
|
||||||
|
switch (scanCode) {
|
||||||
|
case KEYCODE_SIDE_FP:
|
||||||
|
return null;
|
||||||
|
default:
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -163,6 +163,16 @@
|
||||||
<!-- Flag indicating whether round icons should be parsed from the application manifest. -->
|
<!-- Flag indicating whether round icons should be parsed from the application manifest. -->
|
||||||
<bool name="config_useRoundIcon">true</bool>
|
<bool name="config_useRoundIcon">true</bool>
|
||||||
|
|
||||||
|
<!-- Paths to the libraries that contain device specific key handlers -->
|
||||||
|
<string-array name="config_deviceKeyHandlerLibs" translatable="false">
|
||||||
|
<item>/system/framework/keyhandler.jar</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<!-- Names of the key handler classes -->
|
||||||
|
<string-array name="config_deviceKeyHandlerClasses" translatable="false">
|
||||||
|
<item>com.eurekateam.keyhandler.KeyHandler</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<!-- Maximum number of supported users -->
|
<!-- Maximum number of supported users -->
|
||||||
<bool name="config_enableMultiUserUI">true</bool>
|
<bool name="config_enableMultiUserUI">true</bool>
|
||||||
<integer name="config_multiuserMaximumUsers">3</integer>
|
<integer name="config_multiuserMaximumUsers">3</integer>
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,10 @@ PRODUCT_COPY_FILES += \
|
||||||
$(LOCAL_PATH)/configs/keylayout/Codec3035_Headset_Events.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Codec3035_Headset_Events.kl \
|
$(LOCAL_PATH)/configs/keylayout/Codec3035_Headset_Events.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Codec3035_Headset_Events.kl \
|
||||||
$(LOCAL_PATH)/configs/keylayout/uinput-sec-fp.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/uinput-sec-fp.kl
|
$(LOCAL_PATH)/configs/keylayout/uinput-sec-fp.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/uinput-sec-fp.kl
|
||||||
|
|
||||||
|
# KeyLogger
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
keyhandler
|
||||||
|
|
||||||
# Keymaster
|
# Keymaster
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.keymaster@4.0-service.samsung \
|
android.hardware.keymaster@4.0-service.samsung \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue