mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-01-07 13:48:00 -05:00
af360bc9ea
wgetc873988898
.patch -O telecomm-01.patch wget0fb5786dbf
.patch -O mediaprovider-01.patch wget1a4b9ef510
.patch -O wifi-01.patch wget364a1d9962
.patch -O bluetooth-01.patch wget87a06448b9
.patch -O settings-01.patch wgetaaba724a68
.patch -O settings-02.patch wget507304e1f5
.patch -O native-01.patch wget89489ff5dd
.patch -O base-01.patch wgetd1765c4715
.patch -O base-02.patch wgetcbb1a0ecd6
.patch -O base-03.patch wget4725772c0b
.patch -O base-04.patch wget19747f6923
.patch -O base-05.patch wgete7a1aa9ed0
.patch -O base-06.patch wget922a7860b1
.patch -O base-07.patch wgeted183ed912
.patch -O base-08.patch wgetc6fbe1330a
.patch -O base-09.patch wget9141cac175
.patch -O base-10.patch wget41235bcc67
.patch -O av-01.patch wgeta89f704701
.patch -O av-02.patch wget6d7cd80d77
.patch -O av-03.patch wget75fc175a08
.patch -O av-04.patch wgetb023ec300f
.patch -O av-05.patch wgetc8117d1539
.patch -O av-06.patch wgetf06d23d824
.patch -O av-07.patch wget9c7408ab07
.patch -O av-08.patch wgetcfbfcefb3c
.patch -O launcher-01.patch wget4a27a7f162
.patch -O libxml-01.patch Signed-off-by: Tad <tad@spotco.us>
48 lines
2.0 KiB
Diff
48 lines
2.0 KiB
Diff
From 4725772c0b3f0db2940e70851e145ec4ec71768b Mon Sep 17 00:00:00 2001
|
|
From: Josep del Rio <joseprio@google.com>
|
|
Date: Mon, 26 Jun 2023 09:30:06 +0000
|
|
Subject: [PATCH] Do not share key mappings with JNI object
|
|
|
|
The key mapping information between the native key mappings and
|
|
the KeyCharacterMap object available in Java is currently shared,
|
|
which means that a read can be attempted while it's being modified.
|
|
|
|
Bug: 274058082
|
|
Test: Patch tested by Oppo
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3d993de0d1ada8065d1fe561f690c8f82b6a7d4b)
|
|
Merged-In: I745008a0a8ea30830660c45dcebee917b3913d13
|
|
Change-Id: I745008a0a8ea30830660c45dcebee917b3913d13
|
|
---
|
|
core/jni/android_view_InputDevice.cpp | 11 +++++++++--
|
|
1 file changed, 9 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/core/jni/android_view_InputDevice.cpp b/core/jni/android_view_InputDevice.cpp
|
|
index 9cc72437a023..f7c770e0bffb 100644
|
|
--- a/core/jni/android_view_InputDevice.cpp
|
|
+++ b/core/jni/android_view_InputDevice.cpp
|
|
@@ -42,6 +42,13 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi
|
|
return NULL;
|
|
}
|
|
|
|
+ // b/274058082: Pass a copy of the key character map to avoid concurrent
|
|
+ // access
|
|
+ std::shared_ptr<KeyCharacterMap> map = deviceInfo.getKeyCharacterMap();
|
|
+ if (map != nullptr) {
|
|
+ map = std::make_shared<KeyCharacterMap>(*map);
|
|
+ }
|
|
+
|
|
ScopedLocalRef<jstring> descriptorObj(env,
|
|
env->NewStringUTF(deviceInfo.getIdentifier().descriptor.c_str()));
|
|
if (!descriptorObj.get()) {
|
|
@@ -49,8 +56,8 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi
|
|
}
|
|
|
|
ScopedLocalRef<jobject> kcmObj(env,
|
|
- android_view_KeyCharacterMap_create(env, deviceInfo.getId(),
|
|
- deviceInfo.getKeyCharacterMap()));
|
|
+ android_view_KeyCharacterMap_create(env, deviceInfo.getId(),
|
|
+ map));
|
|
if (!kcmObj.get()) {
|
|
return NULL;
|
|
}
|