Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83d362e9 authored by Josep del Río's avatar Josep del Río Committed by Automerger Merge Worker
Browse files

Merge "Do not share key mappings with JNI object" into rvc-dev am: 6676e5a8

parents 3b8eb303 6676e5a8
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
 * limitations under the License.
 */

#include <binder/Parcel.h>
#include <input/Input.h>

#include <android_runtime/AndroidRuntime.h>
@@ -48,9 +49,16 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi
        return NULL;
    }

    sp<KeyCharacterMap> map = deviceInfo.getKeyCharacterMap();
    if (map != nullptr) {
        Parcel parcel;
        map->writeToParcel(&parcel);
        map = map->readFromParcel(&parcel);
    }

    ScopedLocalRef<jobject> kcmObj(env,
                                   android_view_KeyCharacterMap_create(env, deviceInfo.getId(),
            deviceInfo.getKeyCharacterMap()));
                                                                       map));
    if (!kcmObj.get()) {
        return NULL;
    }