summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyungwoo Yang <hyungwooyang@google.com>2023-02-27 07:10:40 +0000
committerHyungwoo Yang <hyungwooyang@google.com>2023-03-08 05:34:21 +0000
commitd7162912e6da57cd046545fecf4e26eb4e281290 (patch)
treedbb1e8783ae038e4c712407940436f24ac312862
parent56a9d343f35dff81006fe10a92e35edae0b4e508 (diff)
downloadnovatek_touch-android-gs-felix-5.10-android13-qpr3-c.tar.gz
Sometimes, even with the only one stylus, we see normal pairing happening instead of fast pairing. This removes the stylus information maintained in the driver and the UI platform cannot shows the stylus information until the driver collects the same information again. This patch, when there's normal pairing, compares new HASH ID with the one from the previous stylus. The driver removes the stylus information only when the HASH ID is changed. Bug: 259261326 Change-Id: I1cda091a3455d8e7adcdecfeeded5de69bbece5d Signed-off-by: Hyungwoo Yang <hyungwooyang@google.com>
-rw-r--r--nt36xxx/nt36xxx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nt36xxx/nt36xxx.c b/nt36xxx/nt36xxx.c
index ea24edb..ab7d104 100644
--- a/nt36xxx/nt36xxx.c
+++ b/nt36xxx/nt36xxx.c
@@ -1591,8 +1591,14 @@ static void process_usi_responses(uint16_t info_buf_flags, const uint8_t *info_b
}
}
- if (info_buf_flags & USI_NORMAL_PAIR_FLAG)
- nvt_usi_clear_stylus_read_map();
+ if (info_buf_flags & USI_NORMAL_PAIR_FLAG) {
+ uint8_t hash_id[2] = {0};
+
+ /* clear stylus info map if the HASH ID is not available or not matched */
+ if (nvt_usi_get_hash_id(hash_id) || hash_id[0] != *(info_buf + USI_HASH_ID_OFFSET) ||
+ hash_id[1] != *(info_buf + USI_HASH_ID_OFFSET + 1))
+ nvt_usi_clear_stylus_read_map();
+ }
if (info_buf_flags & USI_BATTERY_FLAG) {
nvt_usi_store_battery(info_buf + USI_BATTERY_OFFSET);