universal7885: Import KeyLogger

This lib helps to log input keycodes
This commit is contained in:
Ramii ahmed 2021-01-28 17:22:22 -08:00 committed by roynaetch2544
commit 8582551795
No known key found for this signature in database
GPG key ID: 50ABF73F0D19445D
4 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,6 @@
java_library {
name: "keyhandler",
srcs: [
"src/com/eurekateam/keyhandler/KeyHandler.java",
],
}

View file

@ -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;
}
*/
}
}

View file

@ -163,6 +163,16 @@
<!-- Flag indicating whether round icons should be parsed from the application manifest. -->
<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 -->
<bool name="config_enableMultiUserUI">true</bool>
<integer name="config_multiuserMaximumUsers">3</integer>

View file

@ -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/uinput-sec-fp.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/uinput-sec-fp.kl
# KeyLogger
PRODUCT_PACKAGES += \
keyhandler
# Keymaster
PRODUCT_PACKAGES += \
android.hardware.keymaster@4.0-service.samsung \