diff --git a/lib/ui/window/key_data.h b/lib/ui/window/key_data.h index d7a8a4fe88efe..be200cc2882c7 100644 --- a/lib/ui/window/key_data.h +++ b/lib/ui/window/key_data.h @@ -9,10 +9,10 @@ namespace flutter { - // If this value changes, update the encoding code in the following files: - // - // * KeyData.java (KeyData.FIELD_COUNT) - // * platform_dispatcher.dart (_kKeyDataFieldCount) +// If this value changes, update the encoding code in the following files: +// +// * KeyData.java (KeyData.FIELD_COUNT) +// * platform_dispatcher.dart (_kKeyDataFieldCount) static constexpr int kKeyDataFieldCount = 6; static constexpr int kBytesPerKeyField = sizeof(int64_t); diff --git a/shell/platform/android/io/flutter/embedding/android/KeyData.java b/shell/platform/android/io/flutter/embedding/android/KeyData.java index 05578de1b9ef7..776372c801169 100644 --- a/shell/platform/android/io/flutter/embedding/android/KeyData.java +++ b/shell/platform/android/io/flutter/embedding/android/KeyData.java @@ -140,10 +140,10 @@ public KeyData(@NonNull ByteBuffer buffer) { long timestamp; Type type; - DeviceType deviceType; long physicalKey; long logicalKey; boolean synthesized; + DeviceType deviceType; /** The character of this key data encoded in UTF-8. */ @Nullable String character; @@ -173,7 +173,7 @@ ByteBuffer toBytes() { packet.putLong(physicalKey); packet.putLong(logicalKey); packet.putLong(synthesized ? 1L : 0L); - packet.putLong(deviceType); + packet.putLong(deviceType.getValue()); if (charBytes != null) { packet.put(charBytes); }