Mir

Merge lp:mir/0.18 into lp:mir/ubuntu

Proposed by Kevin DuBois
Status: Merged
Approved by: Kevin DuBois
Approved revision: 3184
Merged at revision: 1251
Proposed branch: lp:mir/0.18
Merge into: lp:mir/ubuntu
Diff against target: 70000 lines (+16163/-38510)
628 files modified
3rd_party/CMakeLists.txt (+0/-8)
3rd_party/android-input/CMakeLists.txt (+1/-1)
3rd_party/android-input/android/CMakeLists.txt (+1/-23)
3rd_party/android-input/android/frameworks/base/include/androidfw/InputDevice.h (+0/-156)
3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h (+0/-255)
3rd_party/android-input/android/frameworks/base/include/androidfw/KeyLayoutMap.h (+0/-114)
3rd_party/android-input/android/frameworks/base/include/androidfw/Keyboard.h (+0/-125)
3rd_party/android-input/android/frameworks/base/include/androidfw/KeycodeLabels.h (+0/-320)
3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h (+0/-110)
3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h (+0/-272)
3rd_party/android-input/android/frameworks/base/include/androidfw/VirtualKeyMap.h (+0/-81)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp (+0/-1502)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.h (+0/-444)
3rd_party/android-input/android/frameworks/base/services/input/GenericKeyMap.cpp (+0/-1009)
3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp (+0/-205)
3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp (+0/-183)
3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp (+0/-6356)
3rd_party/android-input/android/frameworks/base/services/input/InputReader.h (+0/-1750)
3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp (+1/-5)
3rd_party/android-input/android/frameworks/base/services/input/KeyCharacterMap.cpp (+0/-1152)
3rd_party/android-input/android/frameworks/base/services/input/KeyLayoutMap.cpp (+0/-387)
3rd_party/android-input/android/frameworks/base/services/input/Keyboard.cpp (+0/-328)
3rd_party/android-input/android/frameworks/base/services/input/PointerController.h (+0/-172)
3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp (+0/-110)
3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp (+0/-926)
3rd_party/android-input/android/frameworks/base/services/input/VirtualKeyMap.cpp (+0/-171)
3rd_party/android-input/android/frameworks/native/libs/utils/Timers.cpp (+4/-30)
3rd_party/xcursor/CMakeLists.txt (+0/-11)
CMakeLists.txt (+15/-9)
benchmarks/CMakeLists.txt (+0/-1)
benchmarks/android-input/CMakeLists.txt (+0/-20)
benchmarks/android-input/input_reader_perf.cpp (+0/-178)
benchmarks/android-input/ntrig_input_events.h (+0/-6944)
benchmarks/frame-uniformity/touch_producing_server.cpp (+0/-1)
benchmarks/frame-uniformity/vsync_simulating_graphics_platform.cpp (+14/-14)
benchmarks/frame-uniformity/vsync_simulating_graphics_platform.h (+5/-4)
cmake/PrePush.cmake (+0/-122)
debian/changelog (+122/-0)
debian/control (+13/-10)
debian/libmirserver36.install (+1/-1)
debian/mir-client-platform-mesa-dev.install (+0/-1)
debian/mir-platform-graphics-android7.install (+1/-1)
debian/mir-platform-graphics-mesa-kms7.install (+1/-1)
debian/mir-platform-graphics-mesa-x7.install (+1/-1)
debian/mir-platform-input-evdev4.install (+1/-1)
debian/mir-test-tools.install (+1/-1)
doc/building_source_for_arm.md (+20/-2)
examples/CMakeLists.txt (+32/-0)
examples/client_helpers.cpp (+76/-8)
examples/client_helpers.h (+29/-3)
examples/cursor-theme-dump.cpp (+127/-0)
examples/fingerpaint.c (+26/-5)
examples/multi_stream.cpp (+283/-0)
examples/render_surfaces.cpp (+3/-3)
examples/server_example.cpp (+4/-0)
examples/server_example_basic_window_manager.cpp (+312/-0)
examples/server_example_basic_window_manager.h (+152/-251)
examples/server_example_canonical_window_manager.cpp (+101/-370)
examples/server_example_canonical_window_manager.h (+16/-67)
examples/server_example_cursor_images.cpp (+57/-0)
examples/server_example_cursor_images.h (+33/-0)
examples/server_example_input_device_config.cpp (+162/-0)
examples/server_example_input_device_config.h (+73/-0)
examples/server_example_tiling_window_manager.cpp (+194/-110)
examples/server_example_tiling_window_manager.h (+23/-35)
examples/server_example_window_management.cpp (+14/-24)
examples/server_example_window_management_info.cpp (+406/-0)
examples/server_example_window_management_info.h (+103/-0)
examples/xcursor.c (+4/-4)
examples/xcursor_loader.cpp (+12/-6)
examples/xcursor_loader.h (+5/-2)
include/client/mir/events/event_builders.h (+7/-1)
include/client/mir_toolkit/events/surface_output_event.h (+9/-0)
include/client/mir_toolkit/mir_buffer_stream.h (+18/-2)
include/client/mir_toolkit/mir_connection.h (+25/-0)
include/client/mir_toolkit/mir_input_device.h (+56/-0)
include/client/mir_toolkit/version.h (+1/-1)
include/common/mir/assert_module_entry_point.h (+34/-0)
include/common/mir/optional_value.h (+15/-2)
include/cookie/mir/cookie_factory.h (+1/-1)
include/platform/mir/graphics/display.h (+0/-1)
include/platform/mir/graphics/display_configuration.h (+5/-1)
include/platform/mir/graphics/event_handler_register.h (+10/-0)
include/platform/mir/graphics/platform.h (+9/-9)
include/platform/mir/input/event_builder.h (+3/-5)
include/platform/mir/input/input_device.h (+11/-0)
include/platform/mir/input/input_sink.h (+0/-5)
include/platform/mir/input/platform.h (+2/-2)
include/platform/mir/input/pointer_settings.h (+58/-0)
include/platform/mir/input/touchpad_settings.h (+46/-0)
include/server/mir/frontend/session_authorizer.h (+1/-0)
include/server/mir/frontend/session_mediator_report.h (+2/-0)
include/server/mir/input/device.h (+9/-2)
include/server/mir/input/pointer_configuration.h (+71/-0)
include/server/mir/input/touchpad_configuration.h (+82/-0)
include/server/mir/scene/depth_id.h (+0/-34)
include/server/mir/scene/null_surface_observer.h (+2/-1)
include/server/mir/scene/session.h (+1/-0)
include/server/mir/scene/surface_creation_parameters.h (+0/-4)
include/server/mir/scene/surface_observer.h (+2/-1)
include/server/mir/server.h (+25/-9)
include/server/mir/shell/abstract_shell.h (+11/-2)
include/server/mir/shell/display_configuration_controller.h (+1/-1)
include/server/mir/shell/display_layout.h (+4/-2)
include/server/mir/shell/shell.h (+7/-1)
include/server/mir/shell/shell_report.h (+89/-0)
include/server/mir/shell/shell_wrapper.h (+5/-0)
include/server/mir/shell/surface_ready_observer.h (+2/-1)
include/server/mir/shell/surface_specification.h (+2/-2)
include/server/mir/shell/surface_stack.h (+17/-17)
include/server/mir/shell/surface_stack_wrapper.h (+51/-0)
include/server/mir/shell/system_compositor_window_manager.h (+15/-1)
include/server/mir/shell/window_manager.h (+5/-0)
include/test/mir/test/doubles/fake_display.h (+68/-0)
include/test/mir/test/doubles/mock_display_configuration.h (+57/-0)
include/test/mir/test/doubles/mock_egl.h (+14/-8)
include/test/mir/test/doubles/mock_window_manager.h (+2/-0)
include/test/mir/test/doubles/null_display_configuration.h (+4/-0)
include/test/mir/test/doubles/null_platform.h (+6/-5)
include/test/mir/test/doubles/stub_cursor_image.h (+42/-0)
include/test/mir/test/doubles/stub_display_configuration.h (+16/-2)
include/test/mir/test/doubles/stub_session.h (+96/-0)
include/test/mir/test/doubles/stub_session_authorizer.h (+4/-0)
include/test/mir/test/doubles/stub_surface.h (+77/-0)
include/test/mir/test/event_matchers.h (+33/-3)
include/test/mir/test/fake_event_hub.h (+0/-177)
include/test/mir/test/wait_condition.h (+8/-3)
include/test/mir_test_framework/async_server_runner.h (+1/-3)
include/test/mir_test_framework/connected_client_with_a_surface.h (+3/-0)
include/test/mir_test_framework/declarative_placement_window_manage_policy.h (+0/-4)
include/test/mir_test_framework/executable_path.h (+1/-0)
include/test/mir_test_framework/placement_applying_shell.h (+1/-5)
include/test/mir_test_framework/server_runner.h (+6/-4)
playground/demo-shell/default_window_manager.cpp (+10/-2)
playground/demo-shell/default_window_manager.h (+5/-0)
playground/demo-shell/demo_renderer.cpp (+0/-4)
playground/demo-shell/demo_shell.cpp (+1/-5)
src/CMakeLists.txt (+1/-0)
src/client/CMakeLists.txt (+1/-0)
src/client/buffer_stream.cpp (+125/-58)
src/client/buffer_stream.h (+22/-9)
src/client/buffer_vault.cpp (+4/-4)
src/client/buffer_vault.h (+10/-3)
src/client/client_buffer_stream.h (+2/-0)
src/client/default_client_buffer_stream_factory.cpp (+14/-4)
src/client/default_client_buffer_stream_factory.h (+1/-1)
src/client/event.cpp (+6/-0)
src/client/events/event_builders.cpp (+46/-1)
src/client/input/android/android_input_receiver.cpp (+22/-23)
src/client/input/android/android_input_receiver.h (+2/-3)
src/client/mir_buffer_stream_api.cpp (+6/-0)
src/client/mir_connection.cpp (+48/-18)
src/client/mir_connection.h (+6/-1)
src/client/mir_connection_api.cpp (+15/-0)
src/client/mir_surface.cpp (+19/-0)
src/client/mir_surface.h (+3/-0)
src/client/mir_surface_api.cpp (+15/-0)
src/client/mirclient.pc.in (+1/-1)
src/client/rpc/CMakeLists.txt (+2/-0)
src/client/rpc/mir_display_server.cpp (+14/-0)
src/client/rpc/mir_display_server.h (+8/-0)
src/client/symbols.map (+19/-0)
src/common/dispatch/threaded_dispatcher.cpp (+2/-0)
src/common/logging/input_timestamp.cpp (+6/-12)
src/common/symbols.map (+0/-1)
src/cookie/CMakeLists.txt (+1/-1)
src/cookie/cookie_factory.cpp (+1/-3)
src/cookie/mircookie.pc.in (+0/-1)
src/include/common/mir/events/event_private.h (+1/-0)
src/include/common/mir/protobuf/display_server.h (+8/-0)
src/include/platform/mir/emergency_cleanup_registry.h (+4/-1)
src/include/platform/mir/graphics/egl_extensions.h (+9/-0)
src/include/platform/mir/graphics/egl_sync_fence.h (+82/-0)
src/include/platform/mir/options/configuration.h (+1/-0)
src/include/server/mir/default_server_configuration.h (+15/-42)
src/include/server/mir/frontend/client_buffers.h (+2/-0)
src/include/server/mir/frontend/display_changer.h (+3/-1)
src/include/server/mir/frontend/security_check_failed.h (+34/-0)
src/include/server/mir/frontend/shell.h (+5/-0)
src/include/server/mir/frontend/template_protobuf_message_processor.h (+5/-0)
src/include/server/mir/glib_main_loop.h (+9/-0)
src/include/server/mir/input/input_probe.h (+48/-0)
src/include/server/mir/scene/surface_observers.h (+2/-1)
src/include/server/mir/shell/basic_window_manager.h (+49/-0)
src/include/server/mir/shell/canonical_window_manager.h (+4/-0)
src/platform/CMakeLists.txt (+0/-1)
src/platform/graphics/CMakeLists.txt (+1/-0)
src/platform/graphics/egl_extensions.cpp (+19/-10)
src/platform/graphics/egl_sync_fence.cpp (+93/-0)
src/platform/graphics/platform_probe.cpp (+5/-1)
src/platform/options/default_configuration.cpp (+3/-0)
src/platform/symbols.map (+1/-17)
src/platforms/CMakeLists.txt (+13/-6)
src/platforms/android/client/CMakeLists.txt (+1/-1)
src/platforms/android/client/client_platform_factory.cpp (+3/-0)
src/platforms/android/server/CMakeLists.txt (+3/-1)
src/platforms/android/server/android_buffer_allocator.cpp (+15/-10)
src/platforms/android/server/device_quirks.cpp (+28/-15)
src/platforms/android/server/device_quirks.h (+4/-2)
src/platforms/android/server/display.cpp (+10/-6)
src/platforms/android/server/display_configuration.cpp (+6/-1)
src/platforms/android/server/display_configuration.h (+1/-0)
src/platforms/android/server/display_name.h (+11/-1)
src/platforms/android/server/fb_device.cpp (+1/-1)
src/platforms/android/server/hwc_blanking_control.cpp (+1/-1)
src/platforms/android/server/platform.cpp (+46/-34)
src/platforms/android/server/platform.h (+6/-5)
src/platforms/android/server/real_hwc_wrapper.cpp (+12/-12)
src/platforms/android/server/server_render_window.cpp (+11/-3)
src/platforms/android/server/server_render_window.h (+4/-1)
src/platforms/android/server/symbols.map.in (+1/-1)
src/platforms/common/client/mir/CMakeLists.txt (+1/-1)
src/platforms/evdev/CMakeLists.txt (+2/-3)
src/platforms/evdev/button_utils.cpp (+44/-0)
src/platforms/evdev/button_utils.h (+36/-0)
src/platforms/evdev/evdev_device_detection.cpp (+13/-12)
src/platforms/evdev/libinput_device.cpp (+198/-125)
src/platforms/evdev/libinput_device.h (+14/-9)
src/platforms/evdev/libinput_device_ptr.cpp (+8/-3)
src/platforms/evdev/libinput_device_ptr.h (+10/-2)
src/platforms/evdev/libinput_ptr.cpp (+13/-1)
src/platforms/evdev/platform.cpp (+2/-1)
src/platforms/evdev/platform_factory.cpp (+6/-1)
src/platforms/input_platform_symbols.map.in (+1/-1)
src/platforms/mesa/CMakeLists.txt (+1/-10)
src/platforms/mesa/client/CMakeLists.txt (+1/-1)
src/platforms/mesa/client/client_platform.cpp (+0/-16)
src/platforms/mesa/client/client_platform_factory.cpp (+14/-0)
src/platforms/mesa/mir-client-platform-mesa.pc.in (+0/-7)
src/platforms/mesa/server/kms/CMakeLists.txt (+5/-1)
src/platforms/mesa/server/kms/cursor.cpp (+2/-1)
src/platforms/mesa/server/kms/display.cpp (+32/-26)
src/platforms/mesa/server/kms/display.h (+17/-4)
src/platforms/mesa/server/kms/display_buffer.cpp (+10/-7)
src/platforms/mesa/server/kms/display_buffer.h (+7/-3)
src/platforms/mesa/server/kms/guest_platform.cpp (+11/-19)
src/platforms/mesa/server/kms/guest_platform.h (+4/-5)
src/platforms/mesa/server/kms/linux_virtual_terminal.cpp (+25/-24)
src/platforms/mesa/server/kms/platform.cpp (+29/-198)
src/platforms/mesa/server/kms/platform.h (+5/-6)
src/platforms/mesa/server/kms/platform_symbols.cpp (+215/-0)
src/platforms/mesa/server/kms/real_kms_display_configuration.cpp (+5/-0)
src/platforms/mesa/server/kms/real_kms_display_configuration.h (+1/-0)
src/platforms/mesa/server/kms/symbols.map.in (+1/-1)
src/platforms/mesa/server/x11/CMakeLists.txt (+12/-5)
src/platforms/mesa/server/x11/X11_resources.cpp (+3/-2)
src/platforms/mesa/server/x11/graphics/CMakeLists.txt (+6/-1)
src/platforms/mesa/server/x11/graphics/display.cpp (+1/-1)
src/platforms/mesa/server/x11/graphics/display_configuration.cpp (+12/-0)
src/platforms/mesa/server/x11/graphics/display_configuration.h (+2/-0)
src/platforms/mesa/server/x11/graphics/graphics.cpp (+12/-5)
src/platforms/mesa/server/x11/graphics/guest_platform.cpp (+5/-5)
src/platforms/mesa/server/x11/graphics/guest_platform.h (+4/-4)
src/platforms/mesa/server/x11/graphics/platform.cpp (+6/-6)
src/platforms/mesa/server/x11/graphics/platform.h (+3/-3)
src/platforms/mesa/server/x11/input/CMakeLists.txt (+6/-1)
src/platforms/mesa/server/x11/input/input.cpp (+15/-3)
src/platforms/mesa/server/x11/input/input_device.cpp (+32/-1)
src/platforms/mesa/server/x11/input/input_device.h (+8/-0)
src/platforms/mesa/server/x11/input/input_platform.cpp (+66/-69)
src/platforms/mesa/server/x11/symbols.map.in (+2/-2)
src/protobuf/mir_protobuf.proto (+10/-0)
src/protobuf/symbols.map (+40/-0)
src/renderers/gl/renderer.cpp (+48/-11)
src/server/CMakeLists.txt (+1/-2)
src/server/compositor/buffer_map.cpp (+38/-5)
src/server/compositor/buffer_map.h (+15/-4)
src/server/compositor/buffer_stream_factory.cpp (+18/-6)
src/server/compositor/buffer_stream_surfaces.cpp (+1/-1)
src/server/compositor/dropping_schedule.cpp (+5/-2)
src/server/compositor/dropping_schedule.h (+1/-1)
src/server/compositor/multi_monitor_arbiter.cpp (+23/-7)
src/server/compositor/multi_monitor_arbiter.h (+2/-0)
src/server/compositor/queueing_schedule.cpp (+2/-2)
src/server/compositor/queueing_schedule.h (+1/-1)
src/server/compositor/schedule.h (+1/-1)
src/server/compositor/stream.cpp (+43/-5)
src/server/compositor/stream.h (+17/-1)
src/server/default_emergency_cleanup.cpp (+11/-2)
src/server/default_emergency_cleanup.h (+2/-1)
src/server/default_server_configuration.cpp (+5/-0)
src/server/frontend/CMakeLists.txt (+1/-1)
src/server/frontend/default_configuration.cpp (+9/-13)
src/server/frontend/default_ipc_factory.cpp (+11/-11)
src/server/frontend/default_ipc_factory.h (+7/-1)
src/server/frontend/protobuf_message_processor.cpp (+13/-0)
src/server/frontend/security_check_failed.cpp (+24/-0)
src/server/frontend/session_mediator.cpp (+85/-30)
src/server/frontend/session_mediator.h (+19/-1)
src/server/frontend/shell_wrapper.cpp (+8/-0)
src/server/frontend/shell_wrapper.h (+5/-0)
src/server/frontend/socket_connection.cpp (+3/-1)
src/server/frontend/unauthorized_display_changer.cpp (+31/-6)
src/server/frontend/unauthorized_display_changer.h (+12/-2)
src/server/glib_main_loop.cpp (+34/-0)
src/server/graphics/default_configuration.cpp (+2/-6)
src/server/graphics/nested/display.cpp (+76/-52)
src/server/graphics/nested/display.h (+2/-0)
src/server/graphics/nested/nested_display_configuration.cpp (+29/-0)
src/server/graphics/nested/nested_display_configuration.h (+3/-1)
src/server/graphics/offscreen/display_configuration.cpp (+4/-0)
src/server/graphics/offscreen/display_configuration.h (+1/-0)
src/server/input/CMakeLists.txt (+11/-12)
src/server/input/android/CMakeLists.txt (+0/-5)
src/server/input/android/android_input_reader_policy.cpp (+0/-75)
src/server/input/android/android_input_reader_policy.h (+0/-59)
src/server/input/android/android_input_targeter.h (+0/-67)
src/server/input/android/android_input_thread.h (+0/-47)
src/server/input/android/android_pointer_controller.cpp (+0/-131)
src/server/input/android/android_pointer_controller.h (+0/-71)
src/server/input/android/default_dispatcher_policy.h (+0/-79)
src/server/input/android/dummy_android_pointer_controller.h (+0/-106)
src/server/input/android/input_reader_dispatchable.cpp (+0/-54)
src/server/input/android/input_reader_dispatchable.h (+0/-56)
src/server/input/android/input_translator.cpp (+0/-187)
src/server/input/android/input_translator.h (+0/-56)
src/server/input/android/rudimentary_input_reader_policy.cpp (+0/-51)
src/server/input/android/rudimentary_input_reader_policy.h (+0/-60)
src/server/input/black_arrow.c (+0/-480)
src/server/input/builtin_cursor_images.cpp (+21/-13)
src/server/input/builtin_cursor_images.h (+0/-10)
src/server/input/cursor_controller.cpp (+17/-7)
src/server/input/default-theme.h (+1131/-0)
src/server/input/default_configuration.cpp (+22/-130)
src/server/input/default_device.cpp (+82/-3)
src/server/input/default_device.h (+22/-4)
src/server/input/default_event_builder.cpp (+28/-16)
src/server/input/default_event_builder.h (+13/-9)
src/server/input/default_input_device_hub.cpp (+43/-67)
src/server/input/default_input_device_hub.h (+21/-12)
src/server/input/default_input_manager.cpp (+2/-18)
src/server/input/default_input_manager.h (+1/-4)
src/server/input/input_modifier_utils.cpp (+4/-18)
src/server/input/input_modifier_utils.h (+2/-6)
src/server/input/input_probe.cpp (+104/-0)
src/server/input/key_repeat_dispatcher.cpp (+5/-1)
src/server/input/key_repeat_dispatcher.h (+7/-1)
src/server/input/seat.cpp (+196/-0)
src/server/input/seat.h (+84/-0)
src/server/input/surface_input_dispatcher.cpp (+2/-1)
src/server/input/validator.cpp (+2/-1)
src/server/input/vt_filter.cpp (+16/-6)
src/server/report/default_server_configuration.cpp (+10/-0)
src/server/report/logging/CMakeLists.txt (+4/-1)
src/server/report/logging/logging_report_factory.cpp (+5/-0)
src/server/report/logging/session_mediator_report.cpp (+5/-0)
src/server/report/logging/session_mediator_report.h (+2/-0)
src/server/report/logging/shell_report.cpp (+127/-0)
src/server/report/logging/shell_report.h (+84/-0)
src/server/report/logging_report_factory.h (+1/-0)
src/server/report/lttng/lttng_report_factory.cpp (+4/-1)
src/server/report/lttng/session_mediator_report.cpp (+1/-0)
src/server/report/lttng/session_mediator_report.h (+1/-0)
src/server/report/lttng/session_mediator_report_tp.h (+1/-0)
src/server/report/lttng_report_factory.h (+1/-0)
src/server/report/null/CMakeLists.txt (+3/-1)
src/server/report/null/null_report_factory.cpp (+6/-0)
src/server/report/null/session_mediator_report.cpp (+4/-0)
src/server/report/null/session_mediator_report.h (+2/-0)
src/server/report/null/shell_report.cpp (+90/-0)
src/server/report/null/shell_report.h (+79/-0)
src/server/report/null_report_factory.h (+1/-0)
src/server/report/report_factory.h (+2/-0)
src/server/scene/CMakeLists.txt (+1/-1)
src/server/scene/application_session.cpp (+34/-8)
src/server/scene/application_session.h (+4/-3)
src/server/scene/basic_surface.cpp (+15/-6)
src/server/scene/default_configuration.cpp (+35/-32)
src/server/scene/legacy_surface_change_notification.cpp (+5/-1)
src/server/scene/legacy_surface_change_notification.h (+2/-1)
src/server/scene/mediating_display_changer.cpp (+24/-38)
src/server/scene/mediating_display_changer.h (+3/-3)
src/server/scene/null_surface_observer.cpp (+2/-1)
src/server/scene/output_properties_cache.cpp (+3/-2)
src/server/scene/output_properties_cache.h (+2/-4)
src/server/scene/session_manager.cpp (+4/-4)
src/server/scene/session_manager.h (+5/-3)
src/server/scene/surface_controller.cpp (+0/-62)
src/server/scene/surface_controller.h (+0/-63)
src/server/scene/surface_creation_parameters.cpp (+1/-10)
src/server/scene/surface_event_source.cpp (+3/-1)
src/server/scene/surface_stack.cpp (+83/-109)
src/server/scene/surface_stack.h (+5/-7)
src/server/scene/surface_stack_model.h (+0/-66)
src/server/scene/unsupported_coordinate_translator.cpp (+3/-2)
src/server/scene/unsupported_coordinate_translator.h (+11/-12)
src/server/server.cpp (+27/-19)
src/server/shell/CMakeLists.txt (+4/-1)
src/server/shell/abstract_shell.cpp (+74/-21)
src/server/shell/canonical_window_manager.cpp (+9/-0)
src/server/shell/default_configuration.cpp (+2/-1)
src/server/shell/frontend_shell.cpp (+10/-0)
src/server/shell/frontend_shell.h (+5/-0)
src/server/shell/graphics_display_layout.cpp (+2/-6)
src/server/shell/graphics_display_layout.h (+4/-4)
src/server/shell/shell_wrapper.cpp (+8/-0)
src/server/shell/surface_ready_observer.cpp (+1/-1)
src/server/shell/surface_specification.cpp (+49/-0)
src/server/shell/surface_stack_wrapper.cpp (+57/-0)
src/server/shell/system_compositor_window_manager.cpp (+52/-2)
src/server/symbols.map (+149/-68)
tests/acceptance-tests/CMakeLists.txt (+2/-1)
tests/acceptance-tests/server_configuration_wrapping.cpp (+24/-0)
tests/acceptance-tests/test_buffer_stream_arrangement.cpp (+47/-15)
tests/acceptance-tests/test_client_authorization.cpp (+1/-0)
tests/acceptance-tests/test_client_cookie.cpp (+169/-0)
tests/acceptance-tests/test_client_input.cpp (+1/-5)
tests/acceptance-tests/test_client_library.cpp (+16/-0)
tests/acceptance-tests/test_client_surface_events.cpp (+7/-3)
tests/acceptance-tests/test_client_surface_visibility.cpp (+6/-6)
tests/acceptance-tests/test_custom_window_management.cpp (+18/-3)
tests/acceptance-tests/test_debug_api.cpp (+38/-1)
tests/acceptance-tests/test_display_configuration.cpp (+186/-63)
tests/acceptance-tests/test_latency.cpp (+34/-1)
tests/acceptance-tests/test_nested_mir.cpp (+98/-83)
tests/acceptance-tests/test_session_mediator_report.cpp (+1/-0)
tests/acceptance-tests/test_surface_raise.cpp (+186/-0)
tests/acceptance-tests/test_system_compositor_window_manager.cpp (+1/-1)
tests/acceptance-tests/throwback/test_client_cursor_api.cpp (+2/-3)
tests/acceptance-tests/throwback/test_client_library_errors.cpp (+18/-0)
tests/include/mir/test/doubles/mock_android_input_dispatcher.h (+0/-64)
tests/include/mir/test/doubles/mock_buffer_bundle.h (+3/-1)
tests/include/mir/test/doubles/mock_buffer_stream.h (+2/-0)
tests/include/mir/test/doubles/mock_client_buffer_stream.h (+1/-0)
tests/include/mir/test/doubles/mock_display_changer.h (+12/-3)
tests/include/mir/test/doubles/mock_drm.h (+5/-0)
tests/include/mir/test/doubles/mock_event_handler_register.h (+71/-0)
tests/include/mir/test/doubles/mock_event_hub.h (+0/-70)
tests/include/mir/test/doubles/mock_gl.h (+1/-0)
tests/include/mir/test/doubles/mock_input_reader.h (+0/-58)
tests/include/mir/test/doubles/mock_libinput.h (+2/-0)
tests/include/mir/test/doubles/mock_main_loop.h (+22/-0)
tests/include/mir/test/doubles/mock_option.h (+45/-0)
tests/include/mir/test/doubles/mock_scene_session.h (+1/-0)
tests/include/mir/test/doubles/mock_shell.h (+2/-0)
tests/include/mir/test/doubles/mock_surface_stack.h (+7/-8)
tests/include/mir/test/doubles/mock_x11.h (+6/-4)
tests/include/mir/test/doubles/null_display_changer.h (+10/-3)
tests/include/mir/test/doubles/null_emergency_cleanup.h (+1/-0)
tests/include/mir/test/doubles/platform_factory.h (+0/-46)
tests/include/mir/test/doubles/stub_buffer.h (+12/-0)
tests/include/mir/test/doubles/stub_display_builder.h (+1/-1)
tests/include/mir/test/doubles/stub_display_server.h (+8/-0)
tests/include/mir/test/doubles/stub_legacy_input_dispatchable.h (+0/-52)
tests/include/mir/test/doubles/stub_scene_session.h (+0/-134)
tests/include/mir/test/gmock_fixes.h (+23/-0)
tests/include/mir_test_framework/fake_input_server_configuration.h (+0/-1)
tests/include/mir_test_framework/stubbed_server_configuration.h (+0/-1)
tests/integration-tests/CMakeLists.txt (+2/-4)
tests/integration-tests/client/test_mirsurface.cpp (+1/-1)
tests/integration-tests/graphics/android/test_android_hardware_sanity.cpp (+4/-0)
tests/integration-tests/graphics/mesa/CMakeLists.txt (+75/-71)
tests/integration-tests/graphics/mesa/test_buffer_integration.cpp (+2/-2)
tests/integration-tests/session_management.cpp (+7/-9)
tests/integration-tests/test_buffer_scheduling.cpp (+429/-187)
tests/integration-tests/test_client_screencast.cpp (+1/-1)
tests/integration-tests/test_display_info.cpp (+2/-2)
tests/integration-tests/test_exchange_buffer.cpp (+28/-33)
tests/integration-tests/test_large_messages.cpp (+1/-1)
tests/integration-tests/test_session.cpp (+1/-1)
tests/integration-tests/test_surface_stack_with_compositor.cpp (+7/-7)
tests/integration-tests/test_surfaceloop.cpp (+4/-4)
tests/mir_test/cross_process_sync.cpp (+30/-19)
tests/mir_test/display_config_matchers.cpp (+12/-0)
tests/mir_test_doubles/CMakeLists.txt (+1/-2)
tests/mir_test_doubles/fake_display.cpp (+90/-0)
tests/mir_test_doubles/fake_event_hub.cpp (+0/-793)
tests/mir_test_doubles/mock_drm.cpp (+23/-0)
tests/mir_test_doubles/mock_egl.cpp (+34/-3)
tests/mir_test_doubles/mock_gl.cpp (+7/-0)
tests/mir_test_doubles/mock_libinput.cpp (+10/-0)
tests/mir_test_doubles/mock_x11.cpp (+5/-1)
tests/mir_test_doubles/platform_factory.cpp (+0/-73)
tests/mir_test_framework/CMakeLists.txt (+6/-1)
tests/mir_test_framework/async_server_runner.cpp (+5/-4)
tests/mir_test_framework/connected_client_with_a_surface.cpp (+1/-1)
tests/mir_test_framework/declarative_placement_window_manage_policy.cpp (+1/-7)
tests/mir_test_framework/executable_path.cpp (+10/-0)
tests/mir_test_framework/fake_input_device_impl.cpp (+52/-33)
tests/mir_test_framework/fake_input_device_impl.h (+7/-1)
tests/mir_test_framework/fake_input_server_configuration.cpp (+0/-7)
tests/mir_test_framework/headless_in_process_server.cpp (+2/-0)
tests/mir_test_framework/input_testing_server_options.cpp (+0/-1)
tests/mir_test_framework/placement_applying_shell.cpp (+5/-10)
tests/mir_test_framework/platform_graphics_dummy.cpp (+3/-0)
tests/mir_test_framework/server_runner.cpp (+24/-16)
tests/mir_test_framework/stub_input.cpp (+7/-2)
tests/mir_test_framework/stub_input_platform.cpp (+1/-1)
tests/mir_test_framework/stub_session.cpp (+144/-0)
tests/mir_test_framework/stub_surface.cpp (+206/-0)
tests/mir_test_framework/stubbed_graphics_platform.cpp (+72/-18)
tests/mir_test_framework/stubbed_graphics_platform.h (+5/-5)
tests/mir_test_framework/stubbed_server_configuration.cpp (+0/-11)
tests/mir_test_framework/symbols-server.map.in (+1/-1)
tests/mir_test_framework/udev_recordings/laptop-keyboard-hello.evemu (+5/-81)
tests/mir_test_framework/udev_recordings/laptop-mouse-click.evemu (+136/-0)
tests/mir_test_framework/udev_recordings/laptop-mouse-motion.evemu (+153/-0)
tests/mir_test_framework/udev_recordings/laptop-mouse.ioctl (+22/-0)
tests/mir_test_framework/udev_recordings/laptop-mouse.umockdev (+128/-0)
tests/performance-tests/test_glmark2-es2-mir.cpp (+0/-9)
tests/umock-acceptance-tests/CMakeLists.txt (+1/-0)
tests/umock-acceptance-tests/test_libinput.cpp (+8/-14)
tests/unit-tests/CMakeLists.txt (+16/-35)
tests/unit-tests/android_input/CMakeLists.txt (+0/-3)
tests/unit-tests/android_input/input_reader.cpp (+0/-4814)
tests/unit-tests/android_input/sha1.cpp (+0/-46)
tests/unit-tests/android_input/test_eventhub.cpp (+0/-178)
tests/unit-tests/client/android/CMakeLists.txt (+0/-1)
tests/unit-tests/client/input/test_android_input_receiver.cpp (+4/-46)
tests/unit-tests/client/mesa/CMakeLists.txt (+0/-1)
tests/unit-tests/client/test_buffer_vault.cpp (+15/-15)
tests/unit-tests/client/test_client_buffer_stream.cpp (+160/-20)
tests/unit-tests/client/test_client_display_conf.cpp (+2/-2)
tests/unit-tests/client/test_client_platform.cpp (+1/-1)
tests/unit-tests/client/test_probing_client_platform_factory.cpp (+1/-1)
tests/unit-tests/compositor/test_client_buffers.cpp (+53/-0)
tests/unit-tests/compositor/test_dropping_schedule.cpp (+4/-2)
tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp (+36/-2)
tests/unit-tests/compositor/test_queueing_schedule.cpp (+5/-5)
tests/unit-tests/compositor/test_stream.cpp (+127/-9)
tests/unit-tests/dispatch/test_threaded_dispatcher.cpp (+17/-3)
tests/unit-tests/frontend/test_session_mediator.cpp (+156/-53)
tests/unit-tests/frontend/test_unauthorized_display_changer.cpp (+41/-18)
tests/unit-tests/graphics/CMakeLists.txt (+1/-2)
tests/unit-tests/graphics/android/CMakeLists.txt (+2/-0)
tests/unit-tests/graphics/android/test_device_detection.cpp (+85/-9)
tests/unit-tests/graphics/android/test_display.cpp (+26/-18)
tests/unit-tests/graphics/android/test_display_generic.cpp (+75/-0)
tests/unit-tests/graphics/android/test_graphics_platform.cpp (+65/-0)
tests/unit-tests/graphics/android/test_platform.cpp (+9/-4)
tests/unit-tests/graphics/android/test_server_interpreter.cpp (+51/-1)
tests/unit-tests/graphics/mesa/CMakeLists.txt (+2/-2)
tests/unit-tests/graphics/mesa/kms/CMakeLists.txt (+23/-6)
tests/unit-tests/graphics/mesa/kms/test_buffer_allocator.cpp (+10/-4)
tests/unit-tests/graphics/mesa/kms/test_cursor.cpp (+60/-31)
tests/unit-tests/graphics/mesa/kms/test_display.cpp (+31/-28)
tests/unit-tests/graphics/mesa/kms/test_display_buffer.cpp (+69/-29)
tests/unit-tests/graphics/mesa/kms/test_display_configuration.cpp (+8/-2)
tests/unit-tests/graphics/mesa/kms/test_display_generic.cpp (+82/-0)
tests/unit-tests/graphics/mesa/kms/test_display_multi_monitor.cpp (+13/-4)
tests/unit-tests/graphics/mesa/kms/test_gbm_buffer.cpp (+9/-3)
tests/unit-tests/graphics/mesa/kms/test_graphics_platform.cpp (+86/-0)
tests/unit-tests/graphics/mesa/kms/test_linux_virtual_terminal.cpp (+4/-19)
tests/unit-tests/graphics/mesa/kms/test_platform.cpp (+23/-15)
tests/unit-tests/graphics/mesa/x11/CMakeLists.txt (+23/-4)
tests/unit-tests/graphics/mesa/x11/test_display_generic.cpp (+122/-0)
tests/unit-tests/graphics/mesa/x11/test_graphics_platform.cpp (+89/-0)
tests/unit-tests/graphics/mesa/x11/test_platform.cpp (+8/-4)
tests/unit-tests/graphics/nested/test_nested_cursor.cpp (+1/-1)
tests/unit-tests/graphics/nested/test_nested_display_configuration.cpp (+35/-0)
tests/unit-tests/graphics/test_default_display_configuration_policy.cpp (+31/-61)
tests/unit-tests/graphics/test_display.cpp (+0/-265)
tests/unit-tests/graphics/test_display.h (+185/-0)
tests/unit-tests/graphics/test_egl_extensions.cpp (+40/-10)
tests/unit-tests/graphics/test_egl_sync_fence.cpp (+151/-0)
tests/unit-tests/graphics/test_graphics_platform.cpp (+0/-139)
tests/unit-tests/graphics/test_graphics_platform.h (+64/-0)
tests/unit-tests/graphics/test_overlapping_output_grouping.cpp (+5/-0)
tests/unit-tests/graphics/test_platform_prober.cpp (+14/-5)
tests/unit-tests/input/CMakeLists.txt (+8/-3)
tests/unit-tests/input/android/CMakeLists.txt (+0/-4)
tests/unit-tests/input/android/test_android_input_lexicon.cpp (+4/-0)
tests/unit-tests/input/android/test_android_input_reader_policy.cpp (+0/-79)
tests/unit-tests/input/android/test_android_pointer_controller.cpp (+0/-129)
tests/unit-tests/input/android/test_input_reader_dispatchable.cpp (+0/-51)
tests/unit-tests/input/android/test_input_translator.cpp (+0/-362)
tests/unit-tests/input/evdev/test_evdev_device_detection.cpp (+2/-2)
tests/unit-tests/input/evdev/test_libinput_device.cpp (+606/-268)
tests/unit-tests/input/test_cursor_controller.cpp (+54/-28)
tests/unit-tests/input/test_default_device.cpp (+135/-0)
tests/unit-tests/input/test_default_input_device_hub.cpp (+300/-50)
tests/unit-tests/input/test_default_input_manager.cpp (+1/-39)
tests/unit-tests/input/test_event_builders.cpp (+6/-1)
tests/unit-tests/input/test_input_platform_probing.cpp (+173/-0)
tests/unit-tests/input/test_key_repeat_dispatcher.cpp (+3/-1)
tests/unit-tests/input/test_x11_module.cpp (+81/-0)
tests/unit-tests/input/test_x11_platform.cpp (+37/-1)
tests/unit-tests/input/test_xcursor_loader.cpp (+3/-2)
tests/unit-tests/renderers/gl/test_gl_renderer.cpp (+47/-0)
tests/unit-tests/scene/CMakeLists.txt (+0/-1)
tests/unit-tests/scene/test_abstract_shell.cpp (+124/-13)
tests/unit-tests/scene/test_application_session.cpp (+38/-30)
tests/unit-tests/scene/test_basic_surface.cpp (+59/-0)
tests/unit-tests/scene/test_broadcasting_session_event_sink.cpp (+4/-4)
tests/unit-tests/scene/test_legacy_scene_change_notification.cpp (+1/-1)
tests/unit-tests/scene/test_mediating_display_changer.cpp (+70/-26)
tests/unit-tests/scene/test_prompt_session_manager.cpp (+5/-5)
tests/unit-tests/scene/test_session_manager.cpp (+8/-8)
tests/unit-tests/scene/test_surface_controller.cpp (+0/-103)
tests/unit-tests/scene/test_surface_stack.cpp (+126/-95)
tests/unit-tests/scene/test_the_session_container_implementation.cpp (+7/-7)
tests/unit-tests/test_glib_main_loop.cpp (+46/-0)
tests/unit-tests/test_mir_cookie.cpp (+1/-14)
tools/CMakeLists.txt (+0/-1)
tools/setup-partial-armhf-chroot.sh (+9/-11)
tools/valgrind_suppressions_generic (+16/-5)
tools/vera++/CMakeLists.txt (+0/-17)
tools/vera++/LICENSE_1_0.txt (+0/-23)
tools/vera++/profiles/mir_vera_profile (+0/-23)
tools/vera++/scripts/rules/DUMP.tcl (+0/-13)
tools/vera++/scripts/rules/F001.tcl (+0/-18)
tools/vera++/scripts/rules/F002.tcl (+0/-56)
tools/vera++/scripts/rules/L001.tcl (+0/-20)
tools/vera++/scripts/rules/L002.tcl (+0/-14)
tools/vera++/scripts/rules/L003.tcl (+0/-17)
tools/vera++/scripts/rules/L004.tcl (+0/-14)
tools/vera++/scripts/rules/L005.tcl (+0/-22)
tools/vera++/scripts/rules/L006.tcl (+0/-11)
tools/vera++/scripts/rules/MIR001.tcl (+0/-46)
tools/vera++/scripts/rules/T001.tcl (+0/-13)
tools/vera++/scripts/rules/T002.tcl (+0/-99)
tools/vera++/scripts/rules/T003.tcl (+0/-47)
tools/vera++/scripts/rules/T004.tcl (+0/-51)
tools/vera++/scripts/rules/T005.tcl (+0/-19)
tools/vera++/scripts/rules/T006.tcl (+0/-19)
tools/vera++/scripts/rules/T007.tcl (+0/-22)
tools/vera++/scripts/rules/T008.tcl (+0/-18)
tools/vera++/scripts/rules/T009.tcl (+0/-26)
tools/vera++/scripts/rules/T010.tcl (+0/-11)
tools/vera++/scripts/rules/T011.tcl (+0/-51)
tools/vera++/scripts/rules/T012.tcl (+0/-12)
tools/vera++/scripts/rules/T013.tcl (+0/-16)
tools/vera++/scripts/rules/T014.tcl (+0/-16)
tools/vera++/scripts/rules/T015.tcl (+0/-49)
tools/vera++/scripts/rules/T016.tcl (+0/-17)
tools/vera++/scripts/rules/T017.tcl (+0/-23)
tools/vera++/scripts/rules/T018.tcl (+0/-23)
tools/vera++/scripts/rules/T019.tcl (+0/-32)
To merge this branch: bzr merge lp:mir/0.18
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Daniel van Vugt Abstain
Alberto Aguirre (community) Abstain
Review via email: mp+279111@code.launchpad.net

Commit message

Mir release 0.18.0

Description of the change

.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Needs fixing: r3171 appears to have introduced things that should not be here:
  * Shipping both .pc files was a temporary fix for series 0.17 which we agreed would not happen in 0.18; and
  * Duplicate code accidentally introduced in surface_stack.cpp.

I think you need to revert r3171 and fix conflicts a different way.

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also needs fixing: bug 1522673

review: Needs Fixing
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

mirclient symbol stanza should not have MIR_CLIENT_unreleased, MIR_CLIENT_DETAIL_unreleased

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm no longer aware of anything wrong with this branch. Although there are some sanity checks I haven't got around to yet.

review: Abstain
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Hmm, it seems the new input code in 0.18 might be causing a lot of the new test failures, not to mention is annoying to use in practice (mouse acceleration too high). Maybe we should consider fixing that up before releasing...

https://bugs.launchpad.net/mir/+bugs?field.tag=pointer-events

It's possible that simply killing the acceleration that's been introduced will solve all of them at once.

review: Needs Information
Revision history for this message
Kevin DuBois (kdub) wrote :

I guess the critical question here is whether we should block release. I'm not very familiar with this part of the code, but from chatting with Andreas on IRC today, it seems like:

The linked test failures should be using the stub input platform, so they're not related to the libinput switchover.

The pointer acceleration topic (lp: #1522295) seems like something to look into, but it hasn't affected release testing, and the pointer acceleration is also something needed by PocketDesktop.

This is a judgement call (and one from someone not very entrenched in the input code at that), but it doesn't seem like this should block the release.

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

> Hmm, it seems the new input code in 0.18 might be causing a lot of the new
> test failures, not to mention is annoying to use in practice (mouse
> acceleration too high). Maybe we should consider fixing that up before
> releasing...

I suggest we analyse the test failures. Those are btw not related to libinput or pointer acceleration. Since those test cases use the input-stub to simulate input events. This is the case for a few of releases. Acceleration or rather device configuration on input-stub can be tested, but the acceleration is disabled by default. The code used there just scales relative movement with a single factor which is 1.0 by default. So the cause for the failure might be somewhere else.

>
> https://bugs.launchpad.net/mir/+bugs?field.tag=pointer-events
>
> It's possible that simply killing the acceleration that's been introduced will
> solve all of them at once.

And that would reopen:
https://bugs.launchpad.net/mir/+bug/1517133

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Ok unblocking since symbol stanza has been fixed

review: Abstain
Revision history for this message
Kevin DuBois (kdub) wrote :

Blocking bug discovered during MX4 testing:
http://bugs.launchpad.net/mir/+bug/1524414

Revision history for this message
kevin gunn (kgunn72) wrote :

Complete testing on PD and windowed mode - all is good.
I'm definitely not in favor of blocking on mouse accel.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's just a matter of usability. Mir up to version 0.17 is nice to use with a mouse. Mir 0.18 and later however (presently) is awful. So if it motivates people to not like it, that can become an issue.

review: Abstain
Revision history for this message
Kevin DuBois (kdub) wrote :

> Blocking bug discovered during MX4 testing:
> http://bugs.launchpad.net/mir/+bug/1524414

Bug was that the driver will reset the depth buffer when adding sync fences to the stream. Reverting patch, until palatable workaround is found.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

In r3180 you forgot to rename/move egl_extensions.h back to the old location. Do we care?

Also: https://code.launchpad.net/~kdub/mir/revert-sync-factory/+merge/280293

review: Needs Information
Revision history for this message
Kevin DuBois (kdub) wrote :

I suppose it should be reprivatized for now.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please check bug 1526209. Seems to be new and only occur in Mir 0.18 and later.

review: Needs Fixing
Revision history for this message
Kevin DuBois (kdub) wrote :

Did a bit of checking this morning. The bug didn't seem to be reproducible on Alan's, Andreas's, Alberto's, Cemil's, and my system, once the environment variables, packages, and --vt accommodation was set up properly. After some discussion in the standup today, it seems we aren't considering 1526209 a blocker.

Revision history for this message
Kevin DuBois (kdub) wrote :

So, 1526209 doesn't seem to be a blocker in and of itself, but there is an additional blocker that the desktop session isn't starting due to confusion surrounding this option behavior changes. Branch is now blocked again

lp:mir/0.18 updated
3182. By Kevin DuBois

revert changes to vt option passing. reverts rev 3098, and fixes u8 desktop session (lp: #1526505)

Revision history for this message
Kevin DuBois (kdub) wrote :

after a fair amount of back and forth/testing, back out rev 3098 to get the u8 stack working again (fix lp: #1526505). We weren't able to reproduce lp: #1526209, but backing this out will hopefully avert/fix that problem too.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Abstain
lp:mir/0.18 updated
3183. By Kevin DuBois

readd fix and regressions introduced in 3098

3184. By Kevin DuBois

merge in lp:~andreas-pokorny/mir/bandaid-probing-kms-when-nested, which hopefully leaves the fix for 1506707 without reintroducing the regressions

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

seems to work fine..

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/CMakeLists.txt'
2--- 3rd_party/CMakeLists.txt 2015-06-17 05:20:42 +0000
3+++ 3rd_party/CMakeLists.txt 2015-12-16 17:01:34 +0000
4@@ -21,11 +21,3 @@
5 MIR_ANDROID_INPUT_COMPILE_FLAGS
6 ${MIR_ANDROID_INPUT_COMPILE_FLAGS}
7 PARENT_SCOPE)
8-
9-add_subdirectory(xcursor)
10-list(
11- APPEND MIR_XCURSOR_INCLUDE_DIRECTORIES
12- ${CMAKE_CURRENT_SOURCE_DIR}/xcursor/
13-)
14-
15-set(MIR_XCURSOR_INCLUDE_DIRECTORIES ${MIR_XCURSOR_INCLUDE_DIRECTORIES} PARENT_SCOPE)
16
17=== modified file '3rd_party/android-input/CMakeLists.txt'
18--- 3rd_party/android-input/CMakeLists.txt 2015-02-22 07:46:25 +0000
19+++ 3rd_party/android-input/CMakeLists.txt 2015-12-16 17:01:34 +0000
20@@ -24,6 +24,6 @@
21 ${CMAKE_CURRENT_SOURCE_DIR}/android/hardware/libhardware_legacy/include
22 ${CMAKE_CURRENT_SOURCE_DIR}/android/system/core/include
23 ${CMAKE_CURRENT_SOURCE_DIR}/android/system/extras/ext4_utils
24- ${CMAKE_CURRENT_SOURCE_DIR}/android/external/kernel-headers/original
25+ ${CMAKE_CURRENT_SOURCE_DIR}/android/external/kernel-headers
26 )
27 set(MIR_ANDROID_INCLUDE_DIRECTORIES ${MIR_ANDROID_INCLUDE_DIRECTORIES} PARENT_SCOPE)
28
29=== modified file '3rd_party/android-input/android/CMakeLists.txt'
30--- 3rd_party/android-input/android/CMakeLists.txt 2015-08-19 02:03:51 +0000
31+++ 3rd_party/android-input/android/CMakeLists.txt 2015-12-16 17:01:34 +0000
32@@ -1,5 +1,5 @@
33 include_directories(
34- external/kernel-headers/original
35+ external/kernel-headers
36 frameworks/base/include
37 frameworks/native/include
38 hardware/libhardware_legacy/include
39@@ -23,30 +23,8 @@
40 frameworks/native/libs/utils/Timers.cpp # used by KeyCharacterMap.cpp, InputReader.cpp, InputDispatcher.cpp, Looper.cpp
41 )
42
43-add_library(android-input-platform OBJECT
44- frameworks/base/services/input/EventHub.cpp
45- frameworks/base/services/input/InputDevice.cpp
46- frameworks/base/services/input/InputListener.cpp
47- frameworks/base/services/input/InputReader.cpp
48- frameworks/base/services/input/GenericKeyMap.cpp
49- frameworks/base/services/input/Keyboard.cpp
50- frameworks/base/services/input/KeyCharacterMap.cpp
51- frameworks/base/services/input/KeyLayoutMap.cpp
52- frameworks/native/libs/utils/Tokenizer.cpp
53- frameworks/base/services/input/VelocityControl.cpp
54- frameworks/base/services/input/VelocityTracker.cpp
55- frameworks/base/services/input/VirtualKeyMap.cpp
56- frameworks/native/libs/utils/FileMap.cpp
57-)
58-
59 set_target_properties(
60 android-input-common
61 PROPERTIES
62 COMPILE_FLAGS ${ANDROID_INPUT_COMPILE_FLAGS}
63 )
64-
65-set_target_properties(
66- android-input-platform
67- PROPERTIES
68- COMPILE_FLAGS ${ANDROID_INPUT_COMPILE_FLAGS}
69-)
70
71=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/InputDevice.h'
72--- 3rd_party/android-input/android/frameworks/base/include/androidfw/InputDevice.h 2013-05-03 16:38:07 +0000
73+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/InputDevice.h 1970-01-01 00:00:00 +0000
74@@ -1,156 +0,0 @@
75-/*
76- * Copyright (C) 2012 The Android Open Source Project
77- *
78- * Licensed under the Apache License, Version 2.0 (the "License");
79- * you may not use this file except in compliance with the License.
80- * You may obtain a copy of the License at
81- *
82- * http://www.apache.org/licenses/LICENSE-2.0
83- *
84- * Unless required by applicable law or agreed to in writing, software
85- * distributed under the License is distributed on an "AS IS" BASIS,
86- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87- * See the License for the specific language governing permissions and
88- * limitations under the License.
89- */
90-
91-#ifndef _ANDROIDFW_INPUT_DEVICE_H
92-#define _ANDROIDFW_INPUT_DEVICE_H
93-
94-
95-#include <androidfw/Input.h>
96-#include <androidfw/KeyCharacterMap.h>
97-
98-namespace android {
99-
100-/*
101- * Identifies a device.
102- */
103-struct InputDeviceIdentifier {
104- inline InputDeviceIdentifier() :
105- bus(0), vendor(0), product(0), version(0) {
106- }
107-
108- // Information provided by the kernel.
109- String8 name;
110- String8 location;
111- String8 uniqueId;
112- uint16_t bus;
113- uint16_t vendor;
114- uint16_t product;
115- uint16_t version;
116-
117- // A composite input device descriptor string that uniquely identifies the device
118- // even across reboots or reconnections. The value of this field is used by
119- // upper layers of the input system to associate settings with individual devices.
120- // It is hashed from whatever kernel provided information is available.
121- // Ideally, the way this value is computed should not change between Android releases
122- // because that would invalidate persistent settings that rely on it.
123- String8 descriptor;
124-};
125-
126-/*
127- * Describes the characteristics and capabilities of an input device.
128- */
129-class InputDeviceInfo {
130-public:
131- InputDeviceInfo();
132- InputDeviceInfo(const InputDeviceInfo& other);
133- ~InputDeviceInfo();
134-
135- struct MotionRange {
136- int32_t axis;
137- uint32_t source;
138- float min;
139- float max;
140- float flat;
141- float fuzz;
142- };
143-
144- void initialize(int32_t id, int32_t generation, const InputDeviceIdentifier& identifier,
145- const String8& alias, bool isExternal);
146-
147- inline int32_t getId() const { return mId; }
148- inline int32_t getGeneration() const { return mGeneration; }
149- inline const InputDeviceIdentifier& getIdentifier() const { return mIdentifier; }
150- inline const String8& getAlias() const { return mAlias; }
151- inline const String8& getDisplayName() const {
152- return isEmpty(mAlias) ? mIdentifier.name : mAlias;
153- }
154- inline bool isExternal() const { return mIsExternal; }
155- inline uint32_t getSources() const { return mSources; }
156-
157- const MotionRange* getMotionRange(int32_t axis, uint32_t source) const;
158-
159- void addSource(uint32_t source);
160- void addMotionRange(int32_t axis, uint32_t source,
161- float min, float max, float flat, float fuzz);
162- void addMotionRange(const MotionRange& range);
163-
164- inline void setKeyboardType(int32_t keyboardType) { mKeyboardType = keyboardType; }
165- inline int32_t getKeyboardType() const { return mKeyboardType; }
166-
167- inline void setKeyCharacterMap(const sp<KeyCharacterMap>& value) {
168- mKeyCharacterMap = value;
169- }
170-
171- inline sp<KeyCharacterMap> getKeyCharacterMap() const {
172- return mKeyCharacterMap;
173- }
174-
175- inline void setVibrator(bool hasVibrator) { mHasVibrator = hasVibrator; }
176- inline bool hasVibrator() const { return mHasVibrator; }
177-
178- inline const Vector<MotionRange>& getMotionRanges() const {
179- return mMotionRanges;
180- }
181-
182-private:
183- int32_t mId;
184- int32_t mGeneration;
185- InputDeviceIdentifier mIdentifier;
186- String8 mAlias;
187- bool mIsExternal;
188- uint32_t mSources;
189- int32_t mKeyboardType;
190- sp<KeyCharacterMap> mKeyCharacterMap;
191- bool mHasVibrator;
192-
193- Vector<MotionRange> mMotionRanges;
194-};
195-
196-/* Types of input device configuration files. */
197-enum InputDeviceConfigurationFileType {
198- INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION = 0, /* .idc file */
199- INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_LAYOUT = 1, /* .kl file */
200- INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_CHARACTER_MAP = 2 /* .kcm file */
201-};
202-
203-/*
204- * Gets the path of an input device configuration file, if one is available.
205- * Considers both system provided and user installed configuration files.
206- *
207- * The device identifier is used to construct several default configuration file
208- * names to try based on the device name, vendor, product, and version.
209- *
210- * Returns an empty string if not found.
211- */
212-extern String8 getInputDeviceConfigurationFilePathByDeviceIdentifier(
213- const InputDeviceIdentifier& deviceIdentifier,
214- InputDeviceConfigurationFileType type);
215-
216-/*
217- * Gets the path of an input device configuration file, if one is available.
218- * Considers both system provided and user installed configuration files.
219- *
220- * The name is case-sensitive and is used to construct the filename to resolve.
221- * All characters except 'a'-'z', 'A'-'Z', '0'-'9', '-', and '_' are replaced by underscores.
222- *
223- * Returns an empty string if not found.
224- */
225-extern String8 getInputDeviceConfigurationFilePathByName(
226- const String8& name, InputDeviceConfigurationFileType type);
227-
228-} // namespace android
229-
230-#endif // _ANDROIDFW_INPUT_DEVICE_H
231
232=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h'
233--- 3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h 2015-04-28 07:54:10 +0000
234+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h 1970-01-01 00:00:00 +0000
235@@ -1,255 +0,0 @@
236-/*
237- * Copyright (C) 2008 The Android Open Source Project
238- *
239- * Licensed under the Apache License, Version 2.0 (the "License");
240- * you may not use this file except in compliance with the License.
241- * You may obtain a copy of the License at
242- *
243- * http://www.apache.org/licenses/LICENSE-2.0
244- *
245- * Unless required by applicable law or agreed to in writing, software
246- * distributed under the License is distributed on an "AS IS" BASIS,
247- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
248- * See the License for the specific language governing permissions and
249- * limitations under the License.
250- */
251-
252-#ifndef _ANDROIDFW_KEY_CHARACTER_MAP_H
253-#define _ANDROIDFW_KEY_CHARACTER_MAP_H
254-
255-
256-#include <stdint.h>
257-
258-#if HAVE_ANDROID_OS
259-#include <binder/IBinder.h>
260-#endif
261-
262-#include <androidfw/Input.h>
263-#include <std/Errors.h>
264-#include <std/KeyedVector.h>
265-#include <std/Tokenizer.h>
266-#include <std/String8.h>
267-#include <std/RefBase.h>
268-
269-namespace android {
270-
271-/**
272- * Describes a mapping from Android key codes to characters.
273- * Also specifies other functions of the keyboard such as the keyboard type
274- * and key modifier semantics.
275- *
276- * This object is immutable after it has been loaded.
277- */
278-class KeyCharacterMap : public RefBase {
279-public:
280- enum KeyboardType {
281- KEYBOARD_TYPE_UNKNOWN = 0,
282- KEYBOARD_TYPE_NUMERIC = 1,
283- KEYBOARD_TYPE_PREDICTIVE = 2,
284- KEYBOARD_TYPE_ALPHA = 3,
285- KEYBOARD_TYPE_FULL = 4,
286- KEYBOARD_TYPE_SPECIAL_FUNCTION = 5,
287- KEYBOARD_TYPE_OVERLAY = 6
288- };
289-
290- enum Format {
291- // Base keyboard layout, may contain device-specific options, such as "type" declaration.
292- FORMAT_BASE = 0,
293- // Overlay keyboard layout, more restrictive, may be published by applications,
294- // cannot override device-specific options.
295- FORMAT_OVERLAY = 1,
296- // Either base or overlay layout ok.
297- FORMAT_ANY = 2
298- };
299-
300- // Substitute key code and meta state for fallback action.
301- struct FallbackAction {
302- int32_t keyCode;
303- int32_t metaState;
304- };
305-
306- /* Loads a key character map from a file. */
307- static status_t load(const String8& filename, Format format, sp<KeyCharacterMap>* outMap);
308-
309- /* Loads a key character map from its string contents. */
310- static status_t loadContents(const String8& filename,
311- const char* contents, Format format, sp<KeyCharacterMap>* outMap);
312-
313- /* Combines a base key character map and an overlay. */
314- static sp<KeyCharacterMap> combine(const sp<KeyCharacterMap>& base,
315- const sp<KeyCharacterMap>& overlay);
316-
317- /* Returns an empty key character map. */
318- static sp<KeyCharacterMap> empty();
319-
320- /* Gets the keyboard type. */
321- int32_t getKeyboardType() const;
322-
323- /* Gets the primary character for this key as in the label physically printed on it.
324- * Returns 0 if none (eg. for non-printing keys). */
325- char16_t getDisplayLabel(int32_t keyCode) const;
326-
327- /* Gets the Unicode character for the number or symbol generated by the key
328- * when the keyboard is used as a dialing pad.
329- * Returns 0 if no number or symbol is generated.
330- */
331- char16_t getNumber(int32_t keyCode) const;
332-
333- /* Gets the Unicode character generated by the key and meta key modifiers.
334- * Returns 0 if no character is generated.
335- */
336- char16_t getCharacter(int32_t keyCode, int32_t metaState) const;
337-
338- /* Gets the fallback action to use by default if the application does not
339- * handle the specified key.
340- * Returns true if an action was available, false if none.
341- */
342- bool getFallbackAction(int32_t keyCode, int32_t metaState,
343- FallbackAction* outFallbackAction) const;
344-
345- /* Gets the first matching Unicode character that can be generated by the key,
346- * preferring the one with the specified meta key modifiers.
347- * Returns 0 if no matching character is generated.
348- */
349- char16_t getMatch(int32_t keyCode, const char16_t* chars,
350- size_t numChars, int32_t metaState) const;
351-
352- /* Gets a sequence of key events that could plausibly generate the specified
353- * character sequence. Returns false if some of the characters cannot be generated.
354- */
355- bool getEvents(int32_t deviceId, const char16_t* chars, size_t numChars,
356- Vector<KeyEvent>& outEvents) const;
357-
358- /* Maps a scan code and usage code to a key code, in case this key map overrides
359- * the mapping in some way. */
360- status_t mapKey(int32_t scanCode, int32_t usageCode, int32_t* outKeyCode) const;
361-
362-#if HAVE_ANDROID_OS
363- /* Reads a key map from a parcel. */
364- static sp<KeyCharacterMap> readFromParcel(Parcel* parcel);
365-
366- /* Writes a key map to a parcel. */
367- void writeToParcel(Parcel* parcel) const;
368-#endif
369-
370-protected:
371- virtual ~KeyCharacterMap();
372-
373-private:
374- struct Behavior {
375- Behavior();
376- Behavior(const Behavior& other);
377-
378- /* The next behavior in the list, or NULL if none. */
379- Behavior* next;
380-
381- /* The meta key modifiers for this behavior. */
382- int32_t metaState;
383-
384- /* The character to insert. */
385- char16_t character;
386-
387- /* The fallback keycode if the key is not handled. */
388- int32_t fallbackKeyCode;
389- };
390-
391- struct Key {
392- Key();
393- Key(const Key& other);
394- ~Key();
395-
396- /* The single character label printed on the key, or 0 if none. */
397- char16_t label;
398-
399- /* The number or symbol character generated by the key, or 0 if none. */
400- char16_t number;
401-
402- /* The list of key behaviors sorted from most specific to least specific
403- * meta key binding. */
404- Behavior* firstBehavior;
405- };
406-
407- class Parser {
408- enum State {
409- STATE_TOP = 0,
410- STATE_KEY = 1
411- };
412-
413- enum {
414- PROPERTY_LABEL = 1,
415- PROPERTY_NUMBER = 2,
416- PROPERTY_META = 3
417- };
418-
419- struct Property {
420- inline Property(int32_t property = 0, int32_t metaState = 0) :
421- property(property), metaState(metaState) { }
422-
423- int32_t property;
424- int32_t metaState;
425- };
426-
427- KeyCharacterMap* mMap;
428- Tokenizer* mTokenizer;
429- Format mFormat;
430- State mState;
431- int32_t mKeyCode;
432-
433- public:
434- Parser(KeyCharacterMap* map, Tokenizer* tokenizer, Format format);
435- ~Parser();
436- status_t parse();
437-
438- private:
439- status_t parseType();
440- status_t parseMap();
441- status_t parseMapKey();
442- status_t parseKey();
443- status_t parseKeyProperty();
444- status_t finishKey(Key* key);
445- status_t parseModifier(const String8& token, int32_t* outMetaState);
446- status_t parseCharacterLiteral(char16_t* outCharacter);
447- };
448-
449- KeyedVector<int32_t, Key*> mKeys;
450- int mType;
451-
452- KeyedVector<int32_t, int32_t> mKeysByScanCode;
453- KeyedVector<int32_t, int32_t> mKeysByUsageCode;
454-
455- KeyCharacterMap();
456- KeyCharacterMap(const KeyCharacterMap& other);
457-
458- bool getKey(int32_t keyCode, const Key** outKey) const;
459- bool getKeyBehavior(int32_t keyCode, int32_t metaState,
460- const Key** outKey, const Behavior** outBehavior) const;
461- static bool matchesMetaState(int32_t eventMetaState, int32_t behaviorMetaState);
462-
463- bool findKey(char16_t ch, int32_t* outKeyCode, int32_t* outMetaState) const;
464-
465- static status_t load(Tokenizer* tokenizer, Format format, sp<KeyCharacterMap>* outMap);
466-
467- static void addKey(Vector<KeyEvent>& outEvents,
468- int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, std::chrono::nanoseconds time);
469- static void addMetaKeys(Vector<KeyEvent>& outEvents,
470- int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
471- int32_t* currentMetaState);
472- static bool addSingleEphemeralMetaKey(Vector<KeyEvent>& outEvents,
473- int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
474- int32_t keyCode, int32_t keyMetaState,
475- int32_t* currentMetaState);
476- static void addDoubleEphemeralMetaKey(Vector<KeyEvent>& outEvents,
477- int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
478- int32_t leftKeyCode, int32_t leftKeyMetaState,
479- int32_t rightKeyCode, int32_t rightKeyMetaState,
480- int32_t eitherKeyMetaState,
481- int32_t* currentMetaState);
482- static void addLockedMetaKey(Vector<KeyEvent>& outEvents,
483- int32_t deviceId, int32_t metaState, std::chrono::nanoseconds time,
484- int32_t keyCode, int32_t keyMetaState,
485- int32_t* currentMetaState);
486-};
487-
488-} // namespace android
489-
490-#endif // _ANDROIDFW_KEY_CHARACTER_MAP_H
491
492=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/KeyLayoutMap.h'
493--- 3rd_party/android-input/android/frameworks/base/include/androidfw/KeyLayoutMap.h 2013-05-03 16:38:07 +0000
494+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/KeyLayoutMap.h 1970-01-01 00:00:00 +0000
495@@ -1,114 +0,0 @@
496-/*
497- * Copyright (C) 2008 The Android Open Source Project
498- *
499- * Licensed under the Apache License, Version 2.0 (the "License");
500- * you may not use this file except in compliance with the License.
501- * You may obtain a copy of the License at
502- *
503- * http://www.apache.org/licenses/LICENSE-2.0
504- *
505- * Unless required by applicable law or agreed to in writing, software
506- * distributed under the License is distributed on an "AS IS" BASIS,
507- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
508- * See the License for the specific language governing permissions and
509- * limitations under the License.
510- */
511-
512-#ifndef _ANDROIDFW_KEY_LAYOUT_MAP_H
513-#define _ANDROIDFW_KEY_LAYOUT_MAP_H
514-
515-
516-#include <stdint.h>
517-#include <std/Errors.h>
518-#include <std/KeyedVector.h>
519-#include <std/Tokenizer.h>
520-#include <std/RefBase.h>
521-
522-namespace android {
523-
524-struct AxisInfo {
525- enum Mode {
526- // Axis value is reported directly.
527- MODE_NORMAL = 0,
528- // Axis value should be inverted before reporting.
529- MODE_INVERT = 1,
530- // Axis value should be split into two axes
531- MODE_SPLIT = 2
532- };
533-
534- // Axis mode.
535- Mode mode;
536-
537- // Axis id.
538- // When split, this is the axis used for values smaller than the split position.
539- int32_t axis;
540-
541- // When split, this is the axis used for values after higher than the split position.
542- int32_t highAxis;
543-
544- // The split value, or 0 if not split.
545- int32_t splitValue;
546-
547- // The flat value, or -1 if none.
548- int32_t flatOverride;
549-
550- AxisInfo() : mode(MODE_NORMAL), axis(-1), highAxis(-1), splitValue(0), flatOverride(-1) {
551- }
552-};
553-
554-/**
555- * Describes a mapping from keyboard scan codes and joystick axes to Android key codes and axes.
556- *
557- * This object is immutable after it has been loaded.
558- */
559-class KeyLayoutMap : public RefBase {
560-public:
561- static status_t load(const String8& filename, sp<KeyLayoutMap>* outMap);
562- // <mir changes>
563- static status_t load(const String8& filename, const char* contents, sp<KeyLayoutMap>* outMap);
564- // </mir changes>
565-
566- status_t mapKey(int32_t scanCode, int32_t usageCode,
567- int32_t* outKeyCode, uint32_t* outFlags) const;
568- status_t findScanCodesForKey(int32_t keyCode, Vector<int32_t>* outScanCodes) const;
569-
570- status_t mapAxis(int32_t scanCode, AxisInfo* outAxisInfo) const;
571-
572-protected:
573- virtual ~KeyLayoutMap();
574-
575-private:
576- // <mir changes>
577- static status_t load(Tokenizer* tokenizer, sp<KeyLayoutMap>* outMap);
578- // </mir changes>
579- struct Key {
580- int32_t keyCode;
581- uint32_t flags;
582- };
583-
584- KeyedVector<int32_t, Key> mKeysByScanCode;
585- KeyedVector<int32_t, Key> mKeysByUsageCode;
586- KeyedVector<int32_t, AxisInfo> mAxes;
587-
588- KeyLayoutMap();
589-
590- const Key* getKey(int32_t scanCode, int32_t usageCode) const;
591-
592- class Parser {
593- KeyLayoutMap* mMap;
594- Tokenizer* mTokenizer;
595-
596- public:
597- Parser(KeyLayoutMap* map, Tokenizer* tokenizer);
598- ~Parser();
599- status_t parse();
600-
601- private:
602- status_t parseKey();
603- status_t parseAxis();
604- };
605-};
606-
607-} // namespace android
608-
609-#endif // _ANDROIDFW_KEY_LAYOUT_MAP_H
610
611=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/Keyboard.h'
612--- 3rd_party/android-input/android/frameworks/base/include/androidfw/Keyboard.h 2013-05-03 16:38:07 +0000
613+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/Keyboard.h 1970-01-01 00:00:00 +0000
614@@ -1,125 +0,0 @@
615-/*
616- * Copyright (C) 2010 The Android Open Source Project
617- *
618- * Licensed under the Apache License, Version 2.0 (the "License");
619- * you may not use this file except in compliance with the License.
620- * You may obtain a copy of the License at
621- *
622- * http://www.apache.org/licenses/LICENSE-2.0
623- *
624- * Unless required by applicable law or agreed to in writing, software
625- * distributed under the License is distributed on an "AS IS" BASIS,
626- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
627- * See the License for the specific language governing permissions and
628- * limitations under the License.
629- */
630-
631-#ifndef _ANDROIDFW_KEYBOARD_H
632-#define _ANDROIDFW_KEYBOARD_H
633-
634-
635-#include <androidfw/Input.h>
636-#include <androidfw/InputDevice.h>
637-#include <std/Errors.h>
638-#include <std/String8.h>
639-#include <std/PropertyMap.h>
640-
641-namespace android {
642-
643-enum {
644- /* Device id of the built in keyboard. */
645- DEVICE_ID_BUILT_IN_KEYBOARD = 0,
646-
647- /* Device id of a generic virtual keyboard with a full layout that can be used
648- * to synthesize key events. */
649- DEVICE_ID_VIRTUAL_KEYBOARD = -1
650-};
651-
652-class KeyLayoutMap;
653-class KeyCharacterMap;
654-
655-/**
656- * Loads the key layout map and key character map for a keyboard device.
657- */
658-class KeyMap {
659-public:
660- String8 keyLayoutFile;
661- sp<KeyLayoutMap> keyLayoutMap;
662-
663- String8 keyCharacterMapFile;
664- sp<KeyCharacterMap> keyCharacterMap;
665-
666- KeyMap();
667- ~KeyMap();
668-
669- status_t load(const InputDeviceIdentifier& deviceIdenfier,
670- const PropertyMap* deviceConfiguration);
671-
672- // <mir changes>
673- status_t loadGenericMaps();
674- // </mir changes>
675-
676- inline bool haveKeyLayout() const {
677- return !isEmpty(keyLayoutFile);
678- }
679-
680- inline bool haveKeyCharacterMap() const {
681- return !isEmpty(keyCharacterMapFile);
682- }
683-
684- inline bool isComplete() const {
685- return haveKeyLayout() && haveKeyCharacterMap();
686- }
687-
688-private:
689- bool probeKeyMap(const InputDeviceIdentifier& deviceIdentifier, const String8& name);
690- status_t loadKeyLayout(const InputDeviceIdentifier& deviceIdentifier, const String8& name);
691- status_t loadKeyCharacterMap(const InputDeviceIdentifier& deviceIdentifier,
692- const String8& name);
693- String8 getPath(const InputDeviceIdentifier& deviceIdentifier,
694- const String8& name, InputDeviceConfigurationFileType type);
695-};
696-
697-/**
698- * Returns true if the keyboard is eligible for use as a built-in keyboard.
699- */
700-extern bool isEligibleBuiltInKeyboard(const InputDeviceIdentifier& deviceIdentifier,
701- const PropertyMap* deviceConfiguration, const KeyMap* keyMap);
702-
703-/**
704- * Gets a key code by its short form label, eg. "HOME".
705- * Returns 0 if unknown.
706- */
707-extern int32_t getKeyCodeByLabel(const char* label);
708-
709-/**
710- * Gets a key flag by its short form label, eg. "WAKE".
711- * Returns 0 if unknown.
712- */
713-extern uint32_t getKeyFlagByLabel(const char* label);
714-
715-/**
716- * Gets a axis by its short form label, eg. "X".
717- * Returns -1 if unknown.
718- */
719-extern int32_t getAxisByLabel(const char* label);
720-
721-/**
722- * Gets a axis label by its id.
723- * Returns NULL if unknown.
724- */
725-extern const char* getAxisLabel(int32_t axisId);
726-
727-/**
728- * Updates a meta state field when a key is pressed or released.
729- */
730-extern int32_t updateMetaState(int32_t keyCode, bool down, int32_t oldMetaState);
731-
732-/**
733- * Returns true if a key is a meta key like ALT or CAPS_LOCK.
734- */
735-extern bool isMetaKey(int32_t keyCode);
736-
737-} // namespace android
738-
739-#endif // _ANDROIDFW_KEYBOARD_H
740
741=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/KeycodeLabels.h'
742--- 3rd_party/android-input/android/frameworks/base/include/androidfw/KeycodeLabels.h 2013-05-03 16:38:07 +0000
743+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/KeycodeLabels.h 1970-01-01 00:00:00 +0000
744@@ -1,320 +0,0 @@
745-/*
746- * Copyright (C) 2008 The Android Open Source Project
747- *
748- * Licensed under the Apache License, Version 2.0 (the "License");
749- * you may not use this file except in compliance with the License.
750- * You may obtain a copy of the License at
751- *
752- * http://www.apache.org/licenses/LICENSE-2.0
753- *
754- * Unless required by applicable law or agreed to in writing, software
755- * distributed under the License is distributed on an "AS IS" BASIS,
756- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
757- * See the License for the specific language governing permissions and
758- * limitations under the License.
759- */
760-
761-#ifndef _ANDROIDFW_KEYCODE_LABELS_H
762-#define _ANDROIDFW_KEYCODE_LABELS_H
763-
764-
765-#include <android/keycodes.h>
766-
767-struct KeycodeLabel {
768- const char *literal;
769- int value;
770-};
771-
772-static const KeycodeLabel KEYCODES[] = {
773- { "SOFT_LEFT", 1 },
774- { "SOFT_RIGHT", 2 },
775- { "HOME", 3 },
776- { "BACK", 4 },
777- { "CALL", 5 },
778- { "ENDCALL", 6 },
779- { "0", 7 },
780- { "1", 8 },
781- { "2", 9 },
782- { "3", 10 },
783- { "4", 11 },
784- { "5", 12 },
785- { "6", 13 },
786- { "7", 14 },
787- { "8", 15 },
788- { "9", 16 },
789- { "STAR", 17 },
790- { "POUND", 18 },
791- { "DPAD_UP", 19 },
792- { "DPAD_DOWN", 20 },
793- { "DPAD_LEFT", 21 },
794- { "DPAD_RIGHT", 22 },
795- { "DPAD_CENTER", 23 },
796- { "VOLUME_UP", 24 },
797- { "VOLUME_DOWN", 25 },
798- { "POWER", 26 },
799- { "CAMERA", 27 },
800- { "CLEAR", 28 },
801- { "A", 29 },
802- { "B", 30 },
803- { "C", 31 },
804- { "D", 32 },
805- { "E", 33 },
806- { "F", 34 },
807- { "G", 35 },
808- { "H", 36 },
809- { "I", 37 },
810- { "J", 38 },
811- { "K", 39 },
812- { "L", 40 },
813- { "M", 41 },
814- { "N", 42 },
815- { "O", 43 },
816- { "P", 44 },
817- { "Q", 45 },
818- { "R", 46 },
819- { "S", 47 },
820- { "T", 48 },
821- { "U", 49 },
822- { "V", 50 },
823- { "W", 51 },
824- { "X", 52 },
825- { "Y", 53 },
826- { "Z", 54 },
827- { "COMMA", 55 },
828- { "PERIOD", 56 },
829- { "ALT_LEFT", 57 },
830- { "ALT_RIGHT", 58 },
831- { "SHIFT_LEFT", 59 },
832- { "SHIFT_RIGHT", 60 },
833- { "TAB", 61 },
834- { "SPACE", 62 },
835- { "SYM", 63 },
836- { "EXPLORER", 64 },
837- { "ENVELOPE", 65 },
838- { "ENTER", 66 },
839- { "DEL", 67 },
840- { "GRAVE", 68 },
841- { "MINUS", 69 },
842- { "EQUALS", 70 },
843- { "LEFT_BRACKET", 71 },
844- { "RIGHT_BRACKET", 72 },
845- { "BACKSLASH", 73 },
846- { "SEMICOLON", 74 },
847- { "APOSTROPHE", 75 },
848- { "SLASH", 76 },
849- { "AT", 77 },
850- { "NUM", 78 },
851- { "HEADSETHOOK", 79 },
852- { "FOCUS", 80 },
853- { "PLUS", 81 },
854- { "MENU", 82 },
855- { "NOTIFICATION", 83 },
856- { "SEARCH", 84 },
857- { "MEDIA_PLAY_PAUSE", 85 },
858- { "MEDIA_STOP", 86 },
859- { "MEDIA_NEXT", 87 },
860- { "MEDIA_PREVIOUS", 88 },
861- { "MEDIA_REWIND", 89 },
862- { "MEDIA_FAST_FORWARD", 90 },
863- { "MUTE", 91 },
864- { "PAGE_UP", 92 },
865- { "PAGE_DOWN", 93 },
866- { "PICTSYMBOLS", 94 },
867- { "SWITCH_CHARSET", 95 },
868- { "BUTTON_A", 96 },
869- { "BUTTON_B", 97 },
870- { "BUTTON_C", 98 },
871- { "BUTTON_X", 99 },
872- { "BUTTON_Y", 100 },
873- { "BUTTON_Z", 101 },
874- { "BUTTON_L1", 102 },
875- { "BUTTON_R1", 103 },
876- { "BUTTON_L2", 104 },
877- { "BUTTON_R2", 105 },
878- { "BUTTON_THUMBL", 106 },
879- { "BUTTON_THUMBR", 107 },
880- { "BUTTON_START", 108 },
881- { "BUTTON_SELECT", 109 },
882- { "BUTTON_MODE", 110 },
883- { "ESCAPE", 111 },
884- { "FORWARD_DEL", 112 },
885- { "CTRL_LEFT", 113 },
886- { "CTRL_RIGHT", 114 },
887- { "CAPS_LOCK", 115 },
888- { "SCROLL_LOCK", 116 },
889- { "META_LEFT", 117 },
890- { "META_RIGHT", 118 },
891- { "FUNCTION", 119 },
892- { "SYSRQ", 120 },
893- { "BREAK", 121 },
894- { "MOVE_HOME", 122 },
895- { "MOVE_END", 123 },
896- { "INSERT", 124 },
897- { "FORWARD", 125 },
898- { "MEDIA_PLAY", 126 },
899- { "MEDIA_PAUSE", 127 },
900- { "MEDIA_CLOSE", 128 },
901- { "MEDIA_EJECT", 129 },
902- { "MEDIA_RECORD", 130 },
903- { "F1", 131 },
904- { "F2", 132 },
905- { "F3", 133 },
906- { "F4", 134 },
907- { "F5", 135 },
908- { "F6", 136 },
909- { "F7", 137 },
910- { "F8", 138 },
911- { "F9", 139 },
912- { "F10", 140 },
913- { "F11", 141 },
914- { "F12", 142 },
915- { "NUM_LOCK", 143 },
916- { "NUMPAD_0", 144 },
917- { "NUMPAD_1", 145 },
918- { "NUMPAD_2", 146 },
919- { "NUMPAD_3", 147 },
920- { "NUMPAD_4", 148 },
921- { "NUMPAD_5", 149 },
922- { "NUMPAD_6", 150 },
923- { "NUMPAD_7", 151 },
924- { "NUMPAD_8", 152 },
925- { "NUMPAD_9", 153 },
926- { "NUMPAD_DIVIDE", 154 },
927- { "NUMPAD_MULTIPLY", 155 },
928- { "NUMPAD_SUBTRACT", 156 },
929- { "NUMPAD_ADD", 157 },
930- { "NUMPAD_DOT", 158 },
931- { "NUMPAD_COMMA", 159 },
932- { "NUMPAD_ENTER", 160 },
933- { "NUMPAD_EQUALS", 161 },
934- { "NUMPAD_LEFT_PAREN", 162 },
935- { "NUMPAD_RIGHT_PAREN", 163 },
936- { "VOLUME_MUTE", 164 },
937- { "INFO", 165 },
938- { "CHANNEL_UP", 166 },
939- { "CHANNEL_DOWN", 167 },
940- { "ZOOM_IN", 168 },
941- { "ZOOM_OUT", 169 },
942- { "TV", 170 },
943- { "WINDOW", 171 },
944- { "GUIDE", 172 },
945- { "DVR", 173 },
946- { "BOOKMARK", 174 },
947- { "CAPTIONS", 175 },
948- { "SETTINGS", 176 },
949- { "TV_POWER", 177 },
950- { "TV_INPUT", 178 },
951- { "STB_POWER", 179 },
952- { "STB_INPUT", 180 },
953- { "AVR_POWER", 181 },
954- { "AVR_INPUT", 182 },
955- { "PROG_RED", 183 },
956- { "PROG_GREEN", 184 },
957- { "PROG_YELLOW", 185 },
958- { "PROG_BLUE", 186 },
959- { "APP_SWITCH", 187 },
960- { "BUTTON_1", 188 },
961- { "BUTTON_2", 189 },
962- { "BUTTON_3", 190 },
963- { "BUTTON_4", 191 },
964- { "BUTTON_5", 192 },
965- { "BUTTON_6", 193 },
966- { "BUTTON_7", 194 },
967- { "BUTTON_8", 195 },
968- { "BUTTON_9", 196 },
969- { "BUTTON_10", 197 },
970- { "BUTTON_11", 198 },
971- { "BUTTON_12", 199 },
972- { "BUTTON_13", 200 },
973- { "BUTTON_14", 201 },
974- { "BUTTON_15", 202 },
975- { "BUTTON_16", 203 },
976- { "LANGUAGE_SWITCH", 204 },
977- { "MANNER_MODE", 205 },
978- { "3D_MODE", 206 },
979- { "CONTACTS", 207 },
980- { "CALENDAR", 208 },
981- { "MUSIC", 209 },
982- { "CALCULATOR", 210 },
983- { "ZENKAKU_HANKAKU", 211 },
984- { "EISU", 212 },
985- { "MUHENKAN", 213 },
986- { "HENKAN", 214 },
987- { "KATAKANA_HIRAGANA", 215 },
988- { "YEN", 216 },
989- { "RO", 217 },
990- { "KANA", 218 },
991- { "ASSIST", 219 },
992-
993- // NOTE: If you add a new keycode here you must also add it to several other files.
994- // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
995-
996- { NULL, 0 }
997-};
998-
999-// NOTE: If you edit these flags, also edit policy flags in Input.h.
1000-static const KeycodeLabel FLAGS[] = {
1001- { "WAKE", 0x00000001 },
1002- { "WAKE_DROPPED", 0x00000002 },
1003- { "SHIFT", 0x00000004 },
1004- { "CAPS_LOCK", 0x00000008 },
1005- { "ALT", 0x00000010 },
1006- { "ALT_GR", 0x00000020 },
1007- { "MENU", 0x00000040 },
1008- { "LAUNCHER", 0x00000080 },
1009- { "VIRTUAL", 0x00000100 },
1010- { "FUNCTION", 0x00000200 },
1011- { NULL, 0 }
1012-};
1013-
1014-static const KeycodeLabel AXES[] = {
1015- { "X", 0 },
1016- { "Y", 1 },
1017- { "PRESSURE", 2 },
1018- { "SIZE", 3 },
1019- { "TOUCH_MAJOR", 4 },
1020- { "TOUCH_MINOR", 5 },
1021- { "TOOL_MAJOR", 6 },
1022- { "TOOL_MINOR", 7 },
1023- { "ORIENTATION", 8 },
1024- { "VSCROLL", 9 },
1025- { "HSCROLL", 10 },
1026- { "Z", 11 },
1027- { "RX", 12 },
1028- { "RY", 13 },
1029- { "RZ", 14 },
1030- { "HAT_X", 15 },
1031- { "HAT_Y", 16 },
1032- { "LTRIGGER", 17 },
1033- { "RTRIGGER", 18 },
1034- { "THROTTLE", 19 },
1035- { "RUDDER", 20 },
1036- { "WHEEL", 21 },
1037- { "GAS", 22 },
1038- { "BRAKE", 23 },
1039- { "DISTANCE", 24 },
1040- { "TILT", 25 },
1041- { "GENERIC_1", 32 },
1042- { "GENERIC_2", 33 },
1043- { "GENERIC_3", 34 },
1044- { "GENERIC_4", 35 },
1045- { "GENERIC_5", 36 },
1046- { "GENERIC_6", 37 },
1047- { "GENERIC_7", 38 },
1048- { "GENERIC_8", 39 },
1049- { "GENERIC_9", 40 },
1050- { "GENERIC_10", 41 },
1051- { "GENERIC_11", 42 },
1052- { "GENERIC_12", 43 },
1053- { "GENERIC_13", 44 },
1054- { "GENERIC_14", 45 },
1055- { "GENERIC_15", 46 },
1056- { "GENERIC_16", 47 },
1057-
1058- // NOTE: If you add a new axis here you must also add it to several other files.
1059- // Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list.
1060-
1061- { NULL, -1 }
1062-};
1063-
1064-#endif // _ANDROIDFW_KEYCODE_LABELS_H
1065
1066=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h'
1067--- 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h 2015-04-28 07:54:10 +0000
1068+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h 1970-01-01 00:00:00 +0000
1069@@ -1,110 +0,0 @@
1070-/*
1071- * Copyright (C) 2012 The Android Open Source Project
1072- *
1073- * Licensed under the Apache License, Version 2.0 (the "License");
1074- * you may not use this file except in compliance with the License.
1075- * You may obtain a copy of the License at
1076- *
1077- * http://www.apache.org/licenses/LICENSE-2.0
1078- *
1079- * Unless required by applicable law or agreed to in writing, software
1080- * distributed under the License is distributed on an "AS IS" BASIS,
1081- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1082- * See the License for the specific language governing permissions and
1083- * limitations under the License.
1084- */
1085-
1086-#ifndef _ANDROIDFW_VELOCITY_CONTROL_H
1087-#define _ANDROIDFW_VELOCITY_CONTROL_H
1088-
1089-
1090-#include <androidfw/Input.h>
1091-#include <androidfw/IntSet.h>
1092-#include <androidfw/VelocityTracker.h>
1093-#include <std/Timers.h>
1094-
1095-namespace android {
1096-
1097-/*
1098- * Specifies parameters that govern pointer or wheel acceleration.
1099- */
1100-struct VelocityControlParameters {
1101- // A scale factor that is multiplied with the raw velocity deltas
1102- // prior to applying any other velocity control factors. The scale
1103- // factor should be used to adapt the input device resolution
1104- // (eg. counts per inch) to the output device resolution (eg. pixels per inch).
1105- //
1106- // Must be a positive value.
1107- // Default is 1.0 (no scaling).
1108- float scale;
1109-
1110- // The scaled speed at which acceleration begins to be applied.
1111- // This value establishes the upper bound of a low speed regime for
1112- // small precise motions that are performed without any acceleration.
1113- //
1114- // Must be a non-negative value.
1115- // Default is 0.0 (no low threshold).
1116- float lowThreshold;
1117-
1118- // The scaled speed at which maximum acceleration is applied.
1119- // The difference between highThreshold and lowThreshold controls
1120- // the range of speeds over which the acceleration factor is interpolated.
1121- // The wider the range, the smoother the acceleration.
1122- //
1123- // Must be a non-negative value greater than or equal to lowThreshold.
1124- // Default is 0.0 (no high threshold).
1125- float highThreshold;
1126-
1127- // The acceleration factor.
1128- // When the speed is above the low speed threshold, the velocity will scaled
1129- // by an interpolated value between 1.0 and this amount.
1130- //
1131- // Must be a positive greater than or equal to 1.0.
1132- // Default is 1.0 (no acceleration).
1133- float acceleration;
1134-
1135- VelocityControlParameters() :
1136- scale(1.0f), lowThreshold(0.0f), highThreshold(0.0f), acceleration(1.0f) {
1137- }
1138-
1139- VelocityControlParameters(float scale, float lowThreshold,
1140- float highThreshold, float acceleration) :
1141- scale(scale), lowThreshold(lowThreshold),
1142- highThreshold(highThreshold), acceleration(acceleration) {
1143- }
1144-};
1145-
1146-/*
1147- * Implements mouse pointer and wheel speed control and acceleration.
1148- */
1149-class VelocityControl {
1150-public:
1151- VelocityControl();
1152-
1153- /* Sets the various parameters. */
1154- void setParameters(const VelocityControlParameters& parameters);
1155-
1156- /* Resets the current movement counters to zero.
1157- * This has the effect of nullifying any acceleration. */
1158- void reset();
1159-
1160- /* Translates a raw movement delta into an appropriately
1161- * scaled / accelerated delta based on the current velocity. */
1162- void move(std::chrono::nanoseconds eventTime, float* deltaX, float* deltaY);
1163-
1164-private:
1165- // If no movements are received within this amount of time,
1166- // we assume the movement has stopped and reset the movement counters.
1167- static constexpr const std::chrono::nanoseconds STOP_TIME = std::chrono::nanoseconds(500 * 1000000); // 500 ms
1168-
1169- VelocityControlParameters mParameters;
1170-
1171- std::chrono::nanoseconds mLastMovementTime;
1172- VelocityTracker::Position mRawPosition;
1173- VelocityTracker mVelocityTracker;
1174- IntSet mIds;
1175-};
1176-
1177-} // namespace android
1178-
1179-#endif // _ANDROIDFW_VELOCITY_CONTROL_H
1180
1181=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h'
1182--- 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h 2015-04-28 07:54:10 +0000
1183+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h 1970-01-01 00:00:00 +0000
1184@@ -1,272 +0,0 @@
1185-/*
1186- * Copyright (C) 2012 The Android Open Source Project
1187- *
1188- * Licensed under the Apache License, Version 2.0 (the "License");
1189- * you may not use this file except in compliance with the License.
1190- * You may obtain a copy of the License at
1191- *
1192- * http://www.apache.org/licenses/LICENSE-2.0
1193- *
1194- * Unless required by applicable law or agreed to in writing, software
1195- * distributed under the License is distributed on an "AS IS" BASIS,
1196- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1197- * See the License for the specific language governing permissions and
1198- * limitations under the License.
1199- */
1200-
1201-#ifndef _ANDROIDFW_VELOCITY_TRACKER_H
1202-#define _ANDROIDFW_VELOCITY_TRACKER_H
1203-
1204-#include <androidfw/Input.h>
1205-#include <androidfw/IntSet.h>
1206-#include <std/Timers.h>
1207-
1208-// C++ std lib
1209-#include <unordered_map>
1210-
1211-namespace android {
1212-
1213-class VelocityTrackerStrategy;
1214-
1215-/*
1216- * Calculates the velocity of pointer movements over time.
1217- */
1218-class VelocityTracker {
1219-public:
1220- struct Position {
1221- float x, y;
1222- };
1223-
1224- struct Estimator {
1225- static const size_t MAX_DEGREE = 4;
1226-
1227- // Estimator time base.
1228- std::chrono::nanoseconds time;
1229-
1230- // Polynomial coefficients describing motion in X and Y.
1231- float xCoeff[MAX_DEGREE + 1], yCoeff[MAX_DEGREE + 1];
1232-
1233- // Polynomial degree (number of coefficients), or zero if no information is
1234- // available.
1235- uint32_t degree;
1236-
1237- // Confidence (coefficient of determination), between 0 (no fit) and 1 (perfect fit).
1238- float confidence;
1239-
1240- inline void clear() {
1241- time = std::chrono::nanoseconds(0);
1242- degree = 0;
1243- confidence = 0;
1244- for (size_t i = 0; i <= MAX_DEGREE; i++) {
1245- xCoeff[i] = 0;
1246- yCoeff[i] = 0;
1247- }
1248- }
1249- };
1250-
1251- // Creates a velocity tracker using the specified strategy.
1252- // If strategy is NULL, uses the default strategy for the platform.
1253- VelocityTracker(const char* strategy = NULL);
1254-
1255- ~VelocityTracker();
1256-
1257- // Resets the velocity tracker state.
1258- void clear();
1259-
1260- // Resets the velocity tracker state for specific pointers.
1261- // Call this method when some pointers have changed and may be reusing
1262- // an id that was assigned to a different pointer earlier.
1263- void clearPointers(const IntSet &ids);
1264-
1265- // Adds movement information for a set of pointers.
1266- // The ids set specifies the pointer ids of the pointers whose positions
1267- // are included in the movement.
1268- // The positions array contains position information for each pointer in order by
1269- // increasing id. Its size should be equal to the size of ids.
1270- void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids, const Position* positions);
1271-
1272- // Adds movement information for all pointers in a MotionEvent, including historical samples.
1273- void addMovement(const MotionEvent* event);
1274-
1275- // Gets the velocity of the specified pointer id in position units per second.
1276- // Returns false and sets the velocity components to zero if there is
1277- // insufficient movement information for the pointer.
1278- bool getVelocity(uint32_t id, float* outVx, float* outVy) const;
1279-
1280- // Gets an estimator for the recent movements of the specified pointer id.
1281- // Returns false and clears the estimator if there is no information available
1282- // about the pointer.
1283- bool getEstimator(uint32_t id, Estimator* outEstimator) const;
1284-
1285- // Gets the active pointer id, or -1 if none.
1286- inline int32_t getActivePointerId() const { return mActivePointerId; }
1287-
1288- // Gets a bitset containing all pointer ids from the most recent movement.
1289- inline const IntSet &getCurrentPointerIds() const { return mCurrentPointerIds; }
1290-
1291-private:
1292- static const char* DEFAULT_STRATEGY;
1293-
1294- std::chrono::nanoseconds mLastEventTime;
1295- IntSet mCurrentPointerIds;
1296- int32_t mActivePointerId;
1297- VelocityTrackerStrategy* mStrategy;
1298-
1299- bool configureStrategy(const char* strategy);
1300-
1301- static VelocityTrackerStrategy* createStrategy(const char* strategy);
1302-};
1303-
1304-
1305-/*
1306- * Implements a particular velocity tracker algorithm.
1307- */
1308-class VelocityTrackerStrategy {
1309-protected:
1310- VelocityTrackerStrategy() { }
1311-
1312-public:
1313- virtual ~VelocityTrackerStrategy() { }
1314-
1315- virtual void clear() = 0;
1316- virtual void clearPointers(const IntSet &ids) = 0;
1317- virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
1318- const VelocityTracker::Position* positions) = 0;
1319- virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const = 0;
1320-};
1321-
1322-
1323-/*
1324- * Velocity tracker algorithm based on least-squares linear regression.
1325- */
1326-class LeastSquaresVelocityTrackerStrategy : public VelocityTrackerStrategy {
1327-public:
1328- enum Weighting {
1329- // No weights applied. All data points are equally reliable.
1330- WEIGHTING_NONE,
1331-
1332- // Weight by time delta. Data points clustered together are weighted less.
1333- WEIGHTING_DELTA,
1334-
1335- // Weight such that points within a certain horizon are weighed more than those
1336- // outside of that horizon.
1337- WEIGHTING_CENTRAL,
1338-
1339- // Weight such that points older than a certain amount are weighed less.
1340- WEIGHTING_RECENT
1341- };
1342-
1343- // Degree must be no greater than Estimator::MAX_DEGREE.
1344- LeastSquaresVelocityTrackerStrategy(uint32_t degree, Weighting weighting = WEIGHTING_NONE);
1345- virtual ~LeastSquaresVelocityTrackerStrategy();
1346-
1347- virtual void clear();
1348- virtual void clearPointers(const IntSet &ids);
1349- virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
1350- const VelocityTracker::Position* positions);
1351- virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
1352-
1353-private:
1354- // Sample horizon.
1355- // We don't use too much history by default since we want to react to quick
1356- // changes in direction.
1357- static constexpr const std::chrono::nanoseconds HORIZON = std::chrono::nanoseconds(100 * 1000000); // 100 ms
1358-
1359- // Number of samples to keep.
1360- static const uint32_t HISTORY_SIZE = 20;
1361-
1362- struct Movement {
1363- std::chrono::nanoseconds eventTime;
1364- IntSet ids;
1365- VelocityTracker::Position positions[MAX_POINTERS];
1366-
1367- inline const VelocityTracker::Position& getPosition(uint32_t id) const {
1368- return positions[ids.indexOf(id)];
1369- }
1370- };
1371-
1372- float chooseWeight(uint32_t index) const;
1373-
1374- const uint32_t mDegree;
1375- const Weighting mWeighting;
1376- uint32_t mIndex;
1377- Movement mMovements[HISTORY_SIZE];
1378-};
1379-
1380-
1381-/*
1382- * Velocity tracker algorithm that uses an IIR filter.
1383- */
1384-class IntegratingVelocityTrackerStrategy : public VelocityTrackerStrategy {
1385-public:
1386- // Degree must be 1 or 2.
1387- IntegratingVelocityTrackerStrategy(uint32_t degree);
1388- ~IntegratingVelocityTrackerStrategy();
1389-
1390- virtual void clear();
1391- virtual void clearPointers(const IntSet &ids);
1392- virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
1393- const VelocityTracker::Position* positions);
1394- virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
1395-
1396-private:
1397- // Current state estimate for a particular pointer.
1398- struct State {
1399- std::chrono::nanoseconds updateTime;
1400- uint32_t degree;
1401-
1402- float xpos, xvel, xaccel;
1403- float ypos, yvel, yaccel;
1404- };
1405-
1406- const uint32_t mDegree;
1407- IntSet mPointerIds;
1408- std::unordered_map<int32_t, State> mPointerState; // maps the id of a pointer to its state
1409-
1410- void initState(State& state, std::chrono::nanoseconds eventTime, float xpos, float ypos) const;
1411- void updateState(State& state, std::chrono::nanoseconds eventTime, float xpos, float ypos) const;
1412- void populateEstimator(const State& state, VelocityTracker::Estimator* outEstimator) const;
1413-};
1414-
1415-
1416-/*
1417- * Velocity tracker strategy used prior to ICS.
1418- */
1419-class LegacyVelocityTrackerStrategy : public VelocityTrackerStrategy {
1420-public:
1421- LegacyVelocityTrackerStrategy();
1422- virtual ~LegacyVelocityTrackerStrategy();
1423-
1424- virtual void clear();
1425- virtual void clearPointers(const IntSet &ids);
1426- virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
1427- const VelocityTracker::Position* positions);
1428- virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
1429-
1430-private:
1431- // Oldest sample to consider when calculating the velocity.
1432- static constexpr const std::chrono::nanoseconds HORIZON = std::chrono::nanoseconds(200 * 1000000); // 100 ms
1433-
1434- // Number of samples to keep.
1435- static const uint32_t HISTORY_SIZE = 20;
1436-
1437- // The minimum duration between samples when estimating velocity.
1438- static constexpr const std::chrono::nanoseconds MIN_DURATION = std::chrono::nanoseconds(10 * 1000000); // 10 ms
1439-
1440- struct Movement {
1441- std::chrono::nanoseconds eventTime;
1442- IntSet ids;
1443- VelocityTracker::Position positions[MAX_POINTERS];
1444-
1445- inline const VelocityTracker::Position& getPosition(uint32_t id) const {
1446- return positions[ids.indexOf(id)];
1447- }
1448- };
1449-
1450- uint32_t mIndex;
1451- Movement mMovements[HISTORY_SIZE];
1452-};
1453-
1454-} // namespace android
1455-
1456-#endif // _ANDROIDFW_VELOCITY_TRACKER_H
1457
1458=== removed file '3rd_party/android-input/android/frameworks/base/include/androidfw/VirtualKeyMap.h'
1459--- 3rd_party/android-input/android/frameworks/base/include/androidfw/VirtualKeyMap.h 2013-05-03 16:38:07 +0000
1460+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/VirtualKeyMap.h 1970-01-01 00:00:00 +0000
1461@@ -1,81 +0,0 @@
1462-/*
1463- * Copyright (C) 2010 The Android Open Source Project
1464- *
1465- * Licensed under the Apache License, Version 2.0 (the "License");
1466- * you may not use this file except in compliance with the License.
1467- * You may obtain a copy of the License at
1468- *
1469- * http://www.apache.org/licenses/LICENSE-2.0
1470- *
1471- * Unless required by applicable law or agreed to in writing, software
1472- * distributed under the License is distributed on an "AS IS" BASIS,
1473- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1474- * See the License for the specific language governing permissions and
1475- * limitations under the License.
1476- */
1477-
1478-#ifndef _ANDROIDFW_VIRTUAL_KEY_MAP_H
1479-#define _ANDROIDFW_VIRTUAL_KEY_MAP_H
1480-
1481-
1482-#include <stdint.h>
1483-
1484-#include <androidfw/Input.h>
1485-#include <std/Errors.h>
1486-#include <std/KeyedVector.h>
1487-#include <std/Tokenizer.h>
1488-#include <std/String8.h>
1489-
1490-namespace android {
1491-
1492-/* Describes a virtual key. */
1493-struct VirtualKeyDefinition {
1494- int32_t scanCode;
1495-
1496- // configured position data, specified in display coords
1497- int32_t centerX;
1498- int32_t centerY;
1499- int32_t width;
1500- int32_t height;
1501-};
1502-
1503-
1504-/**
1505- * Describes a collection of virtual keys on a touch screen in terms of
1506- * virtual scan codes and hit rectangles.
1507- *
1508- * This object is immutable after it has been loaded.
1509- */
1510-class VirtualKeyMap {
1511-public:
1512- ~VirtualKeyMap();
1513-
1514- static status_t load(const String8& filename, VirtualKeyMap** outMap);
1515-
1516- inline const Vector<VirtualKeyDefinition>& getVirtualKeys() const {
1517- return mVirtualKeys;
1518- }
1519-
1520-private:
1521- class Parser {
1522- VirtualKeyMap* mMap;
1523- Tokenizer* mTokenizer;
1524-
1525- public:
1526- Parser(VirtualKeyMap* map, Tokenizer* tokenizer);
1527- ~Parser();
1528- status_t parse();
1529-
1530- private:
1531- bool consumeFieldDelimiterAndSkipWhitespace();
1532- bool parseNextIntField(int32_t* outValue);
1533- };
1534-
1535- Vector<VirtualKeyDefinition> mVirtualKeys;
1536-
1537- VirtualKeyMap();
1538-};
1539-
1540-} // namespace android
1541-
1542-#endif // _ANDROIDFW_KEY_CHARACTER_MAP_H
1543
1544=== removed file '3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp'
1545--- 3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp 2015-08-19 02:03:51 +0000
1546+++ 3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp 1970-01-01 00:00:00 +0000
1547@@ -1,1502 +0,0 @@
1548-/*
1549- * Copyright (C) 2005 The Android Open Source Project
1550- *
1551- * Licensed under the Apache License, Version 2.0 (the "License");
1552- * you may not use this file except in compliance with the License.
1553- * You may obtain a copy of the License at
1554- *
1555- * http://www.apache.org/licenses/LICENSE-2.0
1556- *
1557- * Unless required by applicable law or agreed to in writing, software
1558- * distributed under the License is distributed on an "AS IS" BASIS,
1559- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1560- * See the License for the specific language governing permissions and
1561- * limitations under the License.
1562- */
1563-
1564-#define LOG_TAG "EventHub"
1565-
1566-// #define LOG_NDEBUG 0
1567-
1568-#include "EventHub.h"
1569-
1570-#define acquire_wake_lock(lock, id) {}
1571-#define release_wake_lock(id) {}
1572-
1573-#include "mir/input/input_report.h"
1574-#include "mir/udev/wrapper.h"
1575-
1576-#include <cutils/properties.h>
1577-#include <std/Log.h>
1578-#include <std/Timers.h>
1579-#include <std/Errors.h>
1580-
1581-#include <stdlib.h>
1582-#include <unistd.h>
1583-#include <fcntl.h>
1584-#include <memory.h>
1585-#include <errno.h>
1586-#include <assert.h>
1587-
1588-#include <androidfw/KeyLayoutMap.h>
1589-#include <androidfw/KeyCharacterMap.h>
1590-#include <androidfw/VirtualKeyMap.h>
1591-
1592-#include <android/keycodes.h>
1593-#include <boost/uuid/sha1.hpp>
1594-
1595-#include <string.h>
1596-#include <stdint.h>
1597-#include <dirent.h>
1598-
1599-#include <sys/inotify.h>
1600-#include <sys/epoll.h>
1601-#include <sys/ioctl.h>
1602-#include <sys/timerfd.h>
1603-// <mir changes>
1604-// Needed to build on android platform (PATH_MAX)
1605-#ifdef HAVE_ANDROID_OS
1606-#include <sys/limits.h>
1607-#endif
1608-#include <linux/limits.h>
1609-// </mir changes>
1610-
1611-/* this macro is used to tell if "bit" is set in "array"
1612- * it selects a byte from the array, and does a boolean AND
1613- * operation with a byte that only has the relevant bit set.
1614- * eg. to check for the 12th bit, we do (array[1] & 1<<4)
1615- */
1616-#define test_bit(bit, array) (array[bit/8] & (1<<(bit%8)))
1617-
1618-/* this macro computes the number of bytes needed to represent a bit array of the specified size */
1619-#define sizeof_bit_array(bits) ((bits + 7) / 8)
1620-
1621-#define INDENT " "
1622-#define INDENT2 " "
1623-#define INDENT3 " "
1624-
1625-namespace mi = mir::input;
1626-
1627-namespace android {
1628-
1629-static const char *WAKE_LOCK_ID = "KeyEvents";
1630-static const char *DEVICE_PATH = "/dev/input";
1631-
1632-/* return the larger integer */
1633-static inline int max(int v1, int v2)
1634-{
1635- return (v1 > v2) ? v1 : v2;
1636-}
1637-
1638-static inline const char* toString(bool value) {
1639- return value ? "true" : "false";
1640-}
1641-
1642-namespace detail
1643-{
1644-String8 sha1(const String8& in) {
1645- boost::uuids::detail::sha1 hasher;
1646- hasher.process_bytes(in.data(), in.size());
1647-
1648- unsigned int digest[5];
1649- hasher.get_digest(digest);
1650-
1651- String8 out;
1652- for(int i : digest) {
1653- appendFormat(out, "%08x", i);
1654- }
1655-
1656- return out;
1657-}
1658-}
1659-
1660-using detail::sha1;
1661-
1662-static void setDescriptor(InputDeviceIdentifier& identifier) {
1663- // Compute a device descriptor that uniquely identifies the device.
1664- // The descriptor is assumed to be a stable identifier. Its value should not
1665- // change between reboots, reconnections, firmware updates or new releases of Android.
1666- // Ideally, we also want the descriptor to be short and relatively opaque.
1667- String8 rawDescriptor;
1668- appendFormat(rawDescriptor, ":%04x:%04x:", identifier.vendor, identifier.product);
1669- if (!isEmpty(identifier.uniqueId)) {
1670- rawDescriptor.append("uniqueId:");
1671- rawDescriptor.append(identifier.uniqueId);
1672- } if (identifier.vendor == 0 && identifier.product == 0) {
1673- // If we don't know the vendor and product id, then the device is probably
1674- // built-in so we need to rely on other information to uniquely identify
1675- // the input device. Usually we try to avoid relying on the device name or
1676- // location but for built-in input device, they are unlikely to ever change.
1677- if (!isEmpty(identifier.name)) {
1678- rawDescriptor.append("name:");
1679- rawDescriptor.append(identifier.name);
1680- } else if (!isEmpty(identifier.location)) {
1681- rawDescriptor.append("location:");
1682- rawDescriptor.append(identifier.location);
1683- }
1684- }
1685- identifier.descriptor = sha1(rawDescriptor);
1686- ALOGV("Created descriptor: raw=%s, cooked=%s", c_str(rawDescriptor),
1687- c_str(identifier.descriptor));
1688-}
1689-
1690-// --- EventHub::Device ---
1691-
1692-EventHub::Device::Device(int fd, int32_t id, const String8& path,
1693- const InputDeviceIdentifier& identifier) :
1694- next(NULL),
1695- fd(fd), id(id), path(path), identifier(identifier),
1696- classes(0), configuration(NULL), virtualKeyMap(NULL),
1697- ffEffectPlaying(false), ffEffectId(-1) {
1698- memset(keyBitmask, 0, sizeof(keyBitmask));
1699- memset(absBitmask, 0, sizeof(absBitmask));
1700- memset(relBitmask, 0, sizeof(relBitmask));
1701- memset(swBitmask, 0, sizeof(swBitmask));
1702- memset(ledBitmask, 0, sizeof(ledBitmask));
1703- memset(ffBitmask, 0, sizeof(ffBitmask));
1704- memset(propBitmask, 0, sizeof(propBitmask));
1705-}
1706-
1707-EventHub::Device::~Device() {
1708- close();
1709- delete configuration;
1710- delete virtualKeyMap;
1711-}
1712-
1713-void EventHub::Device::close() {
1714- if (fd >= 0) {
1715- ::close(fd);
1716- fd = -1;
1717- }
1718-}
1719-
1720-
1721-// --- EventHub ---
1722-
1723-const uint32_t EventHub::EPOLL_ID_UDEV;
1724-const uint32_t EventHub::EPOLL_ID_WAKE;
1725-const uint32_t EventHub::EPOLL_ID_TIMER;
1726-const int EventHub::EPOLL_SIZE_HINT;
1727-const int EventHub::EPOLL_MAX_EVENTS;
1728-
1729-EventHub::EventHub(std::shared_ptr<mi::InputReport> const& input_report) :
1730- input_report(input_report),
1731- device_listener{new mir::udev::Monitor{mir::udev::Context()}},
1732- mBuiltInKeyboardId(NO_BUILT_IN_KEYBOARD), mNextDeviceId(1),
1733- mOpeningDevices(0), mClosingDevices(0),
1734- mNeedToSendFinishedDeviceScan(false),
1735- mNeedToReopenDevices(false), mNeedToScanDevices(true),
1736- mEpollFd{epoll_create(EPOLL_SIZE_HINT)},
1737- mTimerFd{timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK|TFD_CLOEXEC)},
1738- mPendingEventCount(0), mPendingEventIndex(0), mPendingUdevEvent(false) {
1739- acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
1740-
1741- LOG_ALWAYS_FATAL_IF(mEpollFd < 0, "Could not create epoll instance. errno=%d", errno);
1742- LOG_ALWAYS_FATAL_IF(mTimerFd < 0, "Could not create timerfd. errno=%d", errno);
1743-
1744- device_listener->filter_by_subsystem("input");
1745- device_listener->enable();
1746-
1747-
1748- struct epoll_event eventItem;
1749- memset(&eventItem, 0, sizeof(eventItem));
1750- eventItem.events = EPOLLIN;
1751- eventItem.data.u32 = EPOLL_ID_UDEV;
1752- int result = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, device_listener->fd(), &eventItem);
1753- LOG_ALWAYS_FATAL_IF(result != 0, "Could not add Udev monitor to epoll instance. errno=%d", errno);
1754-
1755- int wakeFds[2];
1756- result = pipe(wakeFds);
1757- LOG_ALWAYS_FATAL_IF(result != 0, "Could not create wake pipe. errno=%d", errno);
1758-
1759- mWakeReadPipeFd = wakeFds[0];
1760- mWakeWritePipeFd = wakeFds[1];
1761-
1762- result = fcntl(mWakeReadPipeFd, F_SETFL, O_NONBLOCK);
1763- LOG_ALWAYS_FATAL_IF(result != 0, "Could not make wake read pipe non-blocking. errno=%d",
1764- errno);
1765-
1766- result = fcntl(mWakeWritePipeFd, F_SETFL, O_NONBLOCK);
1767- LOG_ALWAYS_FATAL_IF(result != 0, "Could not make wake write pipe non-blocking. errno=%d",
1768- errno);
1769-
1770- eventItem.data.u32 = EPOLL_ID_WAKE;
1771- result = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, mWakeReadPipeFd, &eventItem);
1772- LOG_ALWAYS_FATAL_IF(result != 0, "Could not add wake read pipe to epoll instance. errno=%d",
1773- errno);
1774-
1775- eventItem.data.u32 = EPOLL_ID_TIMER;
1776- result = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, mTimerFd, &eventItem);
1777- LOG_ALWAYS_FATAL_IF(result != 0, "Could not add timer fd to epoll instance. errno=%d",
1778- errno);
1779-}
1780-
1781-EventHub::~EventHub(void) {
1782- closeAllDevicesLocked();
1783-
1784- while (mClosingDevices) {
1785- Device* device = mClosingDevices;
1786- mClosingDevices = device->next;
1787- delete device;
1788- }
1789-
1790- ::close(mWakeReadPipeFd);
1791- ::close(mWakeWritePipeFd);
1792-
1793- release_wake_lock(WAKE_LOCK_ID);
1794-}
1795-
1796-InputDeviceIdentifier EventHub::getDeviceIdentifier(int32_t deviceId) const {
1797- AutoMutex _l(mLock);
1798- Device* device = getDeviceLocked(deviceId);
1799- if (device == NULL) return InputDeviceIdentifier();
1800- return device->identifier;
1801-}
1802-
1803-uint32_t EventHub::getDeviceClasses(int32_t deviceId) const {
1804- AutoMutex _l(mLock);
1805- Device* device = getDeviceLocked(deviceId);
1806- if (device == NULL) return 0;
1807- return device->classes;
1808-}
1809-
1810-void EventHub::getConfiguration(int32_t deviceId, PropertyMap* outConfiguration) const {
1811- AutoMutex _l(mLock);
1812- Device* device = getDeviceLocked(deviceId);
1813- if (device && device->configuration) {
1814- *outConfiguration = *device->configuration;
1815- } else {
1816- outConfiguration->clear();
1817- }
1818-}
1819-
1820-status_t EventHub::getAbsoluteAxisInfo(int32_t deviceId, int axis,
1821- RawAbsoluteAxisInfo* outAxisInfo) const {
1822- outAxisInfo->clear();
1823-
1824- if (axis >= 0 && axis <= ABS_MAX) {
1825- AutoMutex _l(mLock);
1826-
1827- Device* device = getDeviceLocked(deviceId);
1828- if (device && !device->isVirtual() && test_bit(axis, device->absBitmask)) {
1829- struct input_absinfo info;
1830- if(ioctl(device->fd, EVIOCGABS(axis), &info)) {
1831- ALOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
1832- axis, c_str(device->identifier.name), device->fd, errno);
1833- return -errno;
1834- }
1835-
1836- if (info.minimum != info.maximum) {
1837- outAxisInfo->valid = true;
1838- outAxisInfo->minValue = info.minimum;
1839- outAxisInfo->maxValue = info.maximum;
1840- outAxisInfo->flat = info.flat;
1841- outAxisInfo->fuzz = info.fuzz;
1842- outAxisInfo->resolution = info.resolution;
1843- }
1844- return OK;
1845- }
1846- }
1847- return -1;
1848-}
1849-
1850-bool EventHub::hasRelativeAxis(int32_t deviceId, int axis) const {
1851- if (axis >= 0 && axis <= REL_MAX) {
1852- AutoMutex _l(mLock);
1853-
1854- Device* device = getDeviceLocked(deviceId);
1855- if (device) {
1856- return test_bit(axis, device->relBitmask);
1857- }
1858- }
1859- return false;
1860-}
1861-
1862-bool EventHub::hasInputProperty(int32_t deviceId, int property) const {
1863- if (property >= 0 && property <= INPUT_PROP_MAX) {
1864- AutoMutex _l(mLock);
1865-
1866- Device* device = getDeviceLocked(deviceId);
1867- if (device) {
1868- return test_bit(property, device->propBitmask);
1869- }
1870- }
1871- return false;
1872-}
1873-
1874-int32_t EventHub::getScanCodeState(int32_t deviceId, int32_t scanCode) const {
1875- if (scanCode >= 0 && scanCode <= KEY_MAX) {
1876- AutoMutex _l(mLock);
1877-
1878- Device* device = getDeviceLocked(deviceId);
1879- if (device && !device->isVirtual() && test_bit(scanCode, device->keyBitmask)) {
1880- uint8_t keyState[sizeof_bit_array(KEY_MAX + 1)];
1881- memset(keyState, 0, sizeof(keyState));
1882- if (ioctl(device->fd, EVIOCGKEY(sizeof(keyState)), keyState) >= 0) {
1883- return test_bit(scanCode, keyState) ? AKEY_STATE_DOWN : AKEY_STATE_UP;
1884- }
1885- }
1886- }
1887- return AKEY_STATE_UNKNOWN;
1888-}
1889-
1890-int32_t EventHub::getKeyCodeState(int32_t deviceId, int32_t keyCode) const {
1891- AutoMutex _l(mLock);
1892-
1893- Device* device = getDeviceLocked(deviceId);
1894- if (device && !device->isVirtual() && device->keyMap.haveKeyLayout()) {
1895- Vector<int32_t> scanCodes;
1896- device->keyMap.keyLayoutMap->findScanCodesForKey(keyCode, &scanCodes);
1897- if (scanCodes.size() != 0) {
1898- uint8_t keyState[sizeof_bit_array(KEY_MAX + 1)];
1899- memset(keyState, 0, sizeof(keyState));
1900- if (ioctl(device->fd, EVIOCGKEY(sizeof(keyState)), keyState) >= 0) {
1901- for (size_t i = 0; i < scanCodes.size(); i++) {
1902- int32_t sc = scanCodes.itemAt(i);
1903- if (sc >= 0 && sc <= KEY_MAX && test_bit(sc, keyState)) {
1904- return AKEY_STATE_DOWN;
1905- }
1906- }
1907- return AKEY_STATE_UP;
1908- }
1909- }
1910- }
1911- return AKEY_STATE_UNKNOWN;
1912-}
1913-
1914-int32_t EventHub::getSwitchState(int32_t deviceId, int32_t sw) const {
1915- if (sw >= 0 && sw <= SW_MAX) {
1916- AutoMutex _l(mLock);
1917-
1918- Device* device = getDeviceLocked(deviceId);
1919- if (device && !device->isVirtual() && test_bit(sw, device->swBitmask)) {
1920- uint8_t swState[sizeof_bit_array(SW_MAX + 1)];
1921- memset(swState, 0, sizeof(swState));
1922- if (ioctl(device->fd, EVIOCGSW(sizeof(swState)), swState) >= 0) {
1923- return test_bit(sw, swState) ? AKEY_STATE_DOWN : AKEY_STATE_UP;
1924- }
1925- }
1926- }
1927- return AKEY_STATE_UNKNOWN;
1928-}
1929-
1930-status_t EventHub::getAbsoluteAxisValue(int32_t deviceId, int32_t axis, int32_t* outValue) const {
1931- *outValue = 0;
1932-
1933- if (axis >= 0 && axis <= ABS_MAX) {
1934- AutoMutex _l(mLock);
1935-
1936- Device* device = getDeviceLocked(deviceId);
1937- if (device && !device->isVirtual() && test_bit(axis, device->absBitmask)) {
1938- struct input_absinfo info;
1939- if(ioctl(device->fd, EVIOCGABS(axis), &info)) {
1940- ALOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
1941- axis, c_str(device->identifier.name), device->fd, errno);
1942- return -errno;
1943- }
1944-
1945- *outValue = info.value;
1946- return OK;
1947- }
1948- }
1949- return -1;
1950-}
1951-
1952-bool EventHub::markSupportedKeyCodes(int32_t deviceId, size_t numCodes,
1953- const int32_t* keyCodes, uint8_t* outFlags) const {
1954- AutoMutex _l(mLock);
1955-
1956- Device* device = getDeviceLocked(deviceId);
1957- if (device && device->keyMap.haveKeyLayout()) {
1958- Vector<int32_t> scanCodes;
1959- for (size_t codeIndex = 0; codeIndex < numCodes; codeIndex++) {
1960- scanCodes.clear();
1961-
1962- status_t err = device->keyMap.keyLayoutMap->findScanCodesForKey(
1963- keyCodes[codeIndex], &scanCodes);
1964- if (! err) {
1965- // check the possible scan codes identified by the layout map against the
1966- // map of codes actually emitted by the driver
1967- for (size_t sc = 0; sc < scanCodes.size(); sc++) {
1968- if (test_bit(scanCodes[sc], device->keyBitmask)) {
1969- outFlags[codeIndex] = 1;
1970- break;
1971- }
1972- }
1973- }
1974- }
1975- return true;
1976- }
1977- return false;
1978-}
1979-
1980-status_t EventHub::mapKey(int32_t deviceId, int32_t scanCode, int32_t usageCode,
1981- int32_t* outKeycode, uint32_t* outFlags) const {
1982- AutoMutex _l(mLock);
1983- Device* device = getDeviceLocked(deviceId);
1984-
1985- if (device) {
1986- // Check the key character map first.
1987- sp<KeyCharacterMap> kcm = device->getKeyCharacterMap();
1988- if (kcm != NULL) {
1989- if (!kcm->mapKey(scanCode, usageCode, outKeycode)) {
1990- *outFlags = 0;
1991- return NO_ERROR;
1992- }
1993- }
1994-
1995- // Check the key layout next.
1996- if (device->keyMap.haveKeyLayout()) {
1997- if (!device->keyMap.keyLayoutMap->mapKey(
1998- scanCode, usageCode, outKeycode, outFlags)) {
1999- return NO_ERROR;
2000- }
2001- }
2002- }
2003-
2004- *outKeycode = 0;
2005- *outFlags = 0;
2006- return NAME_NOT_FOUND;
2007-}
2008-
2009-status_t EventHub::mapAxis(int32_t deviceId, int32_t scanCode, AxisInfo* outAxisInfo) const {
2010- AutoMutex _l(mLock);
2011- Device* device = getDeviceLocked(deviceId);
2012-
2013- if (device && device->keyMap.haveKeyLayout()) {
2014- status_t err = device->keyMap.keyLayoutMap->mapAxis(scanCode, outAxisInfo);
2015- if (err == NO_ERROR) {
2016- return NO_ERROR;
2017- }
2018- }
2019-
2020- return NAME_NOT_FOUND;
2021-}
2022-
2023-void EventHub::setExcludedDevices(const Vector<String8>& devices) {
2024- AutoMutex _l(mLock);
2025-
2026- mExcludedDevices = devices;
2027-}
2028-
2029-bool EventHub::hasScanCode(int32_t deviceId, int32_t scanCode) const {
2030- AutoMutex _l(mLock);
2031- Device* device = getDeviceLocked(deviceId);
2032- if (device && scanCode >= 0 && scanCode <= KEY_MAX) {
2033- if (test_bit(scanCode, device->keyBitmask)) {
2034- return true;
2035- }
2036- }
2037- return false;
2038-}
2039-
2040-bool EventHub::hasLed(int32_t deviceId, int32_t led) const {
2041- AutoMutex _l(mLock);
2042- Device* device = getDeviceLocked(deviceId);
2043- if (device && led >= 0 && led <= LED_MAX) {
2044- if (test_bit(led, device->ledBitmask)) {
2045- return true;
2046- }
2047- }
2048- return false;
2049-}
2050-
2051-void EventHub::setLedState(int32_t deviceId, int32_t led, bool on) {
2052- AutoMutex _l(mLock);
2053- Device* device = getDeviceLocked(deviceId);
2054- if (device && !device->isVirtual() && led >= 0 && led <= LED_MAX) {
2055- struct input_event ev;
2056- ev.time.tv_sec = 0;
2057- ev.time.tv_usec = 0;
2058- ev.type = EV_LED;
2059- ev.code = led;
2060- ev.value = on ? 1 : 0;
2061-
2062- ssize_t nWrite;
2063- do {
2064- nWrite = write(device->fd, &ev, sizeof(struct input_event));
2065- } while (nWrite == -1 && errno == EINTR);
2066- }
2067-}
2068-
2069-void EventHub::getVirtualKeyDefinitions(int32_t deviceId,
2070- Vector<VirtualKeyDefinition>& outVirtualKeys) const {
2071- outVirtualKeys.clear();
2072-
2073- AutoMutex _l(mLock);
2074- Device* device = getDeviceLocked(deviceId);
2075- if (device && device->virtualKeyMap) {
2076- outVirtualKeys.appendVector(device->virtualKeyMap->getVirtualKeys());
2077- }
2078-}
2079-
2080-sp<KeyCharacterMap> EventHub::getKeyCharacterMap(int32_t deviceId) const {
2081- AutoMutex _l(mLock);
2082- Device* device = getDeviceLocked(deviceId);
2083- if (device) {
2084- return device->getKeyCharacterMap();
2085- }
2086- return NULL;
2087-}
2088-
2089-bool EventHub::setKeyboardLayoutOverlay(int32_t deviceId,
2090- const sp<KeyCharacterMap>& map) {
2091- AutoMutex _l(mLock);
2092- Device* device = getDeviceLocked(deviceId);
2093- if (device) {
2094- if (map != device->overlayKeyMap) {
2095- device->overlayKeyMap = map;
2096- device->combinedKeyMap = KeyCharacterMap::combine(
2097- device->keyMap.keyCharacterMap, map);
2098- return true;
2099- }
2100- }
2101- return false;
2102-}
2103-
2104-void EventHub::vibrate(int32_t deviceId, std::chrono::nanoseconds duration) {
2105- AutoMutex _l(mLock);
2106- Device* device = getDeviceLocked(deviceId);
2107- if (device && !device->isVirtual()) {
2108- ff_effect effect;
2109- memset(&effect, 0, sizeof(effect));
2110- effect.type = FF_RUMBLE;
2111- effect.id = device->ffEffectId;
2112- effect.u.rumble.strong_magnitude = 0xc000;
2113- effect.u.rumble.weak_magnitude = 0xc000;
2114- effect.replay.length = (duration + std::chrono::nanoseconds(999999)) / std::chrono::nanoseconds(1000000LL);
2115- effect.replay.delay = 0;
2116- if (ioctl(device->fd, EVIOCSFF, &effect)) {
2117- ALOGW("Could not upload force feedback effect to device %s due to error %d.",
2118- c_str(device->identifier.name), errno);
2119- return;
2120- }
2121- device->ffEffectId = effect.id;
2122-
2123- struct input_event ev;
2124- ev.time.tv_sec = 0;
2125- ev.time.tv_usec = 0;
2126- ev.type = EV_FF;
2127- ev.code = device->ffEffectId;
2128- ev.value = 1;
2129- if (write(device->fd, &ev, sizeof(ev)) != sizeof(ev)) {
2130- ALOGW("Could not start force feedback effect on device %s due to error %d.",
2131- c_str(device->identifier.name), errno);
2132- return;
2133- }
2134- device->ffEffectPlaying = true;
2135- }
2136-}
2137-
2138-void EventHub::cancelVibrate(int32_t deviceId) {
2139- AutoMutex _l(mLock);
2140- Device* device = getDeviceLocked(deviceId);
2141- if (device && !device->isVirtual()) {
2142- if (device->ffEffectPlaying) {
2143- device->ffEffectPlaying = false;
2144-
2145- struct input_event ev;
2146- ev.time.tv_sec = 0;
2147- ev.time.tv_usec = 0;
2148- ev.type = EV_FF;
2149- ev.code = device->ffEffectId;
2150- ev.value = 0;
2151- if (write(device->fd, &ev, sizeof(ev)) != sizeof(ev)) {
2152- ALOGW("Could not stop force feedback effect on device %s due to error %d.",
2153- c_str(device->identifier.name), errno);
2154- return;
2155- }
2156- }
2157- }
2158-}
2159-
2160-EventHub::Device* EventHub::getDeviceLocked(int32_t deviceId) const {
2161- if (deviceId == BUILT_IN_KEYBOARD_ID) {
2162- deviceId = mBuiltInKeyboardId;
2163- }
2164- ssize_t index = mDevices.indexOfKey(deviceId);
2165- return index >= 0 ? mDevices.valueAt(index) : NULL;
2166-}
2167-
2168-EventHub::Device* EventHub::getDeviceByPathLocked(const char* devicePath) const {
2169- for (size_t i = 0; i < mDevices.size(); i++) {
2170- Device* device = mDevices.valueAt(i);
2171- if (device->path == devicePath) {
2172- return device;
2173- }
2174- }
2175- return NULL;
2176-}
2177-
2178-size_t EventHub::getEvents(RawEvent* buffer, size_t bufferSize) {
2179- ALOG_ASSERT(bufferSize >= 1);
2180-
2181- AutoMutex _l(mLock);
2182-
2183- struct input_event readBuffer[bufferSize];
2184-
2185- RawEvent* event = buffer;
2186- size_t capacity = bufferSize;
2187- bool awoken = false;
2188- for (;;) {
2189- std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
2190-
2191- // Reopen input devices if needed.
2192- if (mNeedToReopenDevices) {
2193- mNeedToReopenDevices = false;
2194-
2195- ALOGI("Reopening all input devices due to a configuration change.");
2196-
2197- closeAllDevicesLocked();
2198- mNeedToScanDevices = true;
2199- break; // return to the caller before we actually rescan
2200- }
2201-
2202- // Report any devices that had last been added/removed.
2203- while (mClosingDevices) {
2204- Device* device = mClosingDevices;
2205- ALOGV("Reporting device closed: id=%d, name=%s\n",
2206- device->id, c_str(device->path));
2207- mClosingDevices = device->next;
2208- event->when = now;
2209- event->deviceId = device->id == mBuiltInKeyboardId ? BUILT_IN_KEYBOARD_ID : device->id;
2210- event->type = DEVICE_REMOVED;
2211- event += 1;
2212- delete device;
2213- mNeedToSendFinishedDeviceScan = true;
2214- if (--capacity == 0) {
2215- break;
2216- }
2217- }
2218-
2219- if (mNeedToScanDevices) {
2220- mNeedToScanDevices = false;
2221- scanDevicesLocked();
2222- mNeedToSendFinishedDeviceScan = true;
2223- }
2224-
2225- while (mOpeningDevices != NULL) {
2226- Device* device = mOpeningDevices;
2227- ALOGV("Reporting device opened: id=%d, name=%s\n",
2228- device->id, c_str(device->path));
2229- mOpeningDevices = device->next;
2230- event->when = now;
2231- event->deviceId = device->id == mBuiltInKeyboardId ? 0 : device->id;
2232- event->type = DEVICE_ADDED;
2233- event += 1;
2234- mNeedToSendFinishedDeviceScan = true;
2235- if (--capacity == 0) {
2236- break;
2237- }
2238- }
2239-
2240- if (mNeedToSendFinishedDeviceScan) {
2241- mNeedToSendFinishedDeviceScan = false;
2242- event->when = now;
2243- event->type = FINISHED_DEVICE_SCAN;
2244- event += 1;
2245- if (--capacity == 0) {
2246- break;
2247- }
2248- }
2249-
2250- // Grab the next input event.
2251- bool deviceChanged = false;
2252- while (mPendingEventIndex < mPendingEventCount) {
2253- const struct epoll_event& eventItem = mPendingEventItems[mPendingEventIndex++];
2254- if (eventItem.data.u32 == EPOLL_ID_UDEV) {
2255- if (eventItem.events & EPOLLIN) {
2256- mPendingUdevEvent = true;
2257- } else {
2258- ALOGW("Received unexpected epoll event 0x%08x for INotify.", eventItem.events);
2259- }
2260- continue;
2261- }
2262-
2263- if (eventItem.data.u32 == EPOLL_ID_WAKE) {
2264- if (eventItem.events & EPOLLIN) {
2265- ALOGV("awoken after wake()");
2266- awoken = true;
2267- char buffer[16];
2268- ssize_t nRead;
2269- do {
2270- nRead = read(mWakeReadPipeFd, buffer, sizeof(buffer));
2271- } while ((nRead == -1 && errno == EINTR) || nRead == sizeof(buffer));
2272- } else {
2273- ALOGW("Received unexpected epoll event 0x%08x for wake read pipe.",
2274- eventItem.events);
2275- }
2276- continue;
2277- }
2278-
2279- if (eventItem.data.u32 == EPOLL_ID_TIMER) {
2280- if (eventItem.events & EPOLLIN) {
2281- ALOGV("awoken after wakeIn()");
2282- awoken = true;
2283- uint64_t timeout_count;
2284- read(mTimerFd, &timeout_count, sizeof timeout_count);
2285- } else {
2286- ALOGW("Received unexpected epoll event 0x%08x for wake read pipe.",
2287- eventItem.events);
2288- }
2289- continue;
2290- }
2291-
2292- ssize_t deviceIndex = mDevices.indexOfKey(eventItem.data.u32);
2293- if (deviceIndex < 0) {
2294- ALOGW("Received unexpected epoll event 0x%08x for unknown device id %d.",
2295- eventItem.events, eventItem.data.u32);
2296- continue;
2297- }
2298-
2299- Device* device = mDevices.valueAt(deviceIndex);
2300- if (eventItem.events & EPOLLIN) {
2301- int32_t readSize = read(device->fd, readBuffer,
2302- sizeof(struct input_event) * capacity);
2303- if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
2304- // Device was removed before INotify noticed.
2305- ALOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d "
2306- "capacity: %d errno: %d)\n",
2307- device->fd, readSize, bufferSize, capacity, errno);
2308- deviceChanged = true;
2309- closeDeviceLocked(device);
2310- } else if (readSize < 0) {
2311- if (errno != EAGAIN && errno != EINTR) {
2312- ALOGW("could not get event (errno=%d)", errno);
2313- }
2314- } else if ((readSize % sizeof(struct input_event)) != 0) {
2315- ALOGE("could not get event (wrong size: %d)", readSize);
2316- } else {
2317- int32_t deviceId = device->id == mBuiltInKeyboardId ? 0 : device->id;
2318-
2319- size_t count = size_t(readSize) / sizeof(struct input_event);
2320- for (size_t i = 0; i < count; i++) {
2321- const struct input_event& iev = readBuffer[i];
2322- ALOGV("%s got: t0=%d, t1=%d, type=%d, code=%d, value=%d",
2323- c_str(device->path),
2324- (int) iev.time.tv_sec, (int) iev.time.tv_usec,
2325- iev.type, iev.code, iev.value);
2326-
2327-#ifdef HAVE_POSIX_CLOCKS
2328- // Use the time specified in the event instead of the current time
2329- // so that downstream code can get more accurate estimates of
2330- // event dispatch latency from the time the event is enqueued onto
2331- // the evdev client buffer.
2332- //
2333- // The event's timestamp fortuitously uses the same monotonic clock
2334- // time base as the rest of Android. The kernel event device driver
2335- // (drivers/input/evdev.c) obtains timestamps using ktime_get_ts().
2336- // The systemTime(SYSTEM_TIME_MONOTONIC) function we use everywhere
2337- // calls clock_gettime(CLOCK_MONOTONIC) which is implemented as a
2338- // system call that also queries ktime_get_ts().
2339- event->when = std::chrono::nanoseconds(iev.time.tv_sec) * 1000000000LL
2340- + std::chrono::nanoseconds(iev.time.tv_usec) * 1000LL;
2341- ALOGV("event time %lld, now %lld", event->when, now);
2342-#else
2343- event->when = now;
2344-#endif
2345- event->deviceId = deviceId;
2346- event->type = iev.type;
2347- event->code = iev.code;
2348- event->value = iev.value;
2349-
2350- input_report->received_event_from_kernel(event->when.count(), event->type, event->code, event->value);
2351-
2352- event += 1;
2353- }
2354- capacity -= count;
2355- if (capacity == 0) {
2356- // The result buffer is full. Reset the pending event index
2357- // so we will try to read the device again on the next iteration.
2358- mPendingEventIndex -= 1;
2359- break;
2360- }
2361- }
2362- } else if (eventItem.events & EPOLLHUP) {
2363- ALOGI("Removing device %s due to epoll hang-up event.",
2364- c_str(device->identifier.name));
2365- deviceChanged = true;
2366- closeDeviceLocked(device);
2367- } else {
2368- ALOGW("Received unexpected epoll event 0x%08x for device %s.",
2369- eventItem.events, c_str(device->identifier.name));
2370- }
2371- }
2372-
2373- // readNotify() will modify the list of devices so this must be done after
2374- // processing all other events to ensure that we read all remaining events
2375- // before closing the devices.
2376- if (mPendingUdevEvent && mPendingEventIndex >= mPendingEventCount) {
2377- mPendingUdevEvent = false;
2378- handleUdevEventsLocked();
2379- deviceChanged = true;
2380- }
2381-
2382- // Report added or removed devices immediately.
2383- if (deviceChanged) {
2384- continue;
2385- }
2386-
2387- // Return now if we have collected any events or if we were explicitly awoken.
2388- if (event != buffer || awoken) {
2389- break;
2390- }
2391-
2392- // Poll for events. Mind the wake lock dance!
2393- // We hold a wake lock at all times except during epoll_wait(). This works due to some
2394- // subtle choreography. When a device driver has pending (unread) events, it acquires
2395- // a kernel wake lock. However, once the last pending event has been read, the device
2396- // driver will release the kernel wake lock. To prevent the system from going to sleep
2397- // when this happens, the EventHub holds onto its own user wake lock while the client
2398- // is processing events. Thus the system can only sleep if there are no events
2399- // pending or currently being processed.
2400- mPendingEventIndex = 0;
2401-
2402- mLock.unlock(); // release lock before poll, must be before release_wake_lock
2403- release_wake_lock(WAKE_LOCK_ID);
2404-
2405- // non blocking call to epoll_wait - blocking happens in dispatch threads
2406- int pollResult = epoll_wait(mEpollFd, mPendingEventItems, EPOLL_MAX_EVENTS, 0);
2407-
2408- acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
2409- mLock.lock(); // reacquire lock after poll, must be after acquire_wake_lock
2410-
2411- if (pollResult == 0) {
2412- // Timed out.
2413- mPendingEventCount = 0;
2414- break;
2415- }
2416-
2417- if (pollResult < 0) {
2418- // An error occurred.
2419- mPendingEventCount = 0;
2420-
2421- // Sleep after errors to avoid locking up the system.
2422- // Hopefully the error is transient.
2423- if (errno != EINTR) {
2424- ALOGW("poll failed (errno=%d)\n", errno);
2425- usleep(100000);
2426- }
2427- } else {
2428- // Some events occurred.
2429- mPendingEventCount = size_t(pollResult);
2430- }
2431- }
2432-
2433- // All done, return the number of events we read.
2434- return event - buffer;
2435-}
2436-
2437-void EventHub::wakeIn(int32_t timeoutMillis) {
2438- itimerspec delay;
2439- std::memset(&delay, 0, sizeof delay);
2440-
2441- delay.it_value.tv_sec = timeoutMillis / 1000;
2442- delay.it_value.tv_nsec = (timeoutMillis % 1000) * 1000000LL;
2443- timerfd_settime(mTimerFd, 0, &delay, nullptr);
2444-}
2445-
2446-void EventHub::wake() {
2447- ALOGV("wake() called");
2448-
2449- ssize_t nWrite;
2450- do {
2451- nWrite = write(mWakeWritePipeFd, "W", 1);
2452- } while (nWrite == -1 && errno == EINTR);
2453-
2454- if (nWrite != 1 && errno != EAGAIN) {
2455- ALOGW("Could not write wake signal, errno=%d", errno);
2456- }
2457-}
2458-
2459-void EventHub::scanDevicesLocked() {
2460- mir::udev::Enumerator input_enumerator{std::make_shared<mir::udev::Context>()};
2461-
2462- input_enumerator.match_subsystem("input");
2463- input_enumerator.scan_devices();
2464-
2465- for (auto& device : input_enumerator)
2466- {
2467- if (device.devnode() != nullptr)
2468- {
2469- openDeviceLocked(device.devnode());
2470- }
2471- }
2472-
2473- if (mDevices.indexOfKey(VIRTUAL_KEYBOARD_ID) < 0) {
2474- createVirtualKeyboardLocked();
2475- }
2476-}
2477-
2478-void EventHub::handleUdevEventsLocked()
2479-{
2480- device_listener->process_events([this](mir::udev::Monitor::EventType type, mir::udev::Device const& dev){
2481- if (type == mir::udev::Monitor::ADDED)
2482- {
2483- if (dev.devnode() != nullptr)
2484- {
2485- openDeviceLocked(dev.devnode());
2486- }
2487- }
2488- else if (type == mir::udev::Monitor::REMOVED)
2489- {
2490- if (dev.devnode() != nullptr)
2491- {
2492- closeDeviceByPathLocked(dev.devnode());
2493- }
2494- }
2495- });
2496-}
2497-
2498-// ----------------------------------------------------------------------------
2499-
2500-static bool containsNonZeroByte(const uint8_t* array, uint32_t startIndex, uint32_t endIndex) {
2501- const uint8_t* end = array + endIndex;
2502- array += startIndex;
2503- while (array != end) {
2504- if (*(array++) != 0) {
2505- return true;
2506- }
2507- }
2508- return false;
2509-}
2510-
2511-static const int32_t GAMEPAD_KEYCODES[] = {
2512- AKEYCODE_BUTTON_A, AKEYCODE_BUTTON_B, AKEYCODE_BUTTON_C,
2513- AKEYCODE_BUTTON_X, AKEYCODE_BUTTON_Y, AKEYCODE_BUTTON_Z,
2514- AKEYCODE_BUTTON_L1, AKEYCODE_BUTTON_R1,
2515- AKEYCODE_BUTTON_L2, AKEYCODE_BUTTON_R2,
2516- AKEYCODE_BUTTON_THUMBL, AKEYCODE_BUTTON_THUMBR,
2517- AKEYCODE_BUTTON_START, AKEYCODE_BUTTON_SELECT, AKEYCODE_BUTTON_MODE,
2518- AKEYCODE_BUTTON_1, AKEYCODE_BUTTON_2, AKEYCODE_BUTTON_3, AKEYCODE_BUTTON_4,
2519- AKEYCODE_BUTTON_5, AKEYCODE_BUTTON_6, AKEYCODE_BUTTON_7, AKEYCODE_BUTTON_8,
2520- AKEYCODE_BUTTON_9, AKEYCODE_BUTTON_10, AKEYCODE_BUTTON_11, AKEYCODE_BUTTON_12,
2521- AKEYCODE_BUTTON_13, AKEYCODE_BUTTON_14, AKEYCODE_BUTTON_15, AKEYCODE_BUTTON_16,
2522-};
2523-
2524-status_t EventHub::openDeviceLocked(const char *devicePath) {
2525- char buffer[80];
2526-
2527- ALOGV("Opening device: %s", devicePath);
2528- if (hasDeviceByPathLocked(String8(devicePath)))
2529- {
2530- ALOGV("Not opening device (%s), as it is already opened", devicePath);
2531- return -1;
2532- }
2533-
2534- int fd = open(devicePath, O_RDWR | O_CLOEXEC);
2535- if(fd < 0) {
2536- ALOGE("could not open %s, %s\n", devicePath, strerror(errno));
2537- return -1;
2538- }
2539-
2540- InputDeviceIdentifier identifier;
2541-
2542- // Get device name.
2543- if(ioctl(fd, EVIOCGNAME(sizeof(buffer) - 1), &buffer) < 1) {
2544- //fprintf(stderr, "could not get device name for %s, %s\n", devicePath, strerror(errno));
2545- } else {
2546- buffer[sizeof(buffer) - 1] = '\0';
2547- setTo(identifier.name, buffer);
2548- }
2549-
2550- // Check to see if the device is on our excluded list
2551- for (size_t i = 0; i < mExcludedDevices.size(); i++) {
2552- const String8& item = mExcludedDevices.itemAt(i);
2553- if (identifier.name == item) {
2554- ALOGI("ignoring event id %s driver %s\n", devicePath, c_str(item));
2555- close(fd);
2556- return -1;
2557- }
2558- }
2559-
2560- // Get device driver version.
2561- int driverVersion;
2562- if(ioctl(fd, EVIOCGVERSION, &driverVersion)) {
2563- ALOGE("could not get driver version for %s, %s\n", devicePath, strerror(errno));
2564- close(fd);
2565- return -1;
2566- }
2567-
2568- // Get device identifier.
2569- struct input_id inputId;
2570- if(ioctl(fd, EVIOCGID, &inputId)) {
2571- ALOGE("could not get device input id for %s, %s\n", devicePath, strerror(errno));
2572- close(fd);
2573- return -1;
2574- }
2575- identifier.bus = inputId.bustype;
2576- identifier.product = inputId.product;
2577- identifier.vendor = inputId.vendor;
2578- identifier.version = inputId.version;
2579-
2580- // Get device physical location.
2581- if(ioctl(fd, EVIOCGPHYS(sizeof(buffer) - 1), &buffer) < 1) {
2582- //fprintf(stderr, "could not get location for %s, %s\n", devicePath, strerror(errno));
2583- } else {
2584- buffer[sizeof(buffer) - 1] = '\0';
2585- setTo(identifier.location, buffer);
2586- }
2587-
2588- // Get device unique id.
2589- if(ioctl(fd, EVIOCGUNIQ(sizeof(buffer) - 1), &buffer) < 1) {
2590- //fprintf(stderr, "could not get idstring for %s, %s\n", devicePath, strerror(errno));
2591- } else {
2592- buffer[sizeof(buffer) - 1] = '\0';
2593- setTo(identifier.uniqueId, buffer);
2594- }
2595-
2596- // Fill in the descriptor.
2597- setDescriptor(identifier);
2598-
2599- // Make file descriptor non-blocking for use with poll().
2600- if (fcntl(fd, F_SETFL, O_NONBLOCK)) {
2601- ALOGE("Error %d making device file descriptor non-blocking.", errno);
2602- close(fd);
2603- return -1;
2604- }
2605-
2606- // Allocate device. (The device object takes ownership of the fd at this point.)
2607- int32_t deviceId = mNextDeviceId++;
2608- Device* device = new Device(fd, deviceId, String8(devicePath), identifier);
2609-
2610- ALOGV("add device %d: %s\n", deviceId, devicePath);
2611- ALOGV(" bus: %04x\n"
2612- " vendor %04x\n"
2613- " product %04x\n"
2614- " version %04x\n",
2615- identifier.bus, identifier.vendor, identifier.product, identifier.version);
2616- ALOGV(" name: \"%s\"\n", c_str(identifier.name));
2617- ALOGV(" location: \"%s\"\n", c_str(identifier.location));
2618- ALOGV(" unique id: \"%s\"\n", c_str(identifier.uniqueId));
2619- ALOGV(" descriptor: \"%s\"\n", c_str(identifier.descriptor));
2620- ALOGV(" driver: v%d.%d.%d\n",
2621- driverVersion >> 16, (driverVersion >> 8) & 0xff, driverVersion & 0xff);
2622-
2623- // Load the configuration file for the device.
2624- loadConfigurationLocked(device);
2625-
2626- // Figure out the kinds of events the device reports.
2627- ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(device->keyBitmask)), device->keyBitmask);
2628- ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(device->absBitmask)), device->absBitmask);
2629- ioctl(fd, EVIOCGBIT(EV_REL, sizeof(device->relBitmask)), device->relBitmask);
2630- ioctl(fd, EVIOCGBIT(EV_SW, sizeof(device->swBitmask)), device->swBitmask);
2631- ioctl(fd, EVIOCGBIT(EV_LED, sizeof(device->ledBitmask)), device->ledBitmask);
2632- ioctl(fd, EVIOCGBIT(EV_FF, sizeof(device->ffBitmask)), device->ffBitmask);
2633- ioctl(fd, EVIOCGPROP(sizeof(device->propBitmask)), device->propBitmask);
2634-
2635- // See if this is a keyboard. Ignore everything in the button range except for
2636- // joystick and gamepad buttons which are handled like keyboards for the most part.
2637- bool haveKeyboardKeys = containsNonZeroByte(device->keyBitmask, 0, sizeof_bit_array(BTN_MISC))
2638- || containsNonZeroByte(device->keyBitmask, sizeof_bit_array(KEY_OK),
2639- sizeof_bit_array(KEY_MAX + 1));
2640- bool haveGamepadButtons = containsNonZeroByte(device->keyBitmask, sizeof_bit_array(BTN_MISC),
2641- sizeof_bit_array(BTN_MOUSE))
2642- || containsNonZeroByte(device->keyBitmask, sizeof_bit_array(BTN_JOYSTICK),
2643- sizeof_bit_array(BTN_DIGI));
2644- if (haveKeyboardKeys || haveGamepadButtons) {
2645- device->classes |= INPUT_DEVICE_CLASS_KEYBOARD;
2646- }
2647-
2648- // See if this is a cursor device such as a trackball or mouse.
2649- if (test_bit(BTN_MOUSE, device->keyBitmask)
2650- && test_bit(REL_X, device->relBitmask)
2651- && test_bit(REL_Y, device->relBitmask)) {
2652- device->classes |= INPUT_DEVICE_CLASS_CURSOR;
2653- }
2654-
2655- // See if this is a touch pad.
2656- // Is this a new modern multi-touch driver?
2657- if (test_bit(ABS_MT_POSITION_X, device->absBitmask)
2658- && test_bit(ABS_MT_POSITION_Y, device->absBitmask)) {
2659- // Some joysticks such as the PS3 controller report axes that conflict
2660- // with the ABS_MT range. Try to confirm that the device really is
2661- // a touch screen.
2662- if (test_bit(BTN_TOUCH, device->keyBitmask) || !haveGamepadButtons) {
2663- device->classes |= INPUT_DEVICE_CLASS_TOUCH | INPUT_DEVICE_CLASS_TOUCH_MT;
2664- }
2665- // Is this an old style single-touch driver?
2666- } else if (test_bit(BTN_TOUCH, device->keyBitmask)
2667- && test_bit(ABS_X, device->absBitmask)
2668- && test_bit(ABS_Y, device->absBitmask)) {
2669- device->classes |= INPUT_DEVICE_CLASS_TOUCH;
2670- }
2671-
2672- // See if this device is a joystick.
2673- // Assumes that joysticks always have gamepad buttons in order to distinguish them
2674- // from other devices such as accelerometers that also have absolute axes.
2675- if (haveGamepadButtons) {
2676- uint32_t assumedClasses = device->classes | INPUT_DEVICE_CLASS_JOYSTICK;
2677- for (int i = 0; i <= ABS_MAX; i++) {
2678- if (test_bit(i, device->absBitmask)
2679- && (getAbsAxisUsage(i, assumedClasses) & INPUT_DEVICE_CLASS_JOYSTICK)) {
2680- device->classes = assumedClasses;
2681- break;
2682- }
2683- }
2684- }
2685-
2686- // Check whether this device has switches.
2687- for (int i = 0; i <= SW_MAX; i++) {
2688- if (test_bit(i, device->swBitmask)) {
2689- device->classes |= INPUT_DEVICE_CLASS_SWITCH;
2690- break;
2691- }
2692- }
2693-
2694- // Check whether this device supports the vibrator.
2695- if (test_bit(FF_RUMBLE, device->ffBitmask)) {
2696- device->classes |= INPUT_DEVICE_CLASS_VIBRATOR;
2697- }
2698-
2699- // Configure virtual keys.
2700- if ((device->classes & INPUT_DEVICE_CLASS_TOUCH)) {
2701- // Load the virtual keys for the touch screen, if any.
2702- // We do this now so that we can make sure to load the keymap if necessary.
2703- status_t status = loadVirtualKeyMapLocked(device);
2704- if (!status) {
2705- device->classes |= INPUT_DEVICE_CLASS_KEYBOARD;
2706- }
2707- }
2708-
2709- // Load the key map.
2710- // We need to do this for joysticks too because the key layout may specify axes.
2711- status_t keyMapStatus = NAME_NOT_FOUND;
2712- if (device->classes & (INPUT_DEVICE_CLASS_KEYBOARD | INPUT_DEVICE_CLASS_JOYSTICK)) {
2713- // Load the keymap for the device.
2714- keyMapStatus = loadKeyMapLocked(device);
2715- }
2716-
2717- // Configure the keyboard, gamepad or virtual keyboard.
2718- if (device->classes & INPUT_DEVICE_CLASS_KEYBOARD) {
2719- // Register the keyboard as a built-in keyboard if it is eligible.
2720- if (!keyMapStatus
2721- && mBuiltInKeyboardId == NO_BUILT_IN_KEYBOARD
2722- && isEligibleBuiltInKeyboard(device->identifier,
2723- device->configuration, &device->keyMap)) {
2724- mBuiltInKeyboardId = device->id;
2725- }
2726-
2727- // 'Q' key support = cheap test of whether this is an alpha-capable kbd
2728- if (hasKeycodeLocked(device, AKEYCODE_Q)) {
2729- device->classes |= INPUT_DEVICE_CLASS_ALPHAKEY;
2730- }
2731-
2732- // See if this device has a DPAD.
2733- if (hasKeycodeLocked(device, AKEYCODE_DPAD_UP) &&
2734- hasKeycodeLocked(device, AKEYCODE_DPAD_DOWN) &&
2735- hasKeycodeLocked(device, AKEYCODE_DPAD_LEFT) &&
2736- hasKeycodeLocked(device, AKEYCODE_DPAD_RIGHT) &&
2737- hasKeycodeLocked(device, AKEYCODE_DPAD_CENTER)) {
2738- device->classes |= INPUT_DEVICE_CLASS_DPAD;
2739- }
2740-
2741- // See if this device has a gamepad.
2742- for (size_t i = 0; i < sizeof(GAMEPAD_KEYCODES)/sizeof(GAMEPAD_KEYCODES[0]); i++) {
2743- if (hasKeycodeLocked(device, GAMEPAD_KEYCODES[i])) {
2744- device->classes |= INPUT_DEVICE_CLASS_GAMEPAD;
2745- break;
2746- }
2747- }
2748- }
2749-
2750- // If the device isn't recognized as something we handle, don't monitor it.
2751- if (device->classes == 0) {
2752- ALOGV("Dropping device: id=%d, path='%s', name='%s'",
2753- deviceId, devicePath, c_str(device->identifier.name));
2754- delete device;
2755- return -1;
2756- }
2757-
2758- // Determine whether the device is external or internal.
2759- if (isExternalDeviceLocked(device)) {
2760- device->classes |= INPUT_DEVICE_CLASS_EXTERNAL;
2761- }
2762-
2763- // Register with epoll.
2764- struct epoll_event eventItem;
2765- memset(&eventItem, 0, sizeof(eventItem));
2766- eventItem.events = EPOLLIN;
2767- eventItem.data.u32 = deviceId;
2768- if (epoll_ctl(mEpollFd, EPOLL_CTL_ADD, fd, &eventItem)) {
2769- ALOGE("Could not add device fd to epoll instance. errno=%d", errno);
2770- delete device;
2771- return -1;
2772- }
2773-
2774- // Enable wake-lock behavior on kernels that support it.
2775- // TODO: Only need this for devices that can really wake the system.
2776- bool usingSuspendBlockIoctl = !ioctl(fd, EVIOCSSUSPENDBLOCK, 1);
2777-
2778- // Tell the kernel that we want to use the monotonic clock for reporting timestamps
2779- // associated with input events. This is important because the input system
2780- // uses the timestamps extensively and assumes they were recorded using the monotonic
2781- // clock.
2782- //
2783- // In older kernel, before Linux 3.4, there was no way to tell the kernel which
2784- // clock to use to input event timestamps. The standard kernel behavior was to
2785- // record a real time timestamp, which isn't what we want. Android kernels therefore
2786- // contained a patch to the evdev_event() function in drivers/input/evdev.c to
2787- // replace the call to do_gettimeofday() with ktime_get_ts() to cause the monotonic
2788- // clock to be used instead of the real time clock.
2789- //
2790- // As of Linux 3.4, there is a new EVIOCSCLOCKID ioctl to set the desired clock.
2791- // Therefore, we no longer require the Android-specific kernel patch described above
2792- // as long as we make sure to set select the monotonic clock. We do that here.
2793- int clockId = CLOCK_MONOTONIC;
2794- bool usingClockIoctl = !ioctl(fd, EVIOCSCLOCKID, &clockId);
2795-
2796- ALOGI("New device: id=%d, fd=%d, path='%s', name='%s', classes=0x%x, "
2797- "configuration='%s', keyLayout='%s', keyCharacterMap='%s', builtinKeyboard=%s, "
2798- "usingSuspendBlockIoctl=%s, usingClockIoctl=%s",
2799- deviceId, fd, devicePath, c_str(device->identifier.name),
2800- device->classes,
2801- c_str(device->configurationFile),
2802- c_str(device->keyMap.keyLayoutFile),
2803- c_str(device->keyMap.keyCharacterMapFile),
2804- toString(mBuiltInKeyboardId == deviceId),
2805- toString(usingSuspendBlockIoctl), toString(usingClockIoctl));
2806-
2807- addDeviceLocked(device);
2808- return 0;
2809-}
2810-
2811-void EventHub::createVirtualKeyboardLocked() {
2812- InputDeviceIdentifier identifier;
2813- identifier.name = "Virtual";
2814- identifier.uniqueId = "<virtual>";
2815- setDescriptor(identifier);
2816-
2817- Device* device = new Device(-1, VIRTUAL_KEYBOARD_ID, String8("<virtual>"), identifier);
2818- device->classes = INPUT_DEVICE_CLASS_KEYBOARD
2819- | INPUT_DEVICE_CLASS_ALPHAKEY
2820- | INPUT_DEVICE_CLASS_DPAD
2821- | INPUT_DEVICE_CLASS_VIRTUAL;
2822- loadKeyMapLocked(device);
2823- addDeviceLocked(device);
2824-}
2825-
2826-void EventHub::addDeviceLocked(Device* device) {
2827- mDevices.add(device->id, device);
2828- device->next = mOpeningDevices;
2829- mOpeningDevices = device;
2830-}
2831-
2832-void EventHub::loadConfigurationLocked(Device* device) {
2833- device->configurationFile = getInputDeviceConfigurationFilePathByDeviceIdentifier(
2834- device->identifier, INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION);
2835- if (isEmpty(device->configurationFile)) {
2836- ALOGD("No input device configuration file found for device '%s'.",
2837- c_str(device->identifier.name));
2838- } else {
2839- status_t status = PropertyMap::load(device->configurationFile,
2840- &device->configuration);
2841- if (status) {
2842- ALOGE("Error loading input device configuration file for device '%s'. "
2843- "Using default configuration.",
2844- c_str(device->identifier.name));
2845- }
2846- }
2847-}
2848-
2849-status_t EventHub::loadVirtualKeyMapLocked(Device* device) {
2850- // The virtual key map is supplied by the kernel as a system board property file.
2851- String8 path;
2852- path.append("/sys/board_properties/virtualkeys.");
2853- path.append(device->identifier.name);
2854- if (access(c_str(path), R_OK)) {
2855- return NAME_NOT_FOUND;
2856- }
2857- return VirtualKeyMap::load(path, &device->virtualKeyMap);
2858-}
2859-
2860-status_t EventHub::loadKeyMapLocked(Device* device) {
2861- // <mir changes>
2862- status_t status = device->keyMap.load(device->identifier, device->configuration);
2863- if (status)
2864- status = device->keyMap.loadGenericMaps();
2865-
2866- return status;
2867- // </mir changes>
2868-}
2869-
2870-bool EventHub::isExternalDeviceLocked(Device* device) {
2871- if (device->configuration) {
2872- bool value;
2873- if (device->configuration->tryGetProperty(String8("device.internal"), value)) {
2874- return !value;
2875- }
2876- }
2877- return device->identifier.bus == BUS_USB || device->identifier.bus == BUS_BLUETOOTH;
2878-}
2879-
2880-bool EventHub::hasKeycodeLocked(Device* device, int keycode) const {
2881- if (!device->keyMap.haveKeyLayout()) {
2882- return false;
2883- }
2884-
2885- Vector<int32_t> scanCodes;
2886- device->keyMap.keyLayoutMap->findScanCodesForKey(keycode, &scanCodes);
2887- const size_t N = scanCodes.size();
2888- for (size_t i=0; i<N && i<=KEY_MAX; i++) {
2889- int32_t sc = scanCodes.itemAt(i);
2890- if (sc >= 0 && sc <= KEY_MAX && test_bit(sc, device->keyBitmask)) {
2891- return true;
2892- }
2893- }
2894-
2895- return false;
2896-}
2897-
2898-status_t EventHub::closeDeviceByPathLocked(const char *devicePath) {
2899- Device* device = getDeviceByPathLocked(devicePath);
2900- if (device) {
2901- closeDeviceLocked(device);
2902- return 0;
2903- }
2904- ALOGV("Remove device: %s not found, device may already have been removed.", devicePath);
2905- return -1;
2906-}
2907-
2908-void EventHub::closeAllDevicesLocked() {
2909- while (mDevices.size() > 0) {
2910- closeDeviceLocked(mDevices.valueAt(mDevices.size() - 1));
2911- }
2912-}
2913-
2914-void EventHub::closeDeviceLocked(Device* device) {
2915- ALOGI("Removed device: path=%s name=%s id=%d fd=%d classes=0x%x\n",
2916- c_str(device->path), c_str(device->identifier.name), device->id,
2917- device->fd, device->classes);
2918-
2919- if (device->id == mBuiltInKeyboardId) {
2920- ALOGW("built-in keyboard device %s (id=%d) is closing! the apps will not like this",
2921- c_str(device->path), mBuiltInKeyboardId);
2922- mBuiltInKeyboardId = NO_BUILT_IN_KEYBOARD;
2923- }
2924-
2925- if (!device->isVirtual()) {
2926- if (epoll_ctl(mEpollFd, EPOLL_CTL_DEL, device->fd, NULL)) {
2927- ALOGW("Could not remove device fd from epoll instance. errno=%d", errno);
2928- }
2929- }
2930-
2931- mDevices.removeItem(device->id);
2932- device->close();
2933-
2934- // Unlink for opening devices list if it is present.
2935- Device* pred = NULL;
2936- bool found = false;
2937- for (Device* entry = mOpeningDevices; entry != NULL; ) {
2938- if (entry == device) {
2939- found = true;
2940- break;
2941- }
2942- pred = entry;
2943- entry = entry->next;
2944- }
2945- if (found) {
2946- // Unlink the device from the opening devices list then delete it.
2947- // We don't need to tell the client that the device was closed because
2948- // it does not even know it was opened in the first place.
2949- ALOGI("Device %s was immediately closed after opening.", c_str(device->path));
2950- if (pred) {
2951- pred->next = device->next;
2952- } else {
2953- mOpeningDevices = device->next;
2954- }
2955- delete device;
2956- } else {
2957- // Link into closing devices list.
2958- // The device will be deleted later after we have informed the client.
2959- device->next = mClosingDevices;
2960- mClosingDevices = device;
2961- }
2962-}
2963-
2964-void EventHub::requestReopenDevices() {
2965- ALOGV("requestReopenDevices() called");
2966-
2967- AutoMutex _l(mLock);
2968- mNeedToReopenDevices = true;
2969-}
2970-
2971-void EventHub::dump(String8& dump) {
2972- dump.append("Event Hub State:\n");
2973-
2974- { // acquire lock
2975- AutoMutex _l(mLock);
2976-
2977- appendFormat(dump, INDENT "BuiltInKeyboardId: %d\n", mBuiltInKeyboardId);
2978-
2979- dump.append(INDENT "Devices:\n");
2980-
2981- for (size_t i = 0; i < mDevices.size(); i++) {
2982- const Device* device = mDevices.valueAt(i);
2983- if (mBuiltInKeyboardId == device->id) {
2984- appendFormat(dump, INDENT2 "%d: %s (aka device 0 - built-in keyboard)\n",
2985- device->id, c_str(device->identifier.name));
2986- } else {
2987- appendFormat(dump, INDENT2 "%d: %s\n", device->id,
2988- c_str(device->identifier.name));
2989- }
2990- appendFormat(dump, INDENT3 "Classes: 0x%08x\n", device->classes);
2991- appendFormat(dump, INDENT3 "Path: %s\n", c_str(device->path));
2992- appendFormat(dump, INDENT3 "Descriptor: %s\n", c_str(device->identifier.descriptor));
2993- appendFormat(dump, INDENT3 "Location: %s\n", c_str(device->identifier.location));
2994- appendFormat(dump, INDENT3 "UniqueId: %s\n", c_str(device->identifier.uniqueId));
2995- appendFormat(dump, INDENT3 "Identifier: bus=0x%04x, vendor=0x%04x, "
2996- "product=0x%04x, version=0x%04x\n",
2997- device->identifier.bus, device->identifier.vendor,
2998- device->identifier.product, device->identifier.version);
2999- appendFormat(dump, INDENT3 "KeyLayoutFile: %s\n",
3000- c_str(device->keyMap.keyLayoutFile));
3001- appendFormat(dump, INDENT3 "KeyCharacterMapFile: %s\n",
3002- c_str(device->keyMap.keyCharacterMapFile));
3003- appendFormat(dump, INDENT3 "ConfigurationFile: %s\n",
3004- c_str(device->configurationFile));
3005- appendFormat(dump, INDENT3 "HaveKeyboardLayoutOverlay: %s\n",
3006- toString(device->overlayKeyMap != NULL));
3007- }
3008- } // release lock
3009-}
3010-
3011-void EventHub::monitor() {
3012- // Acquire and release the lock to ensure that the event hub has not deadlocked.
3013- mLock.lock();
3014- mLock.unlock();
3015-}
3016-
3017-void EventHub::flush() {
3018- static const int bufferSize = 256;
3019-
3020- AutoMutex _l(mLock);
3021-
3022- char readBuffer[bufferSize];
3023- int32_t readSize;
3024-
3025- // Read any pending events from the input devices. Note that
3026- // the device fds are in non-blocking mode (see openDeviceLocked).
3027- for (size_t i = 0; i < mDevices.size(); i++) {
3028- const Device* device = mDevices.valueAt(i);
3029- do {
3030- readSize = read(device->fd, readBuffer, bufferSize);
3031- } while (readSize > 0);
3032- }
3033-}
3034-
3035-bool EventHub::hasDeviceByPathLocked(String8 const& path)
3036-{
3037- for (size_t i = 0; i < mDevices.size(); i++) {
3038- auto const& device = mDevices.valueAt(i);
3039- if (device->path == path) return true;
3040- }
3041- return false;
3042-}
3043-
3044-mir::Fd EventHub::fd()
3045-{
3046- return mEpollFd;
3047-}
3048-
3049-}; // namespace android
3050
3051=== removed file '3rd_party/android-input/android/frameworks/base/services/input/EventHub.h'
3052--- 3rd_party/android-input/android/frameworks/base/services/input/EventHub.h 2015-06-17 05:20:42 +0000
3053+++ 3rd_party/android-input/android/frameworks/base/services/input/EventHub.h 1970-01-01 00:00:00 +0000
3054@@ -1,444 +0,0 @@
3055-/*
3056- * Copyright (C) 2005 The Android Open Source Project
3057- *
3058- * Licensed under the Apache License, Version 2.0 (the "License");
3059- * you may not use this file except in compliance with the License.
3060- * You may obtain a copy of the License at
3061- *
3062- * http://www.apache.org/licenses/LICENSE-2.0
3063- *
3064- * Unless required by applicable law or agreed to in writing, software
3065- * distributed under the License is distributed on an "AS IS" BASIS,
3066- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3067- * See the License for the specific language governing permissions and
3068- * limitations under the License.
3069- */
3070-
3071-//
3072-#ifndef _RUNTIME_EVENT_HUB_H
3073-#define _RUNTIME_EVENT_HUB_H
3074-
3075-#include <androidfw/Input.h>
3076-#include <androidfw/InputDevice.h>
3077-#include <androidfw/Keyboard.h>
3078-#include <androidfw/KeyLayoutMap.h>
3079-#include <androidfw/KeyCharacterMap.h>
3080-#include <androidfw/VirtualKeyMap.h>
3081-#include <std/String8.h>
3082-#include <std/Mutex.h>
3083-#include <std/List.h>
3084-#include <std/Errors.h>
3085-#include <std/PropertyMap.h>
3086-#include <std/Vector.h>
3087-#include <std/KeyedVector.h>
3088-
3089-#include "mir/fd.h"
3090-
3091-#include <linux/input.h>
3092-#include <sys/epoll.h>
3093-
3094-#include <memory>
3095-
3096-namespace mir
3097-{
3098-namespace udev { class Monitor; }
3099-namespace input
3100-{
3101-class InputReport;
3102-}
3103-}
3104-
3105-/* Convenience constants. */
3106-
3107-#define BTN_FIRST 0x100 // first button code
3108-#define BTN_LAST 0x15f // last button code
3109-
3110-namespace android {
3111-
3112-enum {
3113- // Device id of a special "virtual" keyboard that is always present.
3114- VIRTUAL_KEYBOARD_ID = -1,
3115- // Device id of the "built-in" keyboard if there is one.
3116- BUILT_IN_KEYBOARD_ID = 0
3117-};
3118-
3119-/*
3120- * A raw event as retrieved from the EventHub.
3121- */
3122-struct RawEvent {
3123- std::chrono::nanoseconds when;
3124- int32_t deviceId;
3125- int32_t type;
3126- int32_t code;
3127- int32_t value;
3128-};
3129-
3130-/* Describes an absolute axis. */
3131-struct RawAbsoluteAxisInfo {
3132- bool valid; // true if the information is valid, false otherwise
3133-
3134- int32_t minValue; // minimum value
3135- int32_t maxValue; // maximum value
3136- int32_t flat; // center flat position, eg. flat == 8 means center is between -8 and 8
3137- int32_t fuzz; // error tolerance, eg. fuzz == 4 means value is +/- 4 due to noise
3138- int32_t resolution; // resolution in units per mm or radians per mm
3139-
3140- inline void clear() {
3141- valid = false;
3142- minValue = 0;
3143- maxValue = 0;
3144- flat = 0;
3145- fuzz = 0;
3146- resolution = 0;
3147- }
3148-};
3149-
3150-/*
3151- * Input device classes.
3152- */
3153-enum {
3154- /* The input device is a keyboard or has buttons. */
3155- INPUT_DEVICE_CLASS_KEYBOARD = 0x00000001,
3156-
3157- /* The input device is an alpha-numeric keyboard (not just a dial pad). */
3158- INPUT_DEVICE_CLASS_ALPHAKEY = 0x00000002,
3159-
3160- /* The input device is a touchscreen or a touchpad (either single-touch or multi-touch). */
3161- INPUT_DEVICE_CLASS_TOUCH = 0x00000004,
3162-
3163- /* The input device is a cursor device such as a trackball or mouse. */
3164- INPUT_DEVICE_CLASS_CURSOR = 0x00000008,
3165-
3166- /* The input device is a multi-touch touchscreen. */
3167- INPUT_DEVICE_CLASS_TOUCH_MT = 0x00000010,
3168-
3169- /* The input device is a directional pad (implies keyboard, has DPAD keys). */
3170- INPUT_DEVICE_CLASS_DPAD = 0x00000020,
3171-
3172- /* The input device is a gamepad (implies keyboard, has BUTTON keys). */
3173- INPUT_DEVICE_CLASS_GAMEPAD = 0x00000040,
3174-
3175- /* The input device has switches. */
3176- INPUT_DEVICE_CLASS_SWITCH = 0x00000080,
3177-
3178- /* The input device is a joystick (implies gamepad, has joystick absolute axes). */
3179- INPUT_DEVICE_CLASS_JOYSTICK = 0x00000100,
3180-
3181- /* The input device has a vibrator (supports FF_RUMBLE). */
3182- INPUT_DEVICE_CLASS_VIBRATOR = 0x00000200,
3183-
3184- /* The input device is virtual (not a real device, not part of UI configuration). */
3185- INPUT_DEVICE_CLASS_VIRTUAL = 0x40000000,
3186-
3187- /* The input device is external (not built-in). */
3188- INPUT_DEVICE_CLASS_EXTERNAL = 0x80000000
3189-};
3190-
3191-/*
3192- * Gets the class that owns an axis, in cases where multiple classes might claim
3193- * the same axis for different purposes.
3194- */
3195-extern uint32_t getAbsAxisUsage(int32_t axis, uint32_t deviceClasses);
3196-
3197-/*
3198- * Grand Central Station for events.
3199- *
3200- * The event hub aggregates input events received across all known input
3201- * devices on the system, including devices that may be emulated by the simulator
3202- * environment. In addition, the event hub generates fake input events to indicate
3203- * when devices are added or removed.
3204- *
3205- * The event hub provides a stream of input events (via the getEvent function).
3206- * It also supports querying the current actual state of input devices such as identifying
3207- * which keys are currently down. Finally, the event hub keeps track of the capabilities of
3208- * individual input devices, such as their class and the set of key codes that they support.
3209- */
3210-class EventHubInterface : public virtual RefBase {
3211-protected:
3212- EventHubInterface() { }
3213- virtual ~EventHubInterface() { }
3214-
3215-public:
3216- // Synthetic raw event type codes produced when devices are added or removed.
3217- enum {
3218- // Sent when a device is added.
3219- DEVICE_ADDED = 0x10000000,
3220- // Sent when a device is removed.
3221- DEVICE_REMOVED = 0x20000000,
3222- // Sent when all added/removed devices from the most recent scan have been reported.
3223- // This event is always sent at least once.
3224- FINISHED_DEVICE_SCAN = 0x30000000,
3225-
3226- FIRST_SYNTHETIC_EVENT = DEVICE_ADDED
3227- };
3228-
3229- virtual uint32_t getDeviceClasses(int32_t deviceId) const = 0;
3230-
3231- virtual InputDeviceIdentifier getDeviceIdentifier(int32_t deviceId) const = 0;
3232-
3233- virtual void getConfiguration(int32_t deviceId, PropertyMap* outConfiguration) const = 0;
3234-
3235- virtual status_t getAbsoluteAxisInfo(int32_t deviceId, int axis,
3236- RawAbsoluteAxisInfo* outAxisInfo) const = 0;
3237-
3238- virtual bool hasRelativeAxis(int32_t deviceId, int axis) const = 0;
3239-
3240- virtual bool hasInputProperty(int32_t deviceId, int property) const = 0;
3241-
3242- virtual status_t mapKey(int32_t deviceId, int32_t scanCode, int32_t usageCode,
3243- int32_t* outKeycode, uint32_t* outFlags) const = 0;
3244-
3245- virtual status_t mapAxis(int32_t deviceId, int32_t scanCode,
3246- AxisInfo* outAxisInfo) const = 0;
3247-
3248- // Sets devices that are excluded from opening.
3249- // This can be used to ignore input devices for sensors.
3250- virtual void setExcludedDevices(const Vector<String8>& devices) = 0;
3251-
3252- /*
3253- * Tests for available events and returns them.
3254- * After returning, the EventHub holds onto a wake lock until the next call to getEvent.
3255- * This ensures that the device will not go to sleep while the event is being processed.
3256- * If the device needs to remain awake longer than that, then the caller is responsible
3257- * for taking care of it (say, by poking the power manager user activity timer).
3258- *
3259- * Returns the number of events obtained.
3260- */
3261- virtual size_t getEvents(RawEvent* buffer, size_t bufferSize) = 0;
3262-
3263- /*
3264- * Query current input state.
3265- */
3266- virtual int32_t getScanCodeState(int32_t deviceId, int32_t scanCode) const = 0;
3267- virtual int32_t getKeyCodeState(int32_t deviceId, int32_t keyCode) const = 0;
3268- virtual int32_t getSwitchState(int32_t deviceId, int32_t sw) const = 0;
3269- virtual status_t getAbsoluteAxisValue(int32_t deviceId, int32_t axis,
3270- int32_t* outValue) const = 0;
3271-
3272- /*
3273- * Examine key input devices for specific framework keycode support
3274- */
3275- virtual bool markSupportedKeyCodes(int32_t deviceId, size_t numCodes, const int32_t* keyCodes,
3276- uint8_t* outFlags) const = 0;
3277-
3278- virtual bool hasScanCode(int32_t deviceId, int32_t scanCode) const = 0;
3279- virtual bool hasLed(int32_t deviceId, int32_t led) const = 0;
3280- virtual void setLedState(int32_t deviceId, int32_t led, bool on) = 0;
3281-
3282- virtual void getVirtualKeyDefinitions(int32_t deviceId,
3283- Vector<VirtualKeyDefinition>& outVirtualKeys) const = 0;
3284-
3285- virtual sp<KeyCharacterMap> getKeyCharacterMap(int32_t deviceId) const = 0;
3286- virtual bool setKeyboardLayoutOverlay(int32_t deviceId, const sp<KeyCharacterMap>& map) = 0;
3287-
3288- /* Control the vibrator. */
3289- virtual void vibrate(int32_t deviceId, std::chrono::nanoseconds duration) = 0;
3290- virtual void cancelVibrate(int32_t deviceId) = 0;
3291-
3292- /* Requests the EventHub to reopen all input devices on the next call to getEvents(). */
3293- virtual void requestReopenDevices() = 0;
3294-
3295- /* Wakes up getEvents() if it is blocked on a read. */
3296- virtual void wake() = 0;
3297-
3298- /* Ensures that fd() readable after given timeout */
3299- virtual void wakeIn(int32_t timeout) = 0;
3300-
3301- /* Dump EventHub state to a string. */
3302- virtual void dump(String8& dump) = 0;
3303-
3304- /* Called by the heatbeat to ensures that the reader has not deadlocked. */
3305- virtual void monitor() = 0;
3306-
3307- /* Flush all pending events not yet read from the input devices */
3308- virtual void flush() = 0;
3309-
3310- /* Epoll fd used by EventHub */
3311- virtual mir::Fd fd() = 0;
3312-};
3313-
3314-class EventHub : public EventHubInterface
3315-{
3316-public:
3317- EventHub(std::shared_ptr<mir::input::InputReport> const& input_report);
3318-
3319- virtual uint32_t getDeviceClasses(int32_t deviceId) const;
3320-
3321- virtual InputDeviceIdentifier getDeviceIdentifier(int32_t deviceId) const;
3322-
3323- virtual void getConfiguration(int32_t deviceId, PropertyMap* outConfiguration) const;
3324-
3325- virtual status_t getAbsoluteAxisInfo(int32_t deviceId, int axis,
3326- RawAbsoluteAxisInfo* outAxisInfo) const;
3327-
3328- virtual bool hasRelativeAxis(int32_t deviceId, int axis) const;
3329-
3330- virtual bool hasInputProperty(int32_t deviceId, int property) const;
3331-
3332- virtual status_t mapKey(int32_t deviceId, int32_t scanCode, int32_t usageCode,
3333- int32_t* outKeycode, uint32_t* outFlags) const;
3334-
3335- virtual status_t mapAxis(int32_t deviceId, int32_t scanCode,
3336- AxisInfo* outAxisInfo) const;
3337-
3338- virtual void setExcludedDevices(const Vector<String8>& devices);
3339-
3340- virtual int32_t getScanCodeState(int32_t deviceId, int32_t scanCode) const;
3341- virtual int32_t getKeyCodeState(int32_t deviceId, int32_t keyCode) const;
3342- virtual int32_t getSwitchState(int32_t deviceId, int32_t sw) const;
3343- virtual status_t getAbsoluteAxisValue(int32_t deviceId, int32_t axis, int32_t* outValue) const;
3344-
3345- virtual bool markSupportedKeyCodes(int32_t deviceId, size_t numCodes,
3346- const int32_t* keyCodes, uint8_t* outFlags) const;
3347-
3348- virtual size_t getEvents(RawEvent* buffer, size_t bufferSize);
3349-
3350- virtual bool hasScanCode(int32_t deviceId, int32_t scanCode) const;
3351- virtual bool hasLed(int32_t deviceId, int32_t led) const;
3352- virtual void setLedState(int32_t deviceId, int32_t led, bool on);
3353-
3354- virtual void getVirtualKeyDefinitions(int32_t deviceId,
3355- Vector<VirtualKeyDefinition>& outVirtualKeys) const;
3356-
3357- virtual sp<KeyCharacterMap> getKeyCharacterMap(int32_t deviceId) const;
3358- virtual bool setKeyboardLayoutOverlay(int32_t deviceId, const sp<KeyCharacterMap>& map);
3359-
3360- virtual void vibrate(int32_t deviceId, std::chrono::nanoseconds duration);
3361- virtual void cancelVibrate(int32_t deviceId);
3362-
3363- virtual void requestReopenDevices();
3364-
3365- virtual void wake();
3366- virtual void wakeIn(int32_t timeout);
3367-
3368- virtual void dump(String8& dump);
3369- virtual void monitor();
3370- virtual void flush();
3371- virtual mir::Fd fd();
3372-
3373- virtual ~EventHub();
3374-
3375- // Ids used for epoll notifications not associated with devices.
3376- static const uint32_t EPOLL_ID_UDEV = 0x80000001;
3377- static const uint32_t EPOLL_ID_WAKE = 0x80000002;
3378- static const uint32_t EPOLL_ID_TIMER = 0x80000003;
3379-private:
3380- std::shared_ptr<mir::input::InputReport> const input_report;
3381-
3382- struct Device {
3383- Device* next;
3384-
3385- int fd; // may be -1 if device is virtual
3386- const int32_t id;
3387- const String8 path;
3388- const InputDeviceIdentifier identifier;
3389-
3390- uint32_t classes;
3391-
3392- uint8_t keyBitmask[(KEY_MAX + 1) / 8];
3393- uint8_t absBitmask[(ABS_MAX + 1) / 8];
3394- uint8_t relBitmask[(REL_MAX + 1) / 8];
3395- uint8_t swBitmask[(SW_MAX + 1) / 8];
3396- uint8_t ledBitmask[(LED_MAX + 1) / 8];
3397- uint8_t ffBitmask[(FF_MAX + 1) / 8];
3398- uint8_t propBitmask[(INPUT_PROP_MAX + 1) / 8];
3399-
3400- String8 configurationFile;
3401- PropertyMap* configuration;
3402- VirtualKeyMap* virtualKeyMap;
3403- KeyMap keyMap;
3404-
3405- sp<KeyCharacterMap> overlayKeyMap;
3406- sp<KeyCharacterMap> combinedKeyMap;
3407-
3408- bool ffEffectPlaying;
3409- int16_t ffEffectId; // initially -1
3410-
3411- Device(int fd, int32_t id, const String8& path, const InputDeviceIdentifier& identifier);
3412- ~Device();
3413-
3414- void close();
3415-
3416- inline bool isVirtual() const { return fd < 0; }
3417-
3418- const sp<KeyCharacterMap>& getKeyCharacterMap() const {
3419- if (combinedKeyMap != NULL) {
3420- return combinedKeyMap;
3421- }
3422- return keyMap.keyCharacterMap;
3423- }
3424- };
3425-
3426- status_t openDeviceLocked(const char *devicePath);
3427- void createVirtualKeyboardLocked();
3428- void addDeviceLocked(Device* device);
3429-
3430- status_t closeDeviceByPathLocked(const char *devicePath);
3431- void closeDeviceLocked(Device* device);
3432- void closeAllDevicesLocked();
3433-
3434- void scanDevicesLocked();
3435- void handleUdevEventsLocked();
3436-
3437- Device* getDeviceLocked(int32_t deviceId) const;
3438- Device* getDeviceByPathLocked(const char* devicePath) const;
3439-
3440- bool hasKeycodeLocked(Device* device, int keycode) const;
3441-
3442- void loadConfigurationLocked(Device* device);
3443- status_t loadVirtualKeyMapLocked(Device* device);
3444- status_t loadKeyMapLocked(Device* device);
3445-
3446- bool isExternalDeviceLocked(Device* device);
3447-
3448- // Protect all internal state.
3449- mutable Mutex mLock;
3450-
3451- // The actual id of the built-in keyboard, or NO_BUILT_IN_KEYBOARD if none.
3452- // EventHub remaps the built-in keyboard to id 0 externally as required by the API.
3453- enum {
3454- // Must not conflict with any other assigned device ids, including
3455- // the virtual keyboard id (-1).
3456- NO_BUILT_IN_KEYBOARD = -2
3457- };
3458- int32_t mBuiltInKeyboardId;
3459-
3460- int32_t mNextDeviceId;
3461-
3462- bool hasDeviceByPathLocked(String8 const& path);
3463- KeyedVector<int32_t, Device*> mDevices;
3464-
3465- Device *mOpeningDevices;
3466- Device *mClosingDevices;
3467-
3468- bool mNeedToSendFinishedDeviceScan;
3469- bool mNeedToReopenDevices;
3470- bool mNeedToScanDevices;
3471- Vector<String8> mExcludedDevices;
3472-
3473- mir::Fd mEpollFd;
3474- mir::Fd mTimerFd;
3475- std::unique_ptr<mir::udev::Monitor> const device_listener;
3476- int mWakeReadPipeFd;
3477- int mWakeWritePipeFd;
3478-
3479- // Epoll FD list size hint.
3480- static const int EPOLL_SIZE_HINT = 8;
3481-
3482- // Maximum number of signalled FDs to handle at a time.
3483- static const int EPOLL_MAX_EVENTS = 16;
3484-
3485- // The array of pending epoll events and the index of the next event to be handled.
3486- struct epoll_event mPendingEventItems[EPOLL_MAX_EVENTS];
3487- size_t mPendingEventCount;
3488- size_t mPendingEventIndex;
3489- bool mPendingUdevEvent;
3490-};
3491-
3492-// Made available to test
3493-namespace detail { String8 sha1(const String8& in); }
3494-
3495-
3496-} // namespace android
3497-
3498-#endif // _RUNTIME_EVENT_HUB_H
3499
3500=== removed file '3rd_party/android-input/android/frameworks/base/services/input/GenericKeyMap.cpp'
3501--- 3rd_party/android-input/android/frameworks/base/services/input/GenericKeyMap.cpp 2013-02-05 17:19:57 +0000
3502+++ 3rd_party/android-input/android/frameworks/base/services/input/GenericKeyMap.cpp 1970-01-01 00:00:00 +0000
3503@@ -1,1009 +0,0 @@
3504-// Copyright (C) 2010 The Android Open Source Project
3505-//
3506-// Licensed under the Apache License, Version 2.0 (the "License");
3507-// you may not use this file except in compliance with the License.
3508-// You may obtain a copy of the License at
3509-//
3510-// http://www.apache.org/licenses/LICENSE-2.0
3511-//
3512-// Unless required by applicable law or agreed to in writing, software
3513-// distributed under the License is distributed on an "AS IS" BASIS,
3514-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3515-// See the License for the specific language governing permissions and
3516-// limitations under the License.
3517-//
3518-
3519-#include <androidfw/GenericKeyMap.h>
3520-
3521-const char* android::GenericKeyMap::key_layout_contents()
3522-{
3523- static const char* result =
3524- "key 1 ESCAPE\n" \
3525- "key 2 1\n" \
3526- "key 3 2\n" \
3527- "key 4 3\n" \
3528- "key 5 4\n" \
3529- "key 6 5\n" \
3530- "key 7 6\n" \
3531- "key 8 7\n" \
3532- "key 9 8\n" \
3533- "key 10 9\n" \
3534- "key 11 0\n" \
3535- "key 12 MINUS\n" \
3536- "key 13 EQUALS\n" \
3537- "key 14 DEL\n" \
3538- "key 15 TAB\n" \
3539- "key 16 Q\n" \
3540- "key 17 W\n" \
3541- "key 18 E\n" \
3542- "key 19 R\n" \
3543- "key 20 T\n" \
3544- "key 21 Y\n" \
3545- "key 22 U\n" \
3546- "key 23 I\n" \
3547- "key 24 O\n" \
3548- "key 25 P\n" \
3549- "key 26 LEFT_BRACKET\n" \
3550- "key 27 RIGHT_BRACKET\n" \
3551- "key 28 ENTER\n" \
3552- "key 29 CTRL_LEFT\n" \
3553- "key 30 A\n" \
3554- "key 31 S\n" \
3555- "key 32 D\n" \
3556- "key 33 F\n" \
3557- "key 34 G\n" \
3558- "key 35 H\n" \
3559- "key 36 J\n" \
3560- "key 37 K\n" \
3561- "key 38 L\n" \
3562- "key 39 SEMICOLON\n" \
3563- "key 40 APOSTROPHE\n" \
3564- "key 41 GRAVE\n" \
3565- "key 42 SHIFT_LEFT\n" \
3566- "key 43 BACKSLASH\n" \
3567- "key 44 Z\n" \
3568- "key 45 X\n" \
3569- "key 46 C\n" \
3570- "key 47 V\n" \
3571- "key 48 B\n" \
3572- "key 49 N\n" \
3573- "key 50 M\n" \
3574- "key 51 COMMA\n" \
3575- "key 52 PERIOD\n" \
3576- "key 53 SLASH\n" \
3577- "key 54 SHIFT_RIGHT\n" \
3578- "key 55 NUMPAD_MULTIPLY\n" \
3579- "key 56 ALT_LEFT\n" \
3580- "key 57 SPACE\n" \
3581- "key 58 CAPS_LOCK\n" \
3582- "key 59 F1\n" \
3583- "key 60 F2\n" \
3584- "key 61 F3\n" \
3585- "key 62 F4\n" \
3586- "key 63 F5\n" \
3587- "key 64 F6\n" \
3588- "key 65 F7\n" \
3589- "key 66 F8\n" \
3590- "key 67 F9\n" \
3591- "key 68 F10\n" \
3592- "key 69 NUM_LOCK\n" \
3593- "key 70 SCROLL_LOCK\n" \
3594- "key 71 NUMPAD_7\n" \
3595- "key 72 NUMPAD_8\n" \
3596- "key 73 NUMPAD_9\n" \
3597- "key 74 NUMPAD_SUBTRACT\n" \
3598- "key 75 NUMPAD_4\n" \
3599- "key 76 NUMPAD_5\n" \
3600- "key 77 NUMPAD_6\n" \
3601- "key 78 NUMPAD_ADD\n" \
3602- "key 79 NUMPAD_1\n" \
3603- "key 80 NUMPAD_2\n" \
3604- "key 81 NUMPAD_3\n" \
3605- "key 82 NUMPAD_0\n" \
3606- "key 83 NUMPAD_DOT\n" \
3607- "# key 84 (undefined)\n" \
3608- "key 85 ZENKAKU_HANKAKU\n" \
3609- "key 86 BACKSLASH\n" \
3610- "key 87 F11\n" \
3611- "key 88 F12\n" \
3612- "key 89 RO\n" \
3613- "# key 90 \"KEY_KATAKANA\"\n" \
3614- "# key 91 \"KEY_HIRAGANA\"\n" \
3615- "key 92 HENKAN\n" \
3616- "key 93 KATAKANA_HIRAGANA\n" \
3617- "key 94 MUHENKAN\n" \
3618- "key 95 NUMPAD_COMMA\n" \
3619- "key 96 NUMPAD_ENTER\n" \
3620- "key 97 CTRL_RIGHT\n" \
3621- "key 98 NUMPAD_DIVIDE\n" \
3622- "key 99 SYSRQ\n" \
3623- "key 100 ALT_RIGHT\n" \
3624- "# key 101 \"KEY_LINEFEED\"\n" \
3625- "key 102 MOVE_HOME\n" \
3626- "key 103 DPAD_UP\n" \
3627- "key 104 PAGE_UP\n" \
3628- "key 105 DPAD_LEFT\n" \
3629- "key 106 DPAD_RIGHT\n" \
3630- "key 107 MOVE_END\n" \
3631- "key 108 DPAD_DOWN\n" \
3632- "key 109 PAGE_DOWN\n" \
3633- "key 110 INSERT\n" \
3634- "key 111 FORWARD_DEL\n" \
3635- "# key 112 \"KEY_MACRO\"\n" \
3636- "key 113 VOLUME_MUTE\n" \
3637- "key 114 VOLUME_DOWN\n" \
3638- "key 115 VOLUME_UP\n" \
3639- "key 116 POWER WAKE\n" \
3640- "key 117 NUMPAD_EQUALS\n" \
3641- "# key 118 \"KEY_KPPLUSMINUS\"\n" \
3642- "key 119 BREAK\n" \
3643- "# key 120 (undefined)\n" \
3644- "key 121 NUMPAD_COMMA\n" \
3645- "key 122 KANA\n" \
3646- "key 123 EISU\n" \
3647- "key 124 YEN\n" \
3648- "key 125 META_LEFT\n" \
3649- "key 126 META_RIGHT\n" \
3650- "key 127 MENU WAKE_DROPPED\n" \
3651- "key 128 MEDIA_STOP\n" \
3652- "# key 129 \"KEY_AGAIN\"\n" \
3653- "# key 130 \"KEY_PROPS\"\n" \
3654- "# key 131 \"KEY_UNDO\"\n" \
3655- "# key 132 \"KEY_FRONT\"\n" \
3656- "# key 133 \"KEY_COPY\"\n" \
3657- "# key 134 \"KEY_OPEN\"\n" \
3658- "# key 135 \"KEY_PASTE\"\n" \
3659- "# key 136 \"KEY_FIND\"\n" \
3660- "# key 137 \"KEY_CUT\"\n" \
3661- "# key 138 \"KEY_HELP\"\n" \
3662- "key 139 MENU WAKE_DROPPED\n" \
3663- "key 140 CALCULATOR\n" \
3664- "# key 141 \"KEY_SETUP\"\n" \
3665- "key 142 POWER WAKE\n" \
3666- "key 143 POWER WAKE\n" \
3667- "# key 144 \"KEY_FILE\"\n" \
3668- "# key 145 \"KEY_SENDFILE\"\n" \
3669- "# key 146 \"KEY_DELETEFILE\"\n" \
3670- "# key 147 \"KEY_XFER\"\n" \
3671- "# key 148 \"KEY_PROG1\"\n" \
3672- "# key 149 \"KEY_PROG2\"\n" \
3673- "key 150 EXPLORER\n" \
3674- "# key 151 \"KEY_MSDOS\"\n" \
3675- "key 152 POWER WAKE\n" \
3676- "# key 153 \"KEY_DIRECTION\"\n" \
3677- "# key 154 \"KEY_CYCLEWINDOWS\"\n" \
3678- "key 155 ENVELOPE\n" \
3679- "key 156 BOOKMARK\n" \
3680- "# key 157 \"KEY_COMPUTER\"\n" \
3681- "key 158 BACK WAKE_DROPPED\n" \
3682- "key 159 FORWARD\n" \
3683- "key 160 MEDIA_CLOSE\n" \
3684- "key 161 MEDIA_EJECT\n" \
3685- "key 162 MEDIA_EJECT\n" \
3686- "key 163 MEDIA_NEXT\n" \
3687- "key 164 MEDIA_PLAY_PAUSE\n" \
3688- "key 165 MEDIA_PREVIOUS\n" \
3689- "key 166 MEDIA_STOP\n" \
3690- "key 167 MEDIA_RECORD\n" \
3691- "key 168 MEDIA_REWIND\n" \
3692- "key 169 CALL\n" \
3693- "# key 170 \"KEY_ISO\"\n" \
3694- "key 171 MUSIC\n" \
3695- "key 172 HOME\n" \
3696- "# key 173 \"KEY_REFRESH\"\n" \
3697- "# key 174 \"KEY_EXIT\"\n" \
3698- "# key 175 \"KEY_MOVE\"\n" \
3699- "# key 176 \"KEY_EDIT\"\n" \
3700- "key 177 PAGE_UP\n" \
3701- "key 178 PAGE_DOWN\n" \
3702- "key 179 NUMPAD_LEFT_PAREN\n" \
3703- "key 180 NUMPAD_RIGHT_PAREN\n" \
3704- "# key 181 \"KEY_NEW\"\n" \
3705- "# key 182 \"KEY_REDO\"\n" \
3706- "# key 183 F13\n" \
3707- "# key 184 F14\n" \
3708- "# key 185 F15\n" \
3709- "# key 186 F16\n" \
3710- "# key 187 F17\n" \
3711- "# key 188 F18\n" \
3712- "# key 189 F19\n" \
3713- "# key 190 F20\n" \
3714- "# key 191 F21\n" \
3715- "# key 192 F22\n" \
3716- "# key 193 F23\n" \
3717- "# key 194 F24\n" \
3718- "# key 195 (undefined)\n" \
3719- "# key 196 (undefined)\n" \
3720- "# key 197 (undefined)\n" \
3721- "# key 198 (undefined)\n" \
3722- "# key 199 (undefined)\n" \
3723- "key 200 MEDIA_PLAY\n" \
3724- "key 201 MEDIA_PAUSE\n" \
3725- "# key 202 \"KEY_PROG3\"\n" \
3726- "# key 203 \"KEY_PROG4\"\n" \
3727- "# key 204 (undefined)\n" \
3728- "# key 205 \"KEY_SUSPEND\"\n" \
3729- "# key 206 \"KEY_CLOSE\"\n" \
3730- "key 207 MEDIA_PLAY\n" \
3731- "key 208 MEDIA_FAST_FORWARD\n" \
3732- "# key 209 \"KEY_BASSBOOST\"\n" \
3733- "# key 210 \"KEY_PRINT\"\n" \
3734- "# key 211 \"KEY_HP\"\n" \
3735- "key 212 CAMERA\n" \
3736- "key 213 MUSIC\n" \
3737- "# key 214 \"KEY_QUESTION\"\n" \
3738- "key 215 ENVELOPE\n" \
3739- "# key 216 \"KEY_CHAT\"\n" \
3740- "key 217 SEARCH\n" \
3741- "# key 218 \"KEY_CONNECT\"\n" \
3742- "# key 219 \"KEY_FINANCE\"\n" \
3743- "# key 220 \"KEY_SPORT\"\n" \
3744- "# key 221 \"KEY_SHOP\"\n" \
3745- "# key 222 \"KEY_ALTERASE\"\n" \
3746- "# key 223 \"KEY_CANCEL\"\n" \
3747- "# key 224 \"KEY_BRIGHTNESSDOWN\"\n" \
3748- "# key 225 \"KEY_BRIGHTNESSUP\"\n" \
3749- "key 226 HEADSETHOOK\n" \
3750- "\n" \
3751- "key 256 BUTTON_1\n" \
3752- "key 257 BUTTON_2\n" \
3753- "key 258 BUTTON_3\n" \
3754- "key 259 BUTTON_4\n" \
3755- "key 260 BUTTON_5\n" \
3756- "key 261 BUTTON_6\n" \
3757- "key 262 BUTTON_7\n" \
3758- "key 263 BUTTON_8\n" \
3759- "key 264 BUTTON_9\n" \
3760- "key 265 BUTTON_10\n" \
3761- "key 266 BUTTON_11\n" \
3762- "key 267 BUTTON_12\n" \
3763- "key 268 BUTTON_13\n" \
3764- "key 269 BUTTON_14\n" \
3765- "key 270 BUTTON_15\n" \
3766- "key 271 BUTTON_16\n" \
3767- "\n" \
3768- "key 288 BUTTON_1\n" \
3769- "key 289 BUTTON_2\n" \
3770- "key 290 BUTTON_3\n" \
3771- "key 291 BUTTON_4\n" \
3772- "key 292 BUTTON_5\n" \
3773- "key 293 BUTTON_6\n" \
3774- "key 294 BUTTON_7\n" \
3775- "key 295 BUTTON_8\n" \
3776- "key 296 BUTTON_9\n" \
3777- "key 297 BUTTON_10\n" \
3778- "key 298 BUTTON_11\n" \
3779- "key 299 BUTTON_12\n" \
3780- "key 300 BUTTON_13\n" \
3781- "key 301 BUTTON_14\n" \
3782- "key 302 BUTTON_15\n" \
3783- "key 303 BUTTON_16\n" \
3784- "\n" \
3785- "\n" \
3786- "key 304 BUTTON_A\n" \
3787- "key 305 BUTTON_B\n" \
3788- "key 306 BUTTON_C\n" \
3789- "key 307 BUTTON_X\n" \
3790- "key 308 BUTTON_Y\n" \
3791- "key 309 BUTTON_Z\n" \
3792- "key 310 BUTTON_L1\n" \
3793- "key 311 BUTTON_R1\n" \
3794- "key 312 BUTTON_L2\n" \
3795- "key 313 BUTTON_R2\n" \
3796- "key 314 BUTTON_SELECT\n" \
3797- "key 315 BUTTON_START\n" \
3798- "key 316 BUTTON_MODE\n" \
3799- "key 317 BUTTON_THUMBL\n" \
3800- "key 318 BUTTON_THUMBR\n" \
3801- "\n" \
3802- "\n" \
3803- "# key 352 \"KEY_OK\"\n" \
3804- "key 353 DPAD_CENTER\n" \
3805- "# key 354 \"KEY_GOTO\"\n" \
3806- "# key 355 \"KEY_CLEAR\"\n" \
3807- "# key 356 \"KEY_POWER2\"\n" \
3808- "# key 357 \"KEY_OPTION\"\n" \
3809- "# key 358 \"KEY_INFO\"\n" \
3810- "# key 359 \"KEY_TIME\"\n" \
3811- "# key 360 \"KEY_VENDOR\"\n" \
3812- "# key 361 \"KEY_ARCHIVE\"\n" \
3813- "key 362 GUIDE\n" \
3814- "# key 363 \"KEY_CHANNEL\"\n" \
3815- "# key 364 \"KEY_FAVORITES\"\n" \
3816- "# key 365 \"KEY_EPG\"\n" \
3817- "key 366 DVR\n" \
3818- "# key 367 \"KEY_MHP\"\n" \
3819- "# key 368 \"KEY_LANGUAGE\"\n" \
3820- "# key 369 \"KEY_TITLE\"\n" \
3821- "# key 370 \"KEY_SUBTITLE\"\n" \
3822- "# key 371 \"KEY_ANGLE\"\n" \
3823- "# key 372 \"KEY_ZOOM\"\n" \
3824- "# key 373 \"KEY_MODE\"\n" \
3825- "# key 374 \"KEY_KEYBOARD\"\n" \
3826- "# key 375 \"KEY_SCREEN\"\n" \
3827- "# key 376 \"KEY_PC\"\n" \
3828- "key 377 TV\n" \
3829- "# key 378 \"KEY_TV2\"\n" \
3830- "# key 379 \"KEY_VCR\"\n" \
3831- "# key 380 \"KEY_VCR2\"\n" \
3832- "# key 381 \"KEY_SAT\"\n" \
3833- "# key 382 \"KEY_SAT2\"\n" \
3834- "# key 383 \"KEY_CD\"\n" \
3835- "# key 384 \"KEY_TAPE\"\n" \
3836- "# key 385 \"KEY_RADIO\"\n" \
3837- "# key 386 \"KEY_TUNER\"\n" \
3838- "# key 387 \"KEY_PLAYER\"\n" \
3839- "# key 388 \"KEY_TEXT\"\n" \
3840- "# key 389 \"KEY_DVD\"\n" \
3841- "# key 390 \"KEY_AUX\"\n" \
3842- "# key 391 \"KEY_MP3\"\n" \
3843- "# key 392 \"KEY_AUDIO\"\n" \
3844- "# key 393 \"KEY_VIDEO\"\n" \
3845- "# key 394 \"KEY_DIRECTORY\"\n" \
3846- "# key 395 \"KEY_LIST\"\n" \
3847- "# key 396 \"KEY_MEMO\"\n" \
3848- "key 397 CALENDAR\n" \
3849- "# key 398 \"KEY_RED\"\n" \
3850- "# key 399 \"KEY_GREEN\"\n" \
3851- "# key 400 \"KEY_YELLOW\"\n" \
3852- "# key 401 \"KEY_BLUE\"\n" \
3853- "key 402 CHANNEL_UP\n" \
3854- "key 403 CHANNEL_DOWN\n" \
3855- "# key 404 \"KEY_FIRST\"\n" \
3856- "# key 405 \"KEY_LAST\"\n" \
3857- "# key 406 \"KEY_AB\"\n" \
3858- "# key 407 \"KEY_NEXT\"\n" \
3859- "# key 408 \"KEY_RESTART\"\n" \
3860- "# key 409 \"KEY_SLOW\"\n" \
3861- "# key 410 \"KEY_SHUFFLE\"\n" \
3862- "# key 411 \"KEY_BREAK\"\n" \
3863- "# key 412 \"KEY_PREVIOUS\"\n" \
3864- "# key 413 \"KEY_DIGITS\"\n" \
3865- "# key 414 \"KEY_TEEN\"\n" \
3866- "# key 415 \"KEY_TWEN\"\n" \
3867- "key 429 CONTACTS\n" \
3868- "\n" \
3869- "# key 448 \"KEY_DEL_EOL\"\n" \
3870- "# key 449 \"KEY_DEL_EOS\"\n" \
3871- "# key 450 \"KEY_INS_LINE\"\n" \
3872- "# key 451 \"KEY_DEL_LINE\"\n" \
3873- "\n" \
3874- "\n" \
3875- "key 464 FUNCTION\n" \
3876- "key 465 ESCAPE FUNCTION\n" \
3877- "key 466 F1 FUNCTION\n" \
3878- "key 467 F2 FUNCTION\n" \
3879- "key 468 F3 FUNCTION\n" \
3880- "key 469 F4 FUNCTION\n" \
3881- "key 470 F5 FUNCTION\n" \
3882- "key 471 F6 FUNCTION\n" \
3883- "key 472 F7 FUNCTION\n" \
3884- "key 473 F8 FUNCTION\n" \
3885- "key 474 F9 FUNCTION\n" \
3886- "key 475 F10 FUNCTION\n" \
3887- "key 476 F11 FUNCTION\n" \
3888- "key 477 F12 FUNCTION\n" \
3889- "key 478 1 FUNCTION\n" \
3890- "key 479 2 FUNCTION\n" \
3891- "key 480 D FUNCTION\n" \
3892- "key 481 E FUNCTION\n" \
3893- "key 482 F FUNCTION\n" \
3894- "key 483 S FUNCTION\n" \
3895- "key 484 B FUNCTION\n" \
3896- "\n" \
3897- "\n" \
3898- "# key 497 KEY_BRL_DOT1\n" \
3899- "# key 498 KEY_BRL_DOT2\n" \
3900- "# key 499 KEY_BRL_DOT3\n" \
3901- "# key 500 KEY_BRL_DOT4\n" \
3902- "# key 501 KEY_BRL_DOT5\n" \
3903- "# key 502 KEY_BRL_DOT6\n" \
3904- "# key 503 KEY_BRL_DOT7\n" \
3905- "# key 504 KEY_BRL_DOT8\n" \
3906- "\n" \
3907- "\n" \
3908- "# Joystick and game controller axes.\n" \
3909- "# Axes that are not mapped will be assigned generic axis numbers by the input subsystem.\n" \
3910- "axis 0x00 X\n" \
3911- "axis 0x01 Y\n" \
3912- "axis 0x02 Z\n" \
3913- "axis 0x03 RX\n" \
3914- "axis 0x04 RY\n" \
3915- "axis 0x05 RZ\n" \
3916- "axis 0x06 THROTTLE\n" \
3917- "axis 0x07 RUDDER\n" \
3918- "axis 0x08 WHEEL\n" \
3919- "axis 0x09 GAS\n" \
3920- "axis 0x0a BRAKE\n" \
3921- "axis 0x10 HAT_X\n" \
3922- "axis 0x11 HAT_Y\n";
3923- return result;
3924-}
3925-
3926-const char* android::GenericKeyMap::keymap_contents()
3927-{
3928- static const char* result =
3929- "type FULL\n" \
3930- "\n" \
3931- "### Basic QWERTY keys ###\n" \
3932- "\n" \
3933- "key A {\n" \
3934- " label: 'A'\n" \
3935- " base: 'a'\n" \
3936- " shift, capslock: 'A'\n" \
3937- "}\n" \
3938- "\n" \
3939- "key B {\n" \
3940- " label: 'B'\n" \
3941- " base: 'b'\n" \
3942- " shift, capslock: 'B'\n" \
3943- "}\n" \
3944- "\n" \
3945- "key C {\n" \
3946- " label: 'C'\n" \
3947- " base: 'c'\n" \
3948- " shift, capslock: 'C'\n" \
3949- " alt: '\\u00e7'\n" \
3950- " shift+alt: '\\u00c7'\n" \
3951- "}\n" \
3952- "\n" \
3953- "key D {\n" \
3954- " label: 'D'\n" \
3955- " base: 'd'\n" \
3956- " shift, capslock: 'D'\n" \
3957- "}\n" \
3958- "\n" \
3959- "key E {\n" \
3960- " label: 'E'\n" \
3961- " base: 'e'\n" \
3962- " shift, capslock: 'E'\n" \
3963- " alt: '\\u0301'\n" \
3964- "}\n" \
3965- "\n" \
3966- "key F {\n" \
3967- " label: 'F'\n" \
3968- " base: 'f'\n" \
3969- " shift, capslock: 'F'\n" \
3970- "}\n" \
3971- "\n" \
3972- "key G {\n" \
3973- " label: 'G'\n" \
3974- " base: 'g'\n" \
3975- " shift, capslock: 'G'\n" \
3976- "}\n" \
3977- "\n" \
3978- "key H {\n" \
3979- " label: 'H'\n" \
3980- " base: 'h'\n" \
3981- " shift, capslock: 'H'\n" \
3982- "}\n" \
3983- "\n" \
3984- "key I {\n" \
3985- " label: 'I'\n" \
3986- " base: 'i'\n" \
3987- " shift, capslock: 'I'\n" \
3988- " alt: '\\u0302'\n" \
3989- "}\n" \
3990- "\n" \
3991- "key J {\n" \
3992- " label: 'J'\n" \
3993- " base: 'j'\n" \
3994- " shift, capslock: 'J'\n" \
3995- "}\n" \
3996- "\n" \
3997- "key K {\n" \
3998- " label: 'K'\n" \
3999- " base: 'k'\n" \
4000- " shift, capslock: 'K'\n" \
4001- "}\n" \
4002- "\n" \
4003- "key L {\n" \
4004- " label: 'L'\n" \
4005- " base: 'l'\n" \
4006- " shift, capslock: 'L'\n" \
4007- "}\n" \
4008- "\n" \
4009- "key M {\n" \
4010- " label: 'M'\n" \
4011- " base: 'm'\n" \
4012- " shift, capslock: 'M'\n" \
4013- "}\n" \
4014- "\n" \
4015- "key N {\n" \
4016- " label: 'N'\n" \
4017- " base: 'n'\n" \
4018- " shift, capslock: 'N'\n" \
4019- " alt: '\\u0303'\n" \
4020- "}\n" \
4021- "\n" \
4022- "key O {\n" \
4023- " label: 'O'\n" \
4024- " base: 'o'\n" \
4025- " shift, capslock: 'O'\n" \
4026- "}\n" \
4027- "\n" \
4028- "key P {\n" \
4029- " label: 'P'\n" \
4030- " base: 'p'\n" \
4031- " shift, capslock: 'P'\n" \
4032- "}\n" \
4033- "\n" \
4034- "key Q {\n" \
4035- " label: 'Q'\n" \
4036- " base: 'q'\n" \
4037- " shift, capslock: 'Q'\n" \
4038- "}\n" \
4039- "\n" \
4040- "key R {\n" \
4041- " label: 'R'\n" \
4042- " base: 'r'\n" \
4043- " shift, capslock: 'R'\n" \
4044- "}\n" \
4045- "\n" \
4046- "key S {\n" \
4047- " label: 'S'\n" \
4048- " base: 's'\n" \
4049- " shift, capslock: 'S'\n" \
4050- " alt: '\\u00df'\n" \
4051- "}\n" \
4052- "\n" \
4053- "key T {\n" \
4054- " label: 'T'\n" \
4055- " base: 't'\n" \
4056- " shift, capslock: 'T'\n" \
4057- "}\n" \
4058- "\n" \
4059- "key U {\n" \
4060- " label: 'U'\n" \
4061- " base: 'u'\n" \
4062- " shift, capslock: 'U'\n" \
4063- " alt: '\\u0308'\n" \
4064- "}\n" \
4065- "\n" \
4066- "key V {\n" \
4067- " label: 'V'\n" \
4068- " base: 'v'\n" \
4069- " shift, capslock: 'V'\n" \
4070- "}\n" \
4071- "\n" \
4072- "key W {\n" \
4073- " label: 'W'\n" \
4074- " base: 'w'\n" \
4075- " shift, capslock: 'W'\n" \
4076- "}\n" \
4077- "\n" \
4078- "key X {\n" \
4079- " label: 'X'\n" \
4080- " base: 'x'\n" \
4081- " shift, capslock: 'X'\n" \
4082- "}\n" \
4083- "\n" \
4084- "key Y {\n" \
4085- " label: 'Y'\n" \
4086- " base: 'y'\n" \
4087- " shift, capslock: 'Y'\n" \
4088- "}\n" \
4089- "\n" \
4090- "key Z {\n" \
4091- " label: 'Z'\n" \
4092- " base: 'z'\n" \
4093- " shift, capslock: 'Z'\n" \
4094- "}\n" \
4095- "\n" \
4096- "key 0 {\n" \
4097- " label: '0'\n" \
4098- " base: '0'\n" \
4099- " shift: ')'\n" \
4100- "}\n" \
4101- "\n" \
4102- "key 1 {\n" \
4103- " label: '1'\n" \
4104- " base: '1'\n" \
4105- " shift: '!'\n" \
4106- "}\n" \
4107- "\n" \
4108- "key 2 {\n" \
4109- " label: '2'\n" \
4110- " base: '2'\n" \
4111- " shift: '@'\n" \
4112- "}\n" \
4113- "\n" \
4114- "key 3 {\n" \
4115- " label: '3'\n" \
4116- " base: '3'\n" \
4117- " shift: '#'\n" \
4118- "}\n" \
4119- "\n" \
4120- "key 4 {\n" \
4121- " label: '4'\n" \
4122- " base: '4'\n" \
4123- " shift: '$'\n" \
4124- "}\n" \
4125- "\n" \
4126- "key 5 {\n" \
4127- " label: '5'\n" \
4128- " base: '5'\n" \
4129- " shift: '%'\n" \
4130- "}\n" \
4131- "\n" \
4132- "key 6 {\n" \
4133- " label: '6'\n" \
4134- " base: '6'\n" \
4135- " shift: '^'\n" \
4136- " alt+shift: '\\u0302'\n" \
4137- "}\n" \
4138- "\n" \
4139- "key 7 {\n" \
4140- " label: '7'\n" \
4141- " base: '7'\n" \
4142- " shift: '&'\n" \
4143- "}\n" \
4144- "\n" \
4145- "key 8 {\n" \
4146- " label: '8'\n" \
4147- " base: '8'\n" \
4148- " shift: '*'\n" \
4149- "}\n" \
4150- "\n" \
4151- "key 9 {\n" \
4152- " label: '9'\n" \
4153- " base: '9'\n" \
4154- " shift: '('\n" \
4155- "}\n" \
4156- "\n" \
4157- "key SPACE {\n" \
4158- " label: ' '\n" \
4159- " base: ' '\n" \
4160- " alt, meta: fallback SEARCH\n" \
4161- " ctrl: fallback LANGUAGE_SWITCH\n" \
4162- "}\n" \
4163- "\n" \
4164- "key ENTER {\n" \
4165- " label: '\\n'\n" \
4166- " base: '\\n'\n" \
4167- "}\n" \
4168- "\n" \
4169- "key TAB {\n" \
4170- " label: '\\t'\n" \
4171- " base: '\\t'\n" \
4172- "}\n" \
4173- "\n" \
4174- "key COMMA {\n" \
4175- " label: ','\n" \
4176- " base: ','\n" \
4177- " shift: '<'\n" \
4178- "}\n" \
4179- "\n" \
4180- "key PERIOD {\n" \
4181- " label: '.'\n" \
4182- " base: '.'\n" \
4183- " shift: '>'\n" \
4184- "}\n" \
4185- "\n" \
4186- "key SLASH {\n" \
4187- " label: '/'\n" \
4188- " base: '/'\n" \
4189- " shift: '?'\n" \
4190- "}\n" \
4191- "\n" \
4192- "key GRAVE {\n" \
4193- " label: '`'\n" \
4194- " base: '`'\n" \
4195- " shift: '~'\n" \
4196- " alt: '\\u0300'\n" \
4197- " alt+shift: '\\u0303'\n" \
4198- "}\n" \
4199- "\n" \
4200- "key MINUS {\n" \
4201- " label: '-'\n" \
4202- " base: '-'\n" \
4203- " shift: '_'\n" \
4204- "}\n" \
4205- "\n" \
4206- "key EQUALS {\n" \
4207- " label: '='\n" \
4208- " base: '='\n" \
4209- " shift: '+'\n" \
4210- "}\n" \
4211- "\n" \
4212- "key LEFT_BRACKET {\n" \
4213- " label: '['\n" \
4214- " base: '['\n" \
4215- " shift: '{'\n" \
4216- "}\n" \
4217- "\n" \
4218- "key RIGHT_BRACKET {\n" \
4219- " label: ']'\n" \
4220- " base: ']'\n" \
4221- " shift: '}'\n" \
4222- "}\n" \
4223- "\n" \
4224- "key BACKSLASH {\n" \
4225- " label: '\\\\'\n" \
4226- " base: '\\\\'\n" \
4227- " shift: '|'\n" \
4228- "}\n" \
4229- "\n" \
4230- "key SEMICOLON {\n" \
4231- " label: ';'\n" \
4232- " base: ';'\n" \
4233- " shift: ':'\n" \
4234- "}\n" \
4235- "\n" \
4236- "key APOSTROPHE {\n" \
4237- " label: '\\''\n" \
4238- " base: '\\''\n" \
4239- " shift: '\"'\n" \
4240- "}\n" \
4241- "\n" \
4242- "### Numeric keypad ###\n" \
4243- "\n" \
4244- "key NUMPAD_0 {\n" \
4245- " label: '0'\n" \
4246- " base: fallback INSERT\n" \
4247- " numlock: '0'\n" \
4248- "}\n" \
4249- "\n" \
4250- "key NUMPAD_1 {\n" \
4251- " label: '1'\n" \
4252- " base: fallback MOVE_END\n" \
4253- " numlock: '1'\n" \
4254- "}\n" \
4255- "\n" \
4256- "key NUMPAD_2 {\n" \
4257- " label: '2'\n" \
4258- " base: fallback DPAD_DOWN\n" \
4259- " numlock: '2'\n" \
4260- "}\n" \
4261- "\n" \
4262- "key NUMPAD_3 {\n" \
4263- " label: '3'\n" \
4264- " base: fallback PAGE_DOWN\n" \
4265- " numlock: '3'\n" \
4266- "}\n" \
4267- "\n" \
4268- "key NUMPAD_4 {\n" \
4269- " label: '4'\n" \
4270- " base: fallback DPAD_LEFT\n" \
4271- " numlock: '4'\n" \
4272- "}\n" \
4273- "\n" \
4274- "key NUMPAD_5 {\n" \
4275- " label: '5'\n" \
4276- " base: fallback DPAD_CENTER\n" \
4277- " numlock: '5'\n" \
4278- "}\n" \
4279- "\n" \
4280- "key NUMPAD_6 {\n" \
4281- " label: '6'\n" \
4282- " base: fallback DPAD_RIGHT\n" \
4283- " numlock: '6'\n" \
4284- "}\n" \
4285- "\n" \
4286- "key NUMPAD_7 {\n" \
4287- " label: '7'\n" \
4288- " base: fallback MOVE_HOME\n" \
4289- " numlock: '7'\n" \
4290- "}\n" \
4291- "\n" \
4292- "key NUMPAD_8 {\n" \
4293- " label: '8'\n" \
4294- " base: fallback DPAD_UP\n" \
4295- " numlock: '8'\n" \
4296- "}\n" \
4297- "\n" \
4298- "key NUMPAD_9 {\n" \
4299- " label: '9'\n" \
4300- " base: fallback PAGE_UP\n" \
4301- " numlock: '9'\n" \
4302- "}\n" \
4303- "\n" \
4304- "key NUMPAD_LEFT_PAREN {\n" \
4305- " label: '('\n" \
4306- " base: '('\n" \
4307- "}\n" \
4308- "\n" \
4309- "key NUMPAD_RIGHT_PAREN {\n" \
4310- " label: ')'\n" \
4311- " base: ')'\n" \
4312- "}\n" \
4313- "\n" \
4314- "key NUMPAD_DIVIDE {\n" \
4315- " label: '/'\n" \
4316- " base: '/'\n" \
4317- "}\n" \
4318- "\n" \
4319- "key NUMPAD_MULTIPLY {\n" \
4320- " label: '*'\n" \
4321- " base: '*'\n" \
4322- "}\n" \
4323- "\n" \
4324- "key NUMPAD_SUBTRACT {\n" \
4325- " label: '-'\n" \
4326- " base: '-'\n" \
4327- "}\n" \
4328- "\n" \
4329- "key NUMPAD_ADD {\n" \
4330- " label: '+'\n" \
4331- " base: '+'\n" \
4332- "}\n" \
4333- "\n" \
4334- "key NUMPAD_DOT {\n" \
4335- " label: '.'\n" \
4336- " base: fallback FORWARD_DEL\n" \
4337- " numlock: '.'\n" \
4338- "}\n" \
4339- "\n" \
4340- "key NUMPAD_COMMA {\n" \
4341- " label: ','\n" \
4342- " base: ','\n" \
4343- "}\n" \
4344- "\n" \
4345- "key NUMPAD_EQUALS {\n" \
4346- " label: '='\n" \
4347- " base: '='\n" \
4348- "}\n" \
4349- "\n" \
4350- "key NUMPAD_ENTER {\n" \
4351- " label: '\\n'\n" \
4352- " base: '\\n' fallback ENTER\n" \
4353- " ctrl, alt, meta: none fallback ENTER\n" \
4354- "}\n" \
4355- "\n" \
4356- "### Special keys on phones ###\n" \
4357- "\n" \
4358- "key AT {\n" \
4359- " label: '@'\n" \
4360- " base: '@'\n" \
4361- "}\n" \
4362- "\n" \
4363- "key STAR {\n" \
4364- " label: '*'\n" \
4365- " base: '*'\n" \
4366- "}\n" \
4367- "\n" \
4368- "key POUND {\n" \
4369- " label: '#'\n" \
4370- " base: '#'\n" \
4371- "}\n" \
4372- "\n" \
4373- "key PLUS {\n" \
4374- " label: '+'\n" \
4375- " base: '+'\n" \
4376- "}\n" \
4377- "\n" \
4378- "### Non-printing keys ###\n" \
4379- "\n" \
4380- "key ESCAPE {\n" \
4381- " base: fallback BACK\n" \
4382- " alt, meta: fallback HOME\n" \
4383- " ctrl: fallback MENU\n" \
4384- "}\n" \
4385- "\n" \
4386- "### Gamepad buttons ###\n" \
4387- "\n" \
4388- "key BUTTON_A {\n" \
4389- " base: fallback BACK\n" \
4390- "}\n" \
4391- "\n" \
4392- "key BUTTON_B {\n" \
4393- " base: fallback BACK\n" \
4394- "}\n" \
4395- "\n" \
4396- "key BUTTON_C {\n" \
4397- " base: fallback BACK\n" \
4398- "}\n" \
4399- "\n" \
4400- "key BUTTON_X {\n" \
4401- " base: fallback DPAD_CENTER\n" \
4402- "}\n" \
4403- "\n" \
4404- "key BUTTON_Y {\n" \
4405- " base: fallback DPAD_CENTER\n" \
4406- "}\n" \
4407- "\n" \
4408- "key BUTTON_Z {\n" \
4409- " base: fallback DPAD_CENTER\n" \
4410- "}\n" \
4411- "\n" \
4412- "key BUTTON_L1 {\n" \
4413- " base: none\n" \
4414- "}\n" \
4415- "\n" \
4416- "key BUTTON_R1 {\n" \
4417- " base: none\n" \
4418- "}\n" \
4419- "\n" \
4420- "key BUTTON_L2 {\n" \
4421- " base: none\n" \
4422- "}\n" \
4423- "\n" \
4424- "key BUTTON_R2 {\n" \
4425- " base: none\n" \
4426- "}\n" \
4427- "\n" \
4428- "key BUTTON_THUMBL {\n" \
4429- " base: fallback DPAD_CENTER\n" \
4430- "}\n" \
4431- "\n" \
4432- "key BUTTON_THUMBR {\n" \
4433- " base: fallback DPAD_CENTER\n" \
4434- "}\n" \
4435- "\n" \
4436- "key BUTTON_START {\n" \
4437- " base: fallback HOME\n" \
4438- "}\n" \
4439- "\n" \
4440- "key BUTTON_SELECT {\n" \
4441- " base: fallback MENU\n" \
4442- "}\n" \
4443- "\n" \
4444- "key BUTTON_MODE {\n" \
4445- " base: fallback MENU\n" \
4446- "}\n" \
4447- "\n" \
4448- "key BUTTON_1 {\n" \
4449- " base: fallback DPAD_CENTER\n" \
4450- "}\n" \
4451- "\n" \
4452- "key BUTTON_2 {\n" \
4453- " base: fallback DPAD_CENTER\n" \
4454- "}\n" \
4455- "\n" \
4456- "key BUTTON_3 {\n" \
4457- " base: fallback DPAD_CENTER\n" \
4458- "}\n" \
4459- "\n" \
4460- "key BUTTON_4 {\n" \
4461- " base: fallback DPAD_CENTER\n" \
4462- "}\n" \
4463- "\n" \
4464- "key BUTTON_5 {\n" \
4465- " base: fallback DPAD_CENTER\n" \
4466- "}\n" \
4467- "\n" \
4468- "key BUTTON_6 {\n" \
4469- " base: fallback DPAD_CENTER\n" \
4470- "}\n" \
4471- "\n" \
4472- "key BUTTON_7 {\n" \
4473- " base: fallback DPAD_CENTER\n" \
4474- "}\n" \
4475- "\n" \
4476- "key BUTTON_8 {\n" \
4477- " base: fallback DPAD_CENTER\n" \
4478- "}\n" \
4479- "\n" \
4480- "key BUTTON_9 {\n" \
4481- " base: fallback DPAD_CENTER\n" \
4482- "}\n" \
4483- "\n" \
4484- "key BUTTON_10 {\n" \
4485- " base: fallback DPAD_CENTER\n" \
4486- "}\n" \
4487- "\n" \
4488- "key BUTTON_11 {\n" \
4489- " base: fallback DPAD_CENTER\n" \
4490- "}\n" \
4491- "\n" \
4492- "key BUTTON_12 {\n" \
4493- " base: fallback DPAD_CENTER\n" \
4494- "}\n" \
4495- "\n" \
4496- "key BUTTON_13 {\n" \
4497- " base: fallback DPAD_CENTER\n" \
4498- "}\n" \
4499- "\n" \
4500- "key BUTTON_14 {\n" \
4501- " base: fallback DPAD_CENTER\n" \
4502- "}\n" \
4503- "\n" \
4504- "key BUTTON_15 {\n" \
4505- " base: fallback DPAD_CENTER\n" \
4506- "}\n" \
4507- "\n" \
4508- "key BUTTON_16 {\n" \
4509- " base: fallback DPAD_CENTER\n" \
4510- "}";
4511- return result;
4512-}
4513
4514=== removed file '3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp'
4515--- 3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp 2015-06-15 22:24:08 +0000
4516+++ 3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp 1970-01-01 00:00:00 +0000
4517@@ -1,205 +0,0 @@
4518-/*
4519- * Copyright (C) 2012 The Android Open Source Project
4520- *
4521- * Licensed under the Apache License, Version 2.0 (the "License");
4522- * you may not use this file except in compliance with the License.
4523- * You may obtain a copy of the License at
4524- *
4525- * http://www.apache.org/licenses/LICENSE-2.0
4526- *
4527- * Unless required by applicable law or agreed to in writing, software
4528- * distributed under the License is distributed on an "AS IS" BASIS,
4529- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4530- * See the License for the specific language governing permissions and
4531- * limitations under the License.
4532- */
4533-
4534-#define LOG_TAG "InputDevice"
4535-
4536-#include <cutils/log.h>
4537-#define DEBUG_PROBE 0
4538-
4539-#include <stdlib.h>
4540-#include <unistd.h>
4541-#include <ctype.h>
4542-
4543-#include <androidfw/InputDevice.h>
4544-
4545-namespace android {
4546-
4547-static const char* CONFIGURATION_FILE_DIR[] = {
4548- "idc/",
4549- "keylayout/",
4550- "keychars/",
4551-};
4552-
4553-static const char* CONFIGURATION_FILE_EXTENSION[] = {
4554- ".idc",
4555- ".kl",
4556- ".kcm",
4557-};
4558-
4559-static bool isValidNameChar(char ch) {
4560- return isascii(ch) && (isdigit(ch) || isalpha(ch) || ch == '-' || ch == '_');
4561-}
4562-
4563-static void appendInputDeviceConfigurationFileRelativePath(String8& path,
4564- const String8& name, InputDeviceConfigurationFileType type) {
4565- path.append(CONFIGURATION_FILE_DIR[type]);
4566- for (size_t i = 0; i < name.length(); i++) {
4567- char ch = name[i];
4568- if (!isValidNameChar(ch)) {
4569- ch = '_';
4570- }
4571- path.append(&ch, 1);
4572- }
4573- path.append(CONFIGURATION_FILE_EXTENSION[type]);
4574-}
4575-
4576-String8 getInputDeviceConfigurationFilePathByDeviceIdentifier(
4577- const InputDeviceIdentifier& deviceIdentifier,
4578- InputDeviceConfigurationFileType type) {
4579- if (deviceIdentifier.vendor !=0 && deviceIdentifier.product != 0) {
4580- if (deviceIdentifier.version != 0) {
4581- // Try vendor product version.
4582- String8 versionPath(getInputDeviceConfigurationFilePathByName(
4583- formatString8("Vendor_%04x_Product_%04x_Version_%04x",
4584- deviceIdentifier.vendor, deviceIdentifier.product,
4585- deviceIdentifier.version),
4586- type));
4587- if (!isEmpty(versionPath)) {
4588- return versionPath;
4589- }
4590- }
4591-
4592- // Try vendor product.
4593- String8 productPath(getInputDeviceConfigurationFilePathByName(
4594- formatString8("Vendor_%04x_Product_%04x",
4595- deviceIdentifier.vendor, deviceIdentifier.product),
4596- type));
4597- if (!isEmpty(productPath)) {
4598- return productPath;
4599- }
4600- }
4601-
4602- // Try device name.
4603- return getInputDeviceConfigurationFilePathByName(deviceIdentifier.name, type);
4604-}
4605-
4606-String8 getConfigurationFilePathInDirectory(String8 const& directory, String8 const& name, InputDeviceConfigurationFileType type)
4607-{
4608- String8 path = directory;
4609- appendInputDeviceConfigurationFileRelativePath(path, name, type);
4610-#if DEBUG_PROBE
4611- ALOGD("Probing for input device configuration file: path='%s'", path.c_str());
4612-#endif
4613- if (!access(c_str(path), R_OK)) {
4614-#if DEBUG_PROBE
4615- ALOGD("Found");
4616-#endif
4617- return path;
4618- }
4619-
4620- return String8();
4621-}
4622-
4623-String8 getInputDeviceConfigurationFilePathByName(
4624- const String8& name, InputDeviceConfigurationFileType type) {
4625- // Search system repository.
4626- String8 path;
4627- setTo(path, "/usr/share/");
4628- auto result = getConfigurationFilePathInDirectory(path, name, type);
4629- if (result.length())
4630- return result;
4631-
4632- {
4633- const char *root_env = getenv("ANDROID_ROOT");
4634- if (root_env == NULL) root_env = "";
4635- setTo(path, root_env);
4636- }
4637- // </mir modifications>
4638- path.append("/usr/");
4639- result = getConfigurationFilePathInDirectory(path, name, type);
4640- if (result.length())
4641- return result;
4642-
4643- // Search user repository.
4644- // TODO Should only look here if not in safe mode. ( ?? ~ racarr)
4645- {
4646- const char *data_env = getenv("ANDROID_DATA");
4647- if (data_env == NULL) data_env = "";
4648- setTo(path, data_env);
4649- }
4650-
4651- path.append("/system/devices/");
4652- result = getConfigurationFilePathInDirectory(path, name, type);
4653- if (result.length())
4654- return result;
4655-
4656- // Not found.
4657-#if DEBUG_PROBE
4658- ALOGD("Probe failed to find input device configuration file: name='%s', type=%d",
4659- name.c_str(), type);
4660-#endif
4661- return String8();
4662-}
4663-
4664-
4665-// --- InputDeviceInfo ---
4666-
4667-InputDeviceInfo::InputDeviceInfo() {
4668- initialize(-1, -1, InputDeviceIdentifier(), String8(), false);
4669-}
4670-
4671-InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) :
4672- mId(other.mId), mGeneration(other.mGeneration), mIdentifier(other.mIdentifier),
4673- mAlias(other.mAlias), mIsExternal(other.mIsExternal), mSources(other.mSources),
4674- mKeyboardType(other.mKeyboardType),
4675- mKeyCharacterMap(other.mKeyCharacterMap),
4676- mHasVibrator(other.mHasVibrator),
4677- mMotionRanges(other.mMotionRanges) {
4678-}
4679-
4680-InputDeviceInfo::~InputDeviceInfo() {
4681-}
4682-
4683-void InputDeviceInfo::initialize(int32_t id, int32_t generation,
4684- const InputDeviceIdentifier& identifier, const String8& alias, bool isExternal) {
4685- mId = id;
4686- mGeneration = generation;
4687- mIdentifier = identifier;
4688- mAlias = alias;
4689- mIsExternal = isExternal;
4690- mSources = 0;
4691- mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE;
4692- mHasVibrator = false;
4693- mMotionRanges.clear();
4694-}
4695-
4696-const InputDeviceInfo::MotionRange* InputDeviceInfo::getMotionRange(
4697- int32_t axis, uint32_t source) const {
4698- size_t numRanges = mMotionRanges.size();
4699- for (size_t i = 0; i < numRanges; i++) {
4700- const MotionRange& range = mMotionRanges.itemAt(i);
4701- if (range.axis == axis && range.source == source) {
4702- return &range;
4703- }
4704- }
4705- return NULL;
4706-}
4707-
4708-void InputDeviceInfo::addSource(uint32_t source) {
4709- mSources |= source;
4710-}
4711-
4712-void InputDeviceInfo::addMotionRange(int32_t axis, uint32_t source, float min, float max,
4713- float flat, float fuzz) {
4714- MotionRange range = { axis, source, min, max, flat, fuzz };
4715- mMotionRanges.add(range);
4716-}
4717-
4718-void InputDeviceInfo::addMotionRange(const MotionRange& range) {
4719- mMotionRanges.add(range);
4720-}
4721-
4722-} // namespace android
4723
4724=== removed file '3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp'
4725--- 3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp 2015-08-17 18:33:38 +0000
4726+++ 3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp 1970-01-01 00:00:00 +0000
4727@@ -1,183 +0,0 @@
4728-/*
4729- * Copyright (C) 2011 The Android Open Source Project
4730- *
4731- * Licensed under the Apache License, Version 2.0 (the "License");
4732- * you may not use this file except in compliance with the License.
4733- * You may obtain a copy of the License at
4734- *
4735- * http://www.apache.org/licenses/LICENSE-2.0
4736- *
4737- * Unless required by applicable law or agreed to in writing, software
4738- * distributed under the License is distributed on an "AS IS" BASIS,
4739- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4740- * See the License for the specific language governing permissions and
4741- * limitations under the License.
4742- */
4743-
4744-#define LOG_TAG "InputListener"
4745-
4746-//#define LOG_NDEBUG 0
4747-
4748-#include "InputListener.h"
4749-
4750-#include <cutils/log.h>
4751-
4752-namespace android {
4753-
4754-// --- NotifyConfigurationChangedArgs ---
4755-
4756-NotifyConfigurationChangedArgs::NotifyConfigurationChangedArgs(std::chrono::nanoseconds eventTime) :
4757- eventTime(eventTime) {
4758-}
4759-
4760-NotifyConfigurationChangedArgs::NotifyConfigurationChangedArgs(
4761- const NotifyConfigurationChangedArgs& other) :
4762- eventTime(other.eventTime) {
4763-}
4764-
4765-void NotifyConfigurationChangedArgs::notify(InputListenerInterface& listener) const {
4766- listener.notifyConfigurationChanged(this);
4767-}
4768-
4769-
4770-// --- NotifyKeyArgs ---
4771-
4772-NotifyKeyArgs::NotifyKeyArgs(std::chrono::nanoseconds eventTime, uint64_t mac,
4773- int32_t deviceId, uint32_t source, uint32_t policyFlags,
4774- int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode,
4775- int32_t metaState, std::chrono::nanoseconds downTime) :
4776- eventTime(eventTime), deviceId(deviceId), source(source), policyFlags(policyFlags),
4777- action(action), flags(flags), keyCode(keyCode), scanCode(scanCode),
4778- metaState(metaState), downTime(downTime) {
4779-}
4780-
4781-NotifyKeyArgs::NotifyKeyArgs(const NotifyKeyArgs& other) :
4782- eventTime(other.eventTime), mac(other.mac),
4783- deviceId(other.deviceId), source(other.source),
4784- policyFlags(other.policyFlags),
4785- action(other.action), flags(other.flags),
4786- keyCode(other.keyCode), scanCode(other.scanCode),
4787- metaState(other.metaState), downTime(other.downTime) {
4788-}
4789-
4790-void NotifyKeyArgs::notify(InputListenerInterface& listener) const {
4791- listener.notifyKey(this);
4792-}
4793-
4794-
4795-// --- NotifyMotionArgs ---
4796-
4797-NotifyMotionArgs::NotifyMotionArgs(std::chrono::nanoseconds eventTime, uint64_t mac,
4798- int32_t deviceId, uint32_t source, uint32_t policyFlags,
4799- int32_t action, int32_t flags, int32_t metaState, int32_t buttonState,
4800- int32_t edgeFlags, uint32_t pointerCount,
4801- const PointerProperties* pointerProperties, const PointerCoords* pointerCoords,
4802- float xPrecision, float yPrecision, std::chrono::nanoseconds downTime) :
4803- eventTime(eventTime), mac(mac), deviceId(deviceId), source(source),
4804- policyFlags(policyFlags), action(action), flags(flags), metaState(metaState),
4805- buttonState(buttonState), edgeFlags(edgeFlags), pointerCount(pointerCount),
4806- xPrecision(xPrecision), yPrecision(yPrecision), downTime(downTime) {
4807- for (uint32_t i = 0; i < pointerCount; i++) {
4808- this->pointerProperties[i].copyFrom(pointerProperties[i]);
4809- this->pointerCoords[i].copyFrom(pointerCoords[i]);
4810- }
4811-}
4812-
4813-NotifyMotionArgs::NotifyMotionArgs(const NotifyMotionArgs& other) :
4814- eventTime(other.eventTime), mac(other.mac),
4815- deviceId(other.deviceId), source(other.source),
4816- policyFlags(other.policyFlags),
4817- action(other.action), flags(other.flags),
4818- metaState(other.metaState), buttonState(other.buttonState),
4819- edgeFlags(other.edgeFlags), pointerCount(other.pointerCount),
4820- xPrecision(other.xPrecision), yPrecision(other.yPrecision), downTime(other.downTime) {
4821- for (uint32_t i = 0; i < pointerCount; i++) {
4822- pointerProperties[i].copyFrom(other.pointerProperties[i]);
4823- pointerCoords[i].copyFrom(other.pointerCoords[i]);
4824- }
4825-}
4826-
4827-void NotifyMotionArgs::notify(InputListenerInterface& listener) const {
4828- listener.notifyMotion(this);
4829-}
4830-
4831-
4832-// --- NotifySwitchArgs ---
4833-
4834-NotifySwitchArgs::NotifySwitchArgs(std::chrono::nanoseconds eventTime, uint32_t policyFlags,
4835- int32_t switchCode, int32_t switchValue) :
4836- eventTime(eventTime), policyFlags(policyFlags),
4837- switchCode(switchCode), switchValue(switchValue) {
4838-}
4839-
4840-NotifySwitchArgs::NotifySwitchArgs(const NotifySwitchArgs& other) :
4841- eventTime(other.eventTime), policyFlags(other.policyFlags),
4842- switchCode(other.switchCode), switchValue(other.switchValue) {
4843-}
4844-
4845-void NotifySwitchArgs::notify(InputListenerInterface& listener) const {
4846- listener.notifySwitch(this);
4847-}
4848-
4849-
4850-// --- NotifyDeviceResetArgs ---
4851-
4852-NotifyDeviceResetArgs::NotifyDeviceResetArgs(std::chrono::nanoseconds eventTime, int32_t deviceId) :
4853- eventTime(eventTime), deviceId(deviceId) {
4854-}
4855-
4856-NotifyDeviceResetArgs::NotifyDeviceResetArgs(const NotifyDeviceResetArgs& other) :
4857- eventTime(other.eventTime), deviceId(other.deviceId) {
4858-}
4859-
4860-void NotifyDeviceResetArgs::notify(InputListenerInterface& listener) const {
4861- listener.notifyDeviceReset(this);
4862-}
4863-
4864-
4865-// --- QueuedInputListener ---
4866-
4867-QueuedInputListener::QueuedInputListener(const std::shared_ptr<InputListenerInterface>& innerListener) :
4868- mInnerListener(innerListener) {
4869-}
4870-
4871-QueuedInputListener::~QueuedInputListener() {
4872- size_t count = mArgsQueue.size();
4873- for (size_t i = 0; i < count; i++) {
4874- delete mArgsQueue[i];
4875- }
4876-}
4877-
4878-void QueuedInputListener::notifyConfigurationChanged(
4879- const NotifyConfigurationChangedArgs* args) {
4880- mArgsQueue.push(new NotifyConfigurationChangedArgs(*args));
4881-}
4882-
4883-void QueuedInputListener::notifyKey(const NotifyKeyArgs* args) {
4884- mArgsQueue.push(new NotifyKeyArgs(*args));
4885-}
4886-
4887-void QueuedInputListener::notifyMotion(const NotifyMotionArgs* args) {
4888- mArgsQueue.push(new NotifyMotionArgs(*args));
4889-}
4890-
4891-void QueuedInputListener::notifySwitch(const NotifySwitchArgs* args) {
4892- mArgsQueue.push(new NotifySwitchArgs(*args));
4893-}
4894-
4895-void QueuedInputListener::notifyDeviceReset(const NotifyDeviceResetArgs* args) {
4896- mArgsQueue.push(new NotifyDeviceResetArgs(*args));
4897-}
4898-
4899-void QueuedInputListener::flush() {
4900- size_t count = mArgsQueue.size();
4901- for (size_t i = 0; i < count; i++) {
4902- NotifyArgs* args = mArgsQueue[i];
4903- args->notify(*mInnerListener);
4904- delete args;
4905- }
4906- mArgsQueue.clear();
4907-}
4908-
4909-
4910-} // namespace android
4911
4912=== removed file '3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp'
4913--- 3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp 2015-09-24 15:42:21 +0000
4914+++ 3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp 1970-01-01 00:00:00 +0000
4915@@ -1,6356 +0,0 @@
4916-/*
4917- * Copyright (C) 2010 The Android Open Source Project
4918- *
4919- * Licensed under the Apache License, Version 2.0 (the "License");
4920- * you may not use this file except in compliance with the License.
4921- * You may obtain a copy of the License at
4922- *
4923- * http://www.apache.org/licenses/LICENSE-2.0
4924- *
4925- * Unless required by applicable law or agreed to in writing, software
4926- * distributed under the License is distributed on an "AS IS" BASIS,
4927- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4928- * See the License for the specific language governing permissions and
4929- * limitations under the License.
4930- */
4931-
4932-#define LOG_TAG "InputReader"
4933-
4934-//#define LOG_NDEBUG 0
4935-
4936-// Log debug messages for each raw event received from the EventHub.
4937-#define DEBUG_RAW_EVENTS 0
4938-
4939-// Log debug messages about touch screen filtering hacks.
4940-#define DEBUG_HACKS 0
4941-
4942-// Log debug messages about virtual key processing.
4943-#define DEBUG_VIRTUAL_KEYS 0
4944-
4945-// Log debug messages about pointers.
4946-#define DEBUG_POINTERS 0
4947-
4948-// Log debug messages about pointer assignment calculations.
4949-#define DEBUG_POINTER_ASSIGNMENT 0
4950-
4951-// Log debug messages about gesture detection.
4952-#define DEBUG_GESTURES 0
4953-
4954-// Log debug messages about the vibrator.
4955-#define DEBUG_VIBRATOR 0
4956-
4957-#include "InputReader.h"
4958-
4959-#include <cutils/log.h>
4960-#include <androidfw/Keyboard.h>
4961-#include <androidfw/VirtualKeyMap.h>
4962-
4963-#include <android/keycodes.h>
4964-
4965-#include <std/BitSet.h>
4966-
4967-#include <stddef.h>
4968-#include <stdlib.h>
4969-#include <unistd.h>
4970-#include <errno.h>
4971-#include <limits.h>
4972-#include <math.h>
4973-
4974-#if DEBUG_RAW_EVENTS
4975-#include "InputEventPrinter.h"
4976-#endif
4977-
4978-#define INDENT " "
4979-#define INDENT2 " "
4980-#define INDENT3 " "
4981-#define INDENT4 " "
4982-#define INDENT5 " "
4983-
4984-namespace android {
4985-
4986-// --- Constants ---
4987-
4988-// Maximum number of slots supported when using the slot-based Multitouch Protocol B.
4989-static const size_t MAX_SLOTS = 32;
4990-
4991-// --- Static Functions ---
4992-
4993-template<typename T>
4994-inline static T min(const T& a, const T& b) {
4995- return a < b ? a : b;
4996-}
4997-
4998-template<typename T>
4999-inline static void swap(T& a, T& b) {
5000- T temp = a;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: