Mir

Merge lp:mir/0.11 into lp:mir/ubuntu

Proposed by Robert Carr
Status: Merged
Approved by: Robert Carr
Approved revision: 2287
Merge reported by: Robert Carr
Merged at revision: not available
Proposed branch: lp:mir/0.11
Merge into: lp:mir/ubuntu
Diff against target: 45215 lines (+16843/-10206)
621 files modified
3rd_party/android-deps/std/Condition.h (+1/-1)
3rd_party/android-deps/utils/Timers.h (+20/-19)
3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h (+18/-16)
3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h (+15/-15)
3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h (+5/-5)
3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h (+3/-3)
3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h (+16/-16)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp (+6/-6)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.h (+3/-3)
3rd_party/android-input/android/frameworks/base/services/input/Input.cpp (+5/-5)
3rd_party/android-input/android/frameworks/base/services/input/InputApplication.h (+2/-2)
3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp (+87/-86)
3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h (+59/-59)
3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp (+7/-7)
3rd_party/android-input/android/frameworks/base/services/input/InputListener.h (+14/-14)
3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp (+80/-80)
3rd_party/android-input/android/frameworks/base/services/input/InputReader.h (+93/-93)
3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp (+30/-30)
3rd_party/android-input/android/frameworks/base/services/input/InputWindow.h (+2/-2)
3rd_party/android-input/android/frameworks/base/services/input/KeyCharacterMap.cpp (+8/-8)
3rd_party/android-input/android/frameworks/base/services/input/KeyLayoutMap.cpp (+2/-2)
3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp (+3/-3)
3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp (+23/-23)
3rd_party/android-input/android/frameworks/base/services/input/VirtualKeyMap.cpp (+2/-2)
3rd_party/android-input/android/frameworks/native/include/utils/Looper.h (+5/-5)
3rd_party/android-input/android/frameworks/native/libs/utils/Looper.cpp (+12/-12)
3rd_party/android-input/android/frameworks/native/libs/utils/Timers.cpp (+5/-5)
CMakeLists.txt (+22/-2)
benchmarks/android-input/input_reader_perf.cpp (+1/-1)
benchmarks/frame-uniformity/touch_samples.cpp (+2/-0)
client-ABI-sha1sums (+6/-6)
cmake/FindGtest.cmake (+6/-1)
common-ABI-sha1sums (+12/-8)
debian/changelog (+67/-0)
debian/control (+54/-37)
debian/libmirplatform5driver-android.install (+0/-1)
debian/libmirplatform5driver-mesa.install (+0/-1)
debian/libmirplatform6.install (+1/-1)
debian/libmirserver29.install (+1/-1)
debian/mir-client-platform-mesa-dev.install (+2/-0)
debian/mir-platform-graphics-android.install (+1/-0)
debian/mir-platform-graphics-mesa.install (+1/-0)
debian/mir-test-tools.install (+1/-1)
debian/rules (+1/-14)
deploy-and-test.sh (+12/-7)
doc/avoid_deploy-and-test.md (+29/-0)
doc/demo_server_controls.md (+60/-0)
doc/demo_shell_controls.md (+3/-0)
doc/mainpage.md (+15/-1)
examples/CMakeLists.txt (+24/-0)
examples/eglapp.c (+6/-0)
examples/eglstateswitcher.c (+101/-0)
examples/fingerpaint.c (+67/-14)
examples/render_overlays.cpp (+0/-10)
examples/server_example.cpp (+4/-4)
examples/server_example_window_management.cpp (+703/-0)
examples/server_example_window_management.h (+92/-0)
examples/server_example_window_manager.cpp (+45/-304)
include/client/mir_toolkit/mir_connection.h (+1/-2)
include/client/mir_toolkit/mir_surface.h (+135/-6)
include/common/mir/dispatch/dispatchable.h (+78/-0)
include/common/mir/dispatch/simple_dispatch_thread.h (+48/-0)
include/common/mir/events/event_builders.h (+71/-0)
include/common/mir/frontend/surface_id.h (+4/-4)
include/common/mir/geometry/dimensions.h (+18/-0)
include/common/mir/geometry/displacement.h (+23/-0)
include/common/mir/geometry/rectangles.h (+4/-4)
include/common/mir/geometry/size.h (+24/-0)
include/common/mir_toolkit/common.h (+9/-0)
include/common/mir_toolkit/events/event.h (+11/-3)
include/common/mir_toolkit/events/input/input_event.h (+14/-2)
include/common/mir_toolkit/events/input/pointer_input_event.h (+120/-0)
include/platform/mir/graphics/platform.h (+31/-1)
include/platform/mir/graphics/renderable.h (+0/-8)
include/platform/mir/module_properties.h (+37/-0)
include/server/mir/compositor/scene.h (+10/-0)
include/server/mir/frontend/session.h (+0/-10)
include/server/mir/frontend/surface.h (+0/-3)
include/server/mir/input/input_dispatcher.h (+4/-2)
include/server/mir/scene/placement_strategy.h (+1/-0)
include/server/mir/scene/session.h (+9/-0)
include/server/mir/scene/session_coordinator.h (+32/-4)
include/server/mir/scene/surface.h (+7/-0)
include/server/mir/scene/surface_creation_parameters.h (+9/-0)
include/server/mir/server.h (+18/-8)
include/server/mir/shell/abstract_shell.h (+116/-0)
include/server/mir/shell/focus_controller.h (+5/-2)
include/server/mir/shell/focus_setter.h (+0/-50)
include/server/mir/shell/session_coordinator_wrapper.h (+0/-63)
include/server/mir/shell/shell.h (+91/-0)
include/server/mir/shell/shell_wrapper.h (+78/-0)
include/server/mir/shell/surface_coordinator_wrapper.h (+0/-47)
platform-ABI-sha1sums (+15/-10)
playground/demo-shell/demo_compositor.cpp (+9/-5)
playground/demo-shell/demo_compositor.h (+2/-1)
playground/demo-shell/demo_renderer.cpp (+49/-3)
playground/demo-shell/demo_renderer.h (+25/-8)
playground/demo-shell/demo_shell.cpp (+2/-6)
playground/demo-shell/window_manager.cpp (+96/-5)
playground/demo-shell/window_manager.h (+12/-0)
server-ABI-sha1sums (+29/-26)
src/CMakeLists.txt (+7/-6)
src/client/CMakeLists.txt (+6/-18)
src/client/buffer_stream.cpp (+317/-0)
src/client/buffer_stream.h (+123/-0)
src/client/client_buffer_depository.cpp (+3/-2)
src/client/client_buffer_stream.h (+61/-0)
src/client/client_buffer_stream_factory.h (+48/-0)
src/client/default_client_buffer_stream_factory.cpp (+46/-0)
src/client/default_client_buffer_stream_factory.h (+57/-0)
src/client/default_connection_configuration.cpp (+2/-2)
src/client/logging/input_receiver_report.cpp (+55/-51)
src/client/lttng/input_receiver_report.cpp (+36/-20)
src/client/lttng/input_receiver_report.h (+3/-2)
src/client/lttng/input_receiver_report_tp.h (+5/-15)
src/client/mir_connection.cpp (+38/-57)
src/client/mir_connection.h (+13/-13)
src/client/mir_connection_api.cpp (+111/-17)
src/client/mir_cursor_api.cpp (+1/-1)
src/client/mir_prompt_session.cpp (+2/-2)
src/client/mir_prompt_session_api.cpp (+1/-1)
src/client/mir_screencast.cpp (+16/-92)
src/client/mir_screencast.h (+9/-17)
src/client/mir_screencast_api.cpp (+2/-5)
src/client/mir_surface.cpp (+61/-134)
src/client/mir_surface.h (+13/-16)
src/client/mir_surface_api.cpp (+72/-1)
src/client/probing_client_platform_factory.h (+1/-1)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+25/-5)
src/client/rpc/mir_protobuf_rpc_channel.h (+9/-1)
src/client/rpc/stream_socket_transport.cpp (+30/-111)
src/client/rpc/stream_socket_transport.h (+3/-4)
src/client/rpc/stream_transport.h (+4/-5)
src/client/symbols-debug.map (+9/-1)
src/client/symbols.map (+17/-2)
src/common/CMakeLists.txt (+4/-1)
src/common/dispatch/CMakeLists.txt (+22/-0)
src/common/dispatch/simple_dispatch_thread.cpp (+158/-0)
src/common/events/CMakeLists.txt (+21/-0)
src/common/events/event_builders.cpp (+354/-0)
src/common/geometry/rectangles.cpp (+7/-1)
src/common/graphics/android/mir_native_window.cpp (+14/-14)
src/common/input/android/android_input_lexicon.cpp (+6/-4)
src/common/input/android/android_input_receiver.cpp (+5/-3)
src/common/input/android/android_input_receiver.h (+1/-1)
src/common/input/android/android_input_receiver_thread.cpp (+2/-0)
src/common/input/input_event.cpp (+147/-6)
src/common/logging/dumb_console_logger.cpp (+8/-9)
src/common/logging/input_timestamp.cpp (+6/-6)
src/common/symbols.map (+13/-4)
src/include/client/mir/client_context.h (+1/-1)
src/include/client/mir/client_platform.h (+15/-3)
src/include/client/mir/egl_native_display_container.h (+2/-2)
src/include/client/mir/egl_native_surface.h (+8/-8)
src/include/client/mir/egl_native_window_factory.h (+2/-2)
src/include/common/mir/input/xkb_mapper.h (+2/-0)
src/include/common/mir/logging/input_timestamp.h (+5/-1)
src/include/common/mir/require.h (+0/-32)
src/include/common/mir/uncaught.h (+7/-1)
src/include/platform/mir/graphics/nested_context.h (+3/-1)
src/include/platform/mir/graphics/platform_probe.h (+37/-0)
src/include/platform/mir/options/configuration.h (+2/-1)
src/include/platform/mir/options/default_configuration.h (+5/-0)
src/include/platform/mir/shared_library_loader.h (+0/-28)
src/include/server/mir/asio_main_loop.h (+0/-92)
src/include/server/mir/compositor/buffer_stream.h (+1/-1)
src/include/server/mir/compositor/compositor_report.h (+2/-1)
src/include/server/mir/compositor/gl_program_family.h (+67/-0)
src/include/server/mir/compositor/gl_renderer.h (+29/-12)
src/include/server/mir/default_server_configuration.h (+15/-13)
src/include/server/mir/frontend/message_processor_report.h (+0/-2)
src/include/server/mir/frontend/shell.h (+16/-1)
src/platform/CMakeLists.txt (+6/-6)
src/platform/graphics/CMakeLists.txt (+1/-0)
src/platform/graphics/platform_probe.cpp (+59/-0)
src/platform/options/default_configuration.cpp (+50/-23)
src/platform/symbols.map (+4/-6)
src/platforms/CMakeLists.txt (+34/-3)
src/platforms/android/CMakeLists.txt (+2/-0)
src/platforms/android/client/CMakeLists.txt (+3/-2)
src/platforms/android/client/android_client_buffer_factory.h (+1/-1)
src/platforms/android/client/android_client_platform.cpp (+21/-4)
src/platforms/android/client/android_client_platform.h (+12/-6)
src/platforms/android/client/android_native_display_container.cpp (+2/-2)
src/platforms/android/client/android_native_display_container.h (+2/-2)
src/platforms/android/client/buffer.h (+1/-1)
src/platforms/android/client/client_platform_factory.cpp (+5/-5)
src/platforms/android/client/egl_native_surface_interpreter.cpp (+8/-8)
src/platforms/android/client/egl_native_surface_interpreter.h (+7/-7)
src/platforms/android/client/gralloc_registrar.cpp (+1/-1)
src/platforms/android/hwc_common_device.cpp (+0/-104)
src/platforms/android/hwc_common_device.h (+0/-74)
src/platforms/android/hwc_vsync.cpp (+0/-42)
src/platforms/android/hwc_vsync.h (+0/-49)
src/platforms/android/hwc_vsync_coordinator.h (+0/-46)
src/platforms/android/server/CMakeLists.txt (+21/-28)
src/platforms/android/server/configurable_display_buffer.h (+1/-2)
src/platforms/android/server/display.cpp (+146/-25)
src/platforms/android/server/display.h (+23/-9)
src/platforms/android/server/display_buffer.cpp (+28/-61)
src/platforms/android/server/display_buffer.h (+15/-11)
src/platforms/android/server/display_component_factory.h (+17/-15)
src/platforms/android/server/display_configuration.cpp (+91/-15)
src/platforms/android/server/display_configuration.h (+8/-2)
src/platforms/android/server/display_device.h (+13/-6)
src/platforms/android/server/display_resource_factory.h (+14/-15)
src/platforms/android/server/fb_device.cpp (+49/-23)
src/platforms/android/server/fb_device.h (+18/-5)
src/platforms/android/server/framebuffer_bundle.h (+0/-1)
src/platforms/android/server/framebuffers.cpp (+6/-67)
src/platforms/android/server/framebuffers.h (+2/-5)
src/platforms/android/server/hal_component_factory.cpp (+71/-59)
src/platforms/android/server/hal_component_factory.h (+14/-16)
src/platforms/android/server/hwc_blanking_control.cpp (+67/-16)
src/platforms/android/server/hwc_configuration.h (+12/-1)
src/platforms/android/server/hwc_device.cpp (+38/-104)
src/platforms/android/server/hwc_device.h (+8/-13)
src/platforms/android/server/hwc_fb_device.cpp (+41/-20)
src/platforms/android/server/hwc_fb_device.h (+19/-12)
src/platforms/android/server/hwc_layerlist.cpp (+88/-25)
src/platforms/android/server/hwc_layerlist.h (+20/-12)
src/platforms/android/server/hwc_layers.cpp (+55/-13)
src/platforms/android/server/hwc_layers.h (+21/-6)
src/platforms/android/server/hwc_loggers.cpp (+17/-22)
src/platforms/android/server/hwc_loggers.h (+2/-2)
src/platforms/android/server/hwc_report.h (+2/-1)
src/platforms/android/server/hwc_wrapper.h (+14/-5)
src/platforms/android/server/platform.cpp (+35/-11)
src/platforms/android/server/platform.h (+7/-4)
src/platforms/android/server/real_hwc_wrapper.cpp (+124/-15)
src/platforms/android/server/real_hwc_wrapper.h (+31/-4)
src/platforms/android/server/resource_factory.cpp (+19/-39)
src/platforms/android/server/resource_factory.h (+2/-14)
src/platforms/android/server/server_render_window.cpp (+1/-2)
src/platforms/android/server/symbols.map (+10/-0)
src/platforms/common/CMakeLists.txt (+1/-0)
src/platforms/common/client/mir/CMakeLists.txt (+5/-0)
src/platforms/common/client/mir/aging_buffer.h (+1/-1)
src/platforms/common/server/symbols.map (+4/-3)
src/platforms/mesa/CMakeLists.txt (+25/-0)
src/platforms/mesa/client/CMakeLists.txt (+3/-1)
src/platforms/mesa/client/client_buffer.h (+1/-1)
src/platforms/mesa/client/client_buffer_factory.h (+1/-1)
src/platforms/mesa/client/client_platform.cpp (+55/-5)
src/platforms/mesa/client/client_platform.h (+11/-6)
src/platforms/mesa/client/client_platform_factory.cpp (+5/-5)
src/platforms/mesa/client/mesa_native_display_container.cpp (+5/-5)
src/platforms/mesa/client/mesa_native_display_container.h (+2/-2)
src/platforms/mesa/client/native_surface.cpp (+12/-15)
src/platforms/mesa/client/native_surface.h (+3/-3)
src/platforms/mesa/include/mir_toolkit/mesa/native_display.h (+2/-2)
src/platforms/mesa/include/mir_toolkit/mesa/platform_operation.h (+77/-0)
src/platforms/mesa/mir-client-platform-mesa-dev.pc.in (+7/-0)
src/platforms/mesa/server/CMakeLists.txt (+23/-26)
src/platforms/mesa/server/bypass.cpp (+2/-3)
src/platforms/mesa/server/display_buffer.cpp (+25/-0)
src/platforms/mesa/server/ipc_operations.cpp (+57/-11)
src/platforms/mesa/server/nested_authentication.cpp (+74/-25)
src/platforms/mesa/server/platform.cpp (+32/-8)
src/platforms/mesa/server/platform.h (+0/-4)
src/platforms/mesa/server/symbols.map (+16/-0)
src/protobuf/mir_protobuf.proto (+19/-0)
src/server/CMakeLists.txt (+6/-3)
src/server/asio_main_loop.cpp (+0/-563)
src/server/compositor/CMakeLists.txt (+1/-0)
src/server/compositor/buffer_bundle.h (+1/-1)
src/server/compositor/buffer_queue.cpp (+10/-6)
src/server/compositor/buffer_queue.h (+1/-1)
src/server/compositor/buffer_stream_surfaces.cpp (+2/-2)
src/server/compositor/buffer_stream_surfaces.h (+1/-1)
src/server/compositor/default_configuration.cpp (+1/-1)
src/server/compositor/default_display_buffer_compositor.cpp (+4/-6)
src/server/compositor/gl_program_family.cpp (+115/-0)
src/server/compositor/gl_renderer.cpp (+61/-56)
src/server/compositor/gl_renderer_factory.cpp (+1/-6)
src/server/compositor/gl_renderer_factory.h (+0/-7)
src/server/compositor/multi_threaded_compositor.cpp (+12/-1)
src/server/compositor/occlusion.cpp (+0/-6)
src/server/default_server_configuration.cpp (+1/-5)
src/server/display_server.cpp (+4/-0)
src/server/frontend/event_sender.cpp (+2/-0)
src/server/frontend/protobuf_message_processor.cpp (+6/-4)
src/server/frontend/session_mediator.cpp (+48/-36)
src/server/frontend/shell_wrapper.cpp (+27/-0)
src/server/frontend/shell_wrapper.h (+15/-0)
src/server/graphics/CMakeLists.txt (+2/-1)
src/server/graphics/default_configuration.cpp (+63/-56)
src/server/graphics/nested/host_connection.h (+2/-5)
src/server/graphics/nested/mir_client_host_connection.cpp (+39/-20)
src/server/graphics/nested/mir_client_host_connection.h (+2/-1)
src/server/graphics/nested/nested_output.cpp (+2/-0)
src/server/graphics/software_cursor.cpp (+213/-0)
src/server/graphics/software_cursor.h (+67/-0)
src/server/input/android/android_input_application_handle.cpp (+1/-1)
src/server/input/android/android_input_dispatcher.cpp (+8/-6)
src/server/input/android/android_input_dispatcher.h (+2/-2)
src/server/input/android/android_input_manager.cpp (+2/-0)
src/server/input/android/android_input_window_handle.cpp (+1/-1)
src/server/input/android/event_filter_dispatcher_policy.cpp (+11/-8)
src/server/input/android/event_filter_dispatcher_policy.h (+6/-6)
src/server/input/android/input_sender.cpp (+6/-4)
src/server/input/android/input_translator.cpp (+6/-4)
src/server/input/cursor_controller.cpp (+20/-13)
src/server/input/cursor_controller.h (+2/-2)
src/server/input/default_configuration.cpp (+2/-0)
src/server/input/null_input_dispatcher.cpp (+4/-2)
src/server/input/null_input_dispatcher.h (+2/-2)
src/server/input/touchspot_controller.cpp (+0/-10)
src/server/input/vt_filter.cpp (+2/-0)
src/server/report/default_server_configuration.cpp (+9/-0)
src/server/report/logging/compositor_report.cpp (+14/-7)
src/server/report/logging/compositor_report.h (+3/-1)
src/server/report/logging/input_report.cpp (+3/-3)
src/server/report/logging/logging_report_factory.cpp (+5/-0)
src/server/report/logging/message_processor_report.cpp (+0/-7)
src/server/report/logging/message_processor_report.h (+0/-2)
src/server/report/logging_report_factory.h (+1/-0)
src/server/report/lttng/CMakeLists.txt (+1/-0)
src/server/report/lttng/compositor_report.cpp (+8/-3)
src/server/report/lttng/compositor_report.h (+2/-1)
src/server/report/lttng/compositor_report_tp.h (+12/-4)
src/server/report/lttng/lttng_report_factory.cpp (+6/-0)
src/server/report/lttng/message_processor_report.cpp (+2/-6)
src/server/report/lttng/message_processor_report.h (+0/-1)
src/server/report/lttng/message_processor_report_tp.h (+0/-12)
src/server/report/lttng/shared_library_prober_report.cpp (+52/-0)
src/server/report/lttng/shared_library_prober_report.h (+48/-0)
src/server/report/lttng/shared_library_prober_report_tp.h (+70/-0)
src/server/report/lttng/tracepoints.c (+1/-0)
src/server/report/lttng_report_factory.h (+1/-0)
src/server/report/null/compositor_report.cpp (+5/-1)
src/server/report/null/compositor_report.h (+2/-1)
src/server/report/null/message_processor_report.cpp (+0/-4)
src/server/report/null/message_processor_report.h (+0/-2)
src/server/report/null/null_report_factory.cpp (+11/-0)
src/server/report/null_report_factory.h (+2/-0)
src/server/report/report_factory.h (+2/-0)
src/server/scene/application_session.cpp (+19/-21)
src/server/scene/application_session.h (+1/-0)
src/server/scene/basic_surface.cpp (+37/-18)
src/server/scene/basic_surface.h (+15/-3)
src/server/scene/default_configuration.cpp (+4/-36)
src/server/scene/session_manager.cpp (+26/-93)
src/server/scene/session_manager.h (+7/-30)
src/server/scene/surface_allocator.cpp (+1/-3)
src/server/scene/surface_allocator.h (+0/-2)
src/server/scene/surface_controller.cpp (+4/-9)
src/server/scene/surface_controller.h (+1/-3)
src/server/scene/surface_creation_parameters.cpp (+12/-0)
src/server/scene/surface_event_source.cpp (+6/-35)
src/server/scene/surface_stack.cpp (+39/-7)
src/server/scene/surface_stack.h (+2/-0)
src/server/server.cpp (+13/-15)
src/server/shell/CMakeLists.txt (+4/-3)
src/server/shell/abstract_shell.cpp (+197/-0)
src/server/shell/default_configuration.cpp (+39/-15)
src/server/shell/default_focus_mechanism.cpp (+0/-66)
src/server/shell/default_focus_mechanism.h (+0/-60)
src/server/shell/default_shell.cpp (+96/-0)
src/server/shell/default_shell.h (+73/-0)
src/server/shell/frontend_shell.cpp (+106/-0)
src/server/shell/frontend_shell.h (+81/-0)
src/server/shell/session_coordinator_wrapper.cpp (+0/-85)
src/server/shell/shell_wrapper.cpp (+106/-0)
src/server/shell/surface_coordinator_wrapper.cpp (+0/-46)
src/server/symbols.map (+239/-267)
src/utils/ping.c (+4/-4)
src/wrapper.c (+19/-2)
tests/CMakeLists.txt (+2/-0)
tests/acceptance-tests/CMakeLists.txt (+1/-6)
tests/acceptance-tests/server_configuration_wrapping.cpp (+68/-58)
tests/acceptance-tests/test_client_focus_notification.cpp (+3/-0)
tests/acceptance-tests/test_client_library.cpp (+8/-9)
tests/acceptance-tests/test_client_library_drm.cpp (+0/-46)
tests/acceptance-tests/test_client_library_errors.cpp (+14/-4)
tests/acceptance-tests/test_client_platform_operation.cpp (+2/-2)
tests/acceptance-tests/test_client_surface_events.cpp (+22/-20)
tests/acceptance-tests/test_client_surface_visibility.cpp (+40/-35)
tests/acceptance-tests/test_client_surfaces.cpp (+87/-2)
tests/acceptance-tests/test_prompt_session_client_api.cpp (+10/-11)
tests/acceptance-tests/test_surfaces_with_output_id.cpp (+21/-19)
tests/acceptance-tests/test_symbols_required_by_mesa.cpp (+1/-12)
tests/acceptance-tests/throwback/test_client_cursor_api.cpp (+6/-6)
tests/acceptance-tests/throwback/test_client_input.cpp (+69/-63)
tests/acceptance-tests/throwback/test_custom_input_dispatcher.cpp (+5/-3)
tests/acceptance-tests/throwback/test_focus_selection.cpp (+58/-25)
tests/acceptance-tests/throwback/test_shell_control_of_surface_configuration.cpp (+14/-18)
tests/include/mir_test/client_event_matchers.h (+0/-268)
tests/include/mir_test/event_factory.h (+1/-1)
tests/include/mir_test/event_matchers.h (+307/-45)
tests/include/mir_test/fake_event_hub.h (+2/-2)
tests/include/mir_test/fd_utils.h (+69/-0)
tests/include/mir_test/pipe.h (+8/-4)
tests/include/mir_test/test_dispatchable.h (+60/-0)
tests/include/mir_test/test_protobuf_client.h (+5/-0)
tests/include/mir_test_doubles/fake_renderable.h (+9/-33)
tests/include/mir_test_doubles/mock_alloc_adaptor.h (+1/-1)
tests/include/mir_test_doubles/mock_buffer_bundle.h (+1/-1)
tests/include/mir_test_doubles/mock_buffer_registrar.h (+1/-1)
tests/include/mir_test_doubles/mock_buffer_stream.h (+3/-3)
tests/include/mir_test_doubles/mock_client_buffer_factory.h (+41/-0)
tests/include/mir_test_doubles/mock_client_buffer_stream.h (+47/-0)
tests/include/mir_test_doubles/mock_client_buffer_stream_factory.h (+43/-0)
tests/include/mir_test_doubles/mock_client_context.h (+3/-3)
tests/include/mir_test_doubles/mock_compositor_report.h (+4/-2)
tests/include/mir_test_doubles/mock_display_device.h (+10/-8)
tests/include/mir_test_doubles/mock_egl_native_surface.h (+7/-6)
tests/include/mir_test_doubles/mock_focus_setter.h (+0/-42)
tests/include/mir_test_doubles/mock_framebuffer_bundle.h (+16/-6)
tests/include/mir_test_doubles/mock_hwc_device_wrapper.h (+10/-2)
tests/include/mir_test_doubles/mock_hwc_layerlist.h (+1/-1)
tests/include/mir_test_doubles/mock_hwc_report.h (+2/-2)
tests/include/mir_test_doubles/mock_hwc_vsync_coordinator.h (+0/-44)
tests/include/mir_test_doubles/mock_input_dispatcher.h (+2/-2)
tests/include/mir_test_doubles/mock_interpreter_resource_cache.h (+1/-1)
tests/include/mir_test_doubles/mock_nested_context.h (+45/-0)
tests/include/mir_test_doubles/mock_renderable.h (+0/-3)
tests/include/mir_test_doubles/mock_renderable_list_compositor.h (+1/-1)
tests/include/mir_test_doubles/mock_scene.h (+3/-0)
tests/include/mir_test_doubles/mock_scene_session.h (+1/-0)
tests/include/mir_test_doubles/mock_shell.h (+11/-0)
tests/include/mir_test_doubles/mock_surface.h (+0/-1)
tests/include/mir_test_doubles/mock_surface_coordinator.h (+1/-0)
tests/include/mir_test_doubles/mock_swapping_gl_context.h (+1/-1)
tests/include/mir_test_doubles/mock_virtual_terminal.h (+1/-1)
tests/include/mir_test_doubles/null_client_buffer.h (+1/-1)
tests/include/mir_test_doubles/null_virtual_terminal.h (+1/-1)
tests/include/mir_test_doubles/stub_buffer.h (+6/-1)
tests/include/mir_test_doubles/stub_buffer_stream.h (+4/-1)
tests/include/mir_test_doubles/stub_client_buffer.h (+1/-1)
tests/include/mir_test_doubles/stub_client_buffer_factory.h (+1/-1)
tests/include/mir_test_doubles/stub_client_buffer_stream_factory.h (+52/-0)
tests/include/mir_test_doubles/stub_display_builder.h (+60/-45)
tests/include/mir_test_doubles/stub_gbm_native_buffer.h (+1/-1)
tests/include/mir_test_doubles/stub_host_connection.h (+6/-1)
tests/include/mir_test_doubles/stub_input_channel.h (+3/-2)
tests/include/mir_test_doubles/stub_renderable.h (+5/-24)
tests/include/mir_test_doubles/stub_renderable_list_compositor.h (+1/-1)
tests/include/mir_test_doubles/stub_scene.h (+5/-1)
tests/include/mir_test_doubles/stub_scene_session.h (+4/-0)
tests/include/mir_test_doubles/stub_scene_surface.h (+3/-0)
tests/include/mir_test_doubles/stub_session.h (+0/-13)
tests/include/mir_test_doubles/stub_swapping_gl_context.h (+1/-1)
tests/include/mir_test_doubles/triggered_main_loop.h (+66/-0)
tests/include/mir_test_framework/client_platform_factory.h (+7/-13)
tests/include/mir_test_framework/executable_path.h (+2/-0)
tests/include/mir_test_framework/headless_test.h (+1/-1)
tests/include/mir_test_framework/stub_client_platform_factory.h (+1/-1)
tests/include/mir_test_framework/stub_server_platform_factory.h (+49/-0)
tests/integration-tests/CMakeLists.txt (+11/-3)
tests/integration-tests/client/test_mirsurface.cpp (+140/-26)
tests/integration-tests/client/test_screencast.cpp (+10/-3)
tests/integration-tests/graphics/android/test_buffer_integration.cpp (+1/-1)
tests/integration-tests/graphics/android/test_client_render.cpp (+12/-10)
tests/integration-tests/graphics/android/test_display_integration.cpp (+8/-8)
tests/integration-tests/input/android/test_android_cursor_listener.cpp (+3/-1)
tests/integration-tests/input/android/test_android_input_manager.cpp (+25/-22)
tests/integration-tests/input/test_nested_input.cpp (+3/-1)
tests/integration-tests/session_management.cpp (+5/-5)
tests/integration-tests/surface_composition.cpp (+0/-6)
tests/integration-tests/test_client_surface_swap_buffers.cpp (+0/-85)
tests/integration-tests/test_default_shell.cpp (+211/-85)
tests/integration-tests/test_display_server_main_loop_events.cpp (+2/-0)
tests/integration-tests/test_drm_auth_magic.cpp (+9/-53)
tests/integration-tests/test_exchange_buffer.cpp (+1/-1)
tests/integration-tests/test_surface_stack_with_compositor.cpp (+5/-6)
tests/mir_test/CMakeLists.txt (+2/-0)
tests/mir_test/fd_utils.cpp (+40/-0)
tests/mir_test/pipe.cpp (+21/-18)
tests/mir_test/test_dispatchable.cpp (+98/-0)
tests/mir_test_doubles/CMakeLists.txt (+11/-8)
tests/mir_test_doubles/event_factory.cpp (+1/-1)
tests/mir_test_doubles/fake_event_hub.cpp (+11/-11)
tests/mir_test_doubles/mock_gl.cpp (+4/-1)
tests/mir_test_doubles/platform_factory.cpp (+1/-1)
tests/mir_test_doubles/test_protobuf_client.cpp (+8/-1)
tests/mir_test_doubles/triggered_main_loop.cpp (+100/-0)
tests/mir_test_framework/CMakeLists.txt (+36/-18)
tests/mir_test_framework/executable_path.cpp (+27/-0)
tests/mir_test_framework/headless_test.cpp (+5/-27)
tests/mir_test_framework/input_testing_server_options.cpp (+0/-1)
tests/mir_test_framework/platform_graphics_dummy.cpp (+36/-0)
tests/mir_test_framework/server_runner.cpp (+2/-0)
tests/mir_test_framework/stub_client_platform_factory.cpp (+25/-6)
tests/mir_test_framework/stub_client_platform_module.cpp (+3/-3)
tests/mir_test_framework/stub_server_platform_factory.cpp (+72/-0)
tests/mir_test_framework/stubbed_graphics_platform.cpp (+11/-7)
tests/mir_test_framework/stubbed_server_configuration.cpp (+4/-2)
tests/mir_test_framework/symbols-server.map (+8/-0)
tests/mir_test_framework/testing_client_options.cpp (+2/-53)
tests/mir_test_framework/udev_recordings/joystick-detection.ioctl (+25/-0)
tests/mir_test_framework/udev_recordings/joystick-detection.umockdev (+351/-0)
tests/mir_test_framework/udev_recordings/mt-screen-detection.ioctl (+28/-0)
tests/mir_test_framework/udev_recordings/mt-screen-detection.umockdev (+44/-0)
tests/mir_test_framework/udev_recordings/synaptics-touchpad.ioctl (+0/-7)
tests/unit-tests/CMakeLists.txt (+29/-9)
tests/unit-tests/android_input/input_reader.cpp (+21/-21)
tests/unit-tests/client/CMakeLists.txt (+2/-0)
tests/unit-tests/client/android/CMakeLists.txt (+2/-2)
tests/unit-tests/client/android/test_android_client_platform.cpp (+6/-6)
tests/unit-tests/client/android/test_android_native_window.cpp (+1/-1)
tests/unit-tests/client/android/test_buffer.cpp (+1/-1)
tests/unit-tests/client/android/test_egl_native_surface_interpreter.cpp (+16/-16)
tests/unit-tests/client/android/test_gralloc_registrar.cpp (+1/-1)
tests/unit-tests/client/input/test_android_input_receiver.cpp (+48/-44)
tests/unit-tests/client/input/test_android_input_receiver_thread.cpp (+2/-0)
tests/unit-tests/client/mesa/CMakeLists.txt (+1/-1)
tests/unit-tests/client/mesa/test_client_buffer.cpp (+3/-3)
tests/unit-tests/client/mesa/test_client_platform.cpp (+79/-8)
tests/unit-tests/client/mesa/test_mesa_native_display_container.cpp (+5/-5)
tests/unit-tests/client/mesa/test_native_surface.cpp (+4/-4)
tests/unit-tests/client/test_aging_buffer.cpp (+1/-1)
tests/unit-tests/client/test_client_buffer_depository.cpp (+2/-2)
tests/unit-tests/client/test_client_buffer_stream.cpp (+404/-0)
tests/unit-tests/client/test_client_mir_surface.cpp (+88/-266)
tests/unit-tests/client/test_client_platform.cpp (+12/-11)
tests/unit-tests/client/test_event_distributor.cpp (+2/-0)
tests/unit-tests/client/test_mir_connection.cpp (+112/-86)
tests/unit-tests/client/test_mir_prompt_session.cpp (+2/-0)
tests/unit-tests/client/test_mir_screencast.cpp (+71/-214)
tests/unit-tests/client/test_probing_client_platform_factory.cpp (+8/-8)
tests/unit-tests/client/test_protobuf_rpc_channel.cpp (+4/-0)
tests/unit-tests/client/test_stream_transport.cpp (+250/-118)
tests/unit-tests/compositor/test_buffer_queue.cpp (+66/-0)
tests/unit-tests/compositor/test_compositing_screencast.cpp (+2/-16)
tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+34/-81)
tests/unit-tests/compositor/test_gl_renderer.cpp (+22/-71)
tests/unit-tests/compositor/test_multi_threaded_compositor.cpp (+85/-0)
tests/unit-tests/compositor/test_occlusion.cpp (+1/-24)
tests/unit-tests/dispatch/CMakeLists.txt (+5/-0)
tests/unit-tests/dispatch/test_simple_dispatch_thread.cpp (+185/-0)
tests/unit-tests/examples/test_demo_compositor.cpp (+13/-27)
tests/unit-tests/examples/test_demo_renderer.cpp (+14/-3)
tests/unit-tests/frontend/test_event_sender.cpp (+2/-0)
tests/unit-tests/frontend/test_protobuf_message_processor.cpp (+0/-3)
tests/unit-tests/frontend/test_published_socket_connector.cpp (+2/-0)
tests/unit-tests/frontend/test_session_mediator.cpp (+18/-37)
tests/unit-tests/geometry/test-rectangles.cpp (+102/-54)
tests/unit-tests/graphics/CMakeLists.txt (+2/-0)
tests/unit-tests/graphics/android/CMakeLists.txt (+1/-1)
tests/unit-tests/graphics/android/hwc_struct_helpers.cpp (+28/-0)
tests/unit-tests/graphics/android/hwc_struct_helpers.h (+15/-0)
tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp (+1/-1)
tests/unit-tests/graphics/android/test_android_buffer_allocator.cpp (+1/-1)
tests/unit-tests/graphics/android/test_buffer.cpp (+1/-1)
tests/unit-tests/graphics/android/test_buffer_tex_bind.cpp (+1/-1)
tests/unit-tests/graphics/android/test_device_detection.cpp (+1/-1)
tests/unit-tests/graphics/android/test_display.cpp (+366/-60)
tests/unit-tests/graphics/android/test_display_buffer.cpp (+156/-236)
tests/unit-tests/graphics/android/test_display_hotplug.cpp (+140/-0)
tests/unit-tests/graphics/android/test_fb_device.cpp (+46/-29)
tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp (+12/-107)
tests/unit-tests/graphics/android/test_hwc_common_device.cpp (+0/-176)
tests/unit-tests/graphics/android/test_hwc_configuration.cpp (+71/-5)
tests/unit-tests/graphics/android/test_hwc_device.cpp (+102/-119)
tests/unit-tests/graphics/android/test_hwc_fallback_gl_renderer.cpp (+1/-1)
tests/unit-tests/graphics/android/test_hwc_fb_device.cpp (+51/-42)
tests/unit-tests/graphics/android/test_hwc_layerlist.cpp (+140/-46)
tests/unit-tests/graphics/android/test_hwc_layers.cpp (+8/-8)
tests/unit-tests/graphics/android/test_hwc_logger.cpp (+7/-7)
tests/unit-tests/graphics/android/test_hwc_wrapper.cpp (+90/-21)
tests/unit-tests/graphics/android/test_interpreter_buffer_cache.cpp (+1/-1)
tests/unit-tests/graphics/android/test_ipc_operations.cpp (+1/-1)
tests/unit-tests/graphics/android/test_output_builder.cpp (+50/-75)
tests/unit-tests/graphics/android/test_pixel_format.cpp (+1/-1)
tests/unit-tests/graphics/android/test_platform.cpp (+33/-7)
tests/unit-tests/graphics/android/test_resource_factory.cpp (+9/-4)
tests/unit-tests/graphics/android/test_server_interpreter.cpp (+1/-10)
tests/unit-tests/graphics/mesa/mock_kms_output.h (+1/-1)
tests/unit-tests/graphics/mesa/test_anonymous_shm_file.cpp (+1/-1)
tests/unit-tests/graphics/mesa/test_buffer_allocator.cpp (+2/-2)
tests/unit-tests/graphics/mesa/test_bypass.cpp (+8/-47)
tests/unit-tests/graphics/mesa/test_cursor.cpp (+4/-4)
tests/unit-tests/graphics/mesa/test_display.cpp (+5/-4)
tests/unit-tests/graphics/mesa/test_display_buffer.cpp (+32/-9)
tests/unit-tests/graphics/mesa/test_display_configuration.cpp (+2/-2)
tests/unit-tests/graphics/mesa/test_drm_helper.cpp (+18/-2)
tests/unit-tests/graphics/mesa/test_gbm_buffer.cpp (+2/-2)
tests/unit-tests/graphics/mesa/test_guest_platform.cpp (+13/-11)
tests/unit-tests/graphics/mesa/test_ipc_operations.cpp (+41/-14)
tests/unit-tests/graphics/mesa/test_kms_page_flipper.cpp (+1/-1)
tests/unit-tests/graphics/mesa/test_linux_virtual_terminal.cpp (+1/-1)
tests/unit-tests/graphics/mesa/test_nested_authentication.cpp (+56/-91)
tests/unit-tests/graphics/mesa/test_platform.cpp (+25/-44)
tests/unit-tests/graphics/mesa/test_real_kms_output.cpp (+2/-2)
tests/unit-tests/graphics/mesa/test_shm_buffer.cpp (+2/-2)
tests/unit-tests/graphics/nested/test_nested_display.cpp (+2/-0)
tests/unit-tests/graphics/nested/test_nested_display_buffer.cpp (+1/-0)
tests/unit-tests/graphics/test_platform_prober.cpp (+215/-0)
tests/unit-tests/graphics/test_program_factory.cpp (+13/-27)
tests/unit-tests/graphics/test_software_cursor.cpp (+276/-0)
tests/unit-tests/input/CMakeLists.txt (+1/-0)
tests/unit-tests/input/android/test_android_input_application_handle.cpp (+3/-1)
tests/unit-tests/input/android/test_android_input_dispatcher.cpp (+6/-4)
tests/unit-tests/input/android/test_android_input_lexicon.cpp (+14/-12)
tests/unit-tests/input/android/test_android_input_manager.cpp (+1/-1)
tests/unit-tests/input/android/test_android_input_sender.cpp (+16/-99)
tests/unit-tests/input/android/test_android_input_window_handle.cpp (+2/-0)
tests/unit-tests/input/android/test_event_filter_input_dispatcher_policy.cpp (+3/-1)
tests/unit-tests/input/android/test_input_translator.cpp (+19/-20)
tests/unit-tests/input/test_event_builders.cpp (+126/-0)
tests/unit-tests/input/test_event_filter_chain.cpp (+2/-0)
tests/unit-tests/input/test_input_event.cpp (+210/-27)
tests/unit-tests/logging/test_compositor_report.cpp (+34/-8)
tests/unit-tests/scene/CMakeLists.txt (+1/-0)
tests/unit-tests/scene/test_application_session.cpp (+32/-0)
tests/unit-tests/scene/test_basic_surface.cpp (+24/-48)
tests/unit-tests/scene/test_default_shell.cpp (+206/-0)
tests/unit-tests/scene/test_global_event_sender.cpp (+2/-0)
tests/unit-tests/scene/test_session_manager.cpp (+35/-83)
tests/unit-tests/scene/test_surface.cpp (+4/-6)
tests/unit-tests/scene/test_surface_controller.cpp (+0/-49)
tests/unit-tests/scene/test_surface_impl.cpp (+3/-30)
tests/unit-tests/scene/test_surface_stack.cpp (+79/-14)
tests/unit-tests/shared_library_test.cpp (+1/-1)
tests/unit-tests/shell/CMakeLists.txt (+0/-1)
tests/unit-tests/shell/test_default_focus_mechanism.cpp (+0/-126)
tests/unit-tests/test_asio_main_loop.cpp (+0/-859)
tests/unit-tests/test_glib_main_loop.cpp (+3/-1)
tools/install_on_android.sh (+3/-3)
tools/valgrind_suppressions_armhf (+16/-0)
To merge this branch: bzr merge lp:mir/0.11
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre (community) Needs Information
PS Jenkins bot (community) continuous-integration Approve
Daniel van Vugt Abstain
Review via email: mp+248221@code.launchpad.net

Commit message

Release 0.11

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
Daniel van Vugt (vanvugt) wrote :

TODOs and general lack of text in debian/changelog. Remind me to fill it out today...

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Abstain
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 think the failure is bug 1407863 which has a fix on lp:mir. That and other changes will be merged here tomorrow-ish apparently.

lp:mir/0.11 updated
2283. By Robert Carr <racarr@ocelot>

Merge trunk

2284. By Robert Carr <racarr@ocelot>

Merge lp:~vanvugt/mir/fix-buffers_ready_for_compositor

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:mir/0.11 updated
2285. By Robert Carr

Cherrypick lp:~mir-team/mir/repair-client-abi 2303...2305

2286. By Robert Carr

Merge changelog

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:mir/0.11 updated
2287. By Robert Carr

Cherrypick lp:~mir-team/mir/catch-exceptions-at-android-driver-boundary

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Seems to me like there is a mir-client-platform-android-dev package missing, given that there is mir-client-platform-mesa-dev.

Also, I see debian/changelog doesn't list the changes to packages provided aside from the ABI changes; I think those and the relevant changes to debian/rules should be listed as well.

Finally, this is a rather big changeset, I'd feel much more confident if it could go through review from the usual trainguards too, since I haven't dealt with Mir updates for almost a year and I remember there are a few details that needed to be followed when publishing it.

Has the upgrade path been tested using the PPA to make sure packages update themselves safely on all types of devices (mesa and android) ?

review: Needs Information
lp:mir/0.11 updated
2288. By Robert Carr

Update changelog

Revision history for this message
Robert Carr (robertcarr) wrote :

Hey. Thanks :)

>> Seems to me like there is a mir-client-platform-android-dev package missing, given that there is >> mir-client-platform-mesa-dev.

I think this just isn't required. For mesa Mir has to publish some new interfaces for mesa EGL to plug in to but on android android EGL publishes the interfaces for Mir to plug in to.

>> Also, I see debian/changelog doesn't list the changes to packages provided aside from the ABI
>> changes; I think those and the relevant changes to debian/rules should be listed as well.

Made a best effort to summarize...feverish state making it difficult to require details. If more info required seek RAOF.

>> Has the upgrade path been tested using the PPA to make sure packages update themselves safely >> on all types of devices (mesa and android) ?

Yes :) Tested on Desktop and Android

>> Finally, this is a rather big changeset, I'd feel much more confident if it could go through
>> review from the usual trainguards too, since I haven't dealt with Mir updates for almost a year >> and I remember there are a few details that needed to be followed when publishing it.

Makes sense to me

Revision history for this message
Robert Carr (robertcarr) wrote :

The changelog commit was missing from the silo.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/android-deps/std/Condition.h'
2--- 3rd_party/android-deps/std/Condition.h 2013-05-03 16:38:07 +0000
3+++ 3rd_party/android-deps/std/Condition.h 2015-02-09 23:59:09 +0000
4@@ -32,7 +32,7 @@
5 inline void broadcast(Condition& c) { c.notify_all(); }
6
7 template <typename Lock>
8-inline void waitRelative(Condition& c, Lock& l, nsecs_t reltime)
9+inline void waitRelative(Condition& c, Lock& l, std::chrono::nanoseconds reltime)
10 {
11 c.wait_for(l, std::chrono::nanoseconds(reltime));
12 }
13
14=== modified file '3rd_party/android-deps/utils/Timers.h'
15--- 3rd_party/android-deps/utils/Timers.h 2013-03-13 04:54:15 +0000
16+++ 3rd_party/android-deps/utils/Timers.h 2015-02-09 23:59:09 +0000
17@@ -23,6 +23,7 @@
18 #include <stdint.h>
19 #include <sys/types.h>
20 #include <sys/time.h>
21+#include <chrono>
22
23 // ------------------------------------------------------------------
24 // C API
25@@ -31,48 +32,48 @@
26 extern "C" {
27 #endif
28
29-typedef int64_t nsecs_t; // nano-seconds
30+typedef int64_t nsecs_t;
31
32-static inline nsecs_t seconds_to_nanoseconds(nsecs_t secs)
33+static inline std::chrono::nanoseconds seconds_to_nanoseconds(std::chrono::nanoseconds secs)
34 {
35 return secs*1000000000;
36 }
37
38-static inline nsecs_t milliseconds_to_nanoseconds(nsecs_t secs)
39+static inline std::chrono::nanoseconds milliseconds_to_nanoseconds(std::chrono::nanoseconds secs)
40 {
41 return secs*1000000;
42 }
43
44-static inline nsecs_t microseconds_to_nanoseconds(nsecs_t secs)
45+static inline std::chrono::nanoseconds microseconds_to_nanoseconds(std::chrono::nanoseconds secs)
46 {
47 return secs*1000;
48 }
49
50-static inline nsecs_t nanoseconds_to_seconds(nsecs_t secs)
51+static inline std::chrono::nanoseconds nanoseconds_to_seconds(std::chrono::nanoseconds secs)
52 {
53 return secs/1000000000;
54 }
55
56-static inline nsecs_t nanoseconds_to_milliseconds(nsecs_t secs)
57+static inline std::chrono::nanoseconds nanoseconds_to_milliseconds(std::chrono::nanoseconds secs)
58 {
59 return secs/1000000;
60 }
61
62-static inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs)
63+static inline std::chrono::nanoseconds nanoseconds_to_microseconds(std::chrono::nanoseconds secs)
64 {
65 return secs/1000;
66 }
67
68-static inline nsecs_t s2ns(nsecs_t v) {return seconds_to_nanoseconds(v);}
69-static inline nsecs_t ms2ns(nsecs_t v) {return milliseconds_to_nanoseconds(v);}
70-static inline nsecs_t us2ns(nsecs_t v) {return microseconds_to_nanoseconds(v);}
71-static inline nsecs_t ns2s(nsecs_t v) {return nanoseconds_to_seconds(v);}
72-static inline nsecs_t ns2ms(nsecs_t v) {return nanoseconds_to_milliseconds(v);}
73-static inline nsecs_t ns2us(nsecs_t v) {return nanoseconds_to_microseconds(v);}
74+static inline std::chrono::nanoseconds s2ns(std::chrono::nanoseconds v) {return seconds_to_nanoseconds(v);}
75+static inline std::chrono::nanoseconds ms2ns(std::chrono::nanoseconds v) {return milliseconds_to_nanoseconds(v);}
76+static inline std::chrono::nanoseconds us2ns(std::chrono::nanoseconds v) {return microseconds_to_nanoseconds(v);}
77+static inline std::chrono::nanoseconds ns2s(std::chrono::nanoseconds v) {return nanoseconds_to_seconds(v);}
78+static inline std::chrono::nanoseconds ns2ms(std::chrono::nanoseconds v) {return nanoseconds_to_milliseconds(v);}
79+static inline std::chrono::nanoseconds ns2us(std::chrono::nanoseconds v) {return nanoseconds_to_microseconds(v);}
80
81-static inline nsecs_t seconds(nsecs_t v) { return s2ns(v); }
82-static inline nsecs_t milliseconds(nsecs_t v) { return ms2ns(v); }
83-static inline nsecs_t microseconds(nsecs_t v) { return us2ns(v); }
84+static inline std::chrono::nanoseconds seconds(std::chrono::nanoseconds v) { return s2ns(v); }
85+static inline std::chrono::nanoseconds milliseconds(std::chrono::nanoseconds v) { return ms2ns(v); }
86+static inline std::chrono::nanoseconds microseconds(std::chrono::nanoseconds v) { return us2ns(v); }
87
88 enum {
89 SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock
90@@ -83,9 +84,9 @@
91
92 // return the system-time according to the specified clock
93 #ifdef __cplusplus
94-nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC);
95+std::chrono::nanoseconds systemTime(int clock = SYSTEM_TIME_MONOTONIC);
96 #else
97-nsecs_t systemTime(int clock);
98+std::chrono::nanoseconds systemTime(int clock);
99 #endif // def __cplusplus
100
101 /**
102@@ -96,7 +97,7 @@
103 * Otherwise, returns the difference between the reference time and timeout time
104 * rounded up to the next millisecond.
105 */
106-int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime);
107+int toMillisecondTimeoutDelay(std::chrono::nanoseconds referenceTime, std::chrono::nanoseconds timeoutTime);
108
109 #ifdef __cplusplus
110 } // extern "C"
111
112=== modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h'
113--- 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2014-03-06 06:05:17 +0000
114+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2015-02-09 23:59:09 +0000
115@@ -29,6 +29,8 @@
116 #include <std/RefBase.h>
117 #include <std/String8.h>
118
119+#include <chrono>
120+
121 #ifdef HAVE_ANDROID_OS
122 class SkMatrix;
123 #endif
124@@ -274,9 +276,9 @@
125
126 inline int32_t getRepeatCount() const { return mRepeatCount; }
127
128- inline nsecs_t getDownTime() const { return mDownTime; }
129+ inline std::chrono::nanoseconds getDownTime() const { return mDownTime; }
130
131- inline nsecs_t getEventTime() const { return mEventTime; }
132+ inline std::chrono::nanoseconds getEventTime() const { return mEventTime; }
133
134 // Return true if this event may have a default action implementation.
135 static bool hasDefaultAction(int32_t keyCode);
136@@ -295,8 +297,8 @@
137 int32_t scanCode,
138 int32_t metaState,
139 int32_t repeatCount,
140- nsecs_t downTime,
141- nsecs_t eventTime);
142+ std::chrono::nanoseconds downTime,
143+ std::chrono::nanoseconds eventTime);
144 void initialize(const KeyEvent& from);
145
146 protected:
147@@ -306,8 +308,8 @@
148 int32_t mScanCode;
149 int32_t mMetaState;
150 int32_t mRepeatCount;
151- nsecs_t mDownTime;
152- nsecs_t mEventTime;
153+ std::chrono::nanoseconds mDownTime;
154+ std::chrono::nanoseconds mEventTime;
155 };
156
157 /*
158@@ -352,9 +354,9 @@
159
160 inline float getYPrecision() const { return mYPrecision; }
161
162- inline nsecs_t getDownTime() const { return mDownTime; }
163+ inline std::chrono::nanoseconds getDownTime() const { return mDownTime; }
164
165- inline void setDownTime(nsecs_t downTime) { mDownTime = downTime; }
166+ inline void setDownTime(std::chrono::nanoseconds downTime) { mDownTime = downTime; }
167
168 inline size_t getPointerCount() const { return mPointerProperties.size(); }
169
170@@ -370,7 +372,7 @@
171 return mPointerProperties[pointerIndex].toolType;
172 }
173
174- inline nsecs_t getEventTime() const { return mSampleEventTimes[getHistorySize()]; }
175+ inline std::chrono::nanoseconds getEventTime() const { return mSampleEventTimes[getHistorySize()]; }
176
177 const PointerCoords* getRawPointerCoords(size_t pointerIndex) const;
178
179@@ -424,7 +426,7 @@
180
181 inline size_t getHistorySize() const { return mSampleEventTimes.size() - 1; }
182
183- inline nsecs_t getHistoricalEventTime(size_t historicalIndex) const {
184+ inline std::chrono::nanoseconds getHistoricalEventTime(size_t historicalIndex) const {
185 return mSampleEventTimes[historicalIndex];
186 }
187
188@@ -505,8 +507,8 @@
189 float yOffset,
190 float xPrecision,
191 float yPrecision,
192- nsecs_t downTime,
193- nsecs_t eventTime,
194+ std::chrono::nanoseconds downTime,
195+ std::chrono::nanoseconds eventTime,
196 size_t pointerCount,
197 const PointerProperties* pointerProperties,
198 const PointerCoords* pointerCoords);
199@@ -514,7 +516,7 @@
200 void copyFrom(const MotionEvent* other, bool keepHistory);
201
202 void addSample(
203- nsecs_t eventTime,
204+ std::chrono::nanoseconds eventTime,
205 const PointerCoords* pointerCoords);
206
207 void offsetLocation(float xOffset, float yOffset);
208@@ -537,7 +539,7 @@
209 inline const PointerProperties* getPointerProperties() const {
210 return mPointerProperties.array();
211 }
212- inline const nsecs_t* getSampleEventTimes() const { return mSampleEventTimes.array(); }
213+ inline const std::chrono::nanoseconds* getSampleEventTimes() const { return mSampleEventTimes.array(); }
214 inline const PointerCoords* getSamplePointerCoords() const {
215 return mSamplePointerCoords.array();
216 }
217@@ -552,9 +554,9 @@
218 float mYOffset;
219 float mXPrecision;
220 float mYPrecision;
221- nsecs_t mDownTime;
222+ std::chrono::nanoseconds mDownTime;
223 Vector<PointerProperties> mPointerProperties;
224- Vector<nsecs_t> mSampleEventTimes;
225+ Vector<std::chrono::nanoseconds> mSampleEventTimes;
226 Vector<PointerCoords> mSamplePointerCoords;
227 };
228
229
230=== modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h'
231--- 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h 2014-03-06 06:05:17 +0000
232+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h 2015-02-09 23:59:09 +0000
233@@ -61,7 +61,7 @@
234 union Body {
235 struct Key {
236 uint32_t seq;
237- nsecs_t eventTime;
238+ int64_t eventTime;
239 int32_t deviceId;
240 int32_t source;
241 int32_t action;
242@@ -70,7 +70,7 @@
243 int32_t scanCode;
244 int32_t metaState;
245 int32_t repeatCount;
246- nsecs_t downTime;
247+ int64_t downTime;
248
249 inline size_t size() const {
250 return sizeof(Key);
251@@ -79,7 +79,7 @@
252
253 struct Motion {
254 uint32_t seq;
255- nsecs_t eventTime;
256+ int64_t eventTime;
257 int32_t deviceId;
258 int32_t source;
259 int32_t action;
260@@ -87,7 +87,7 @@
261 int32_t metaState;
262 int32_t buttonState;
263 int32_t edgeFlags;
264- nsecs_t downTime;
265+ int64_t downTime;
266 float xOffset;
267 float yOffset;
268 float xPrecision;
269@@ -210,8 +210,8 @@
270 int32_t scanCode,
271 int32_t metaState,
272 int32_t repeatCount,
273- nsecs_t downTime,
274- nsecs_t eventTime);
275+ std::chrono::nanoseconds downTime,
276+ std::chrono::nanoseconds eventTime);
277
278 /* Publishes a motion event to the input channel.
279 *
280@@ -234,8 +234,8 @@
281 float yOffset,
282 float xPrecision,
283 float yPrecision,
284- nsecs_t downTime,
285- nsecs_t eventTime,
286+ std::chrono::nanoseconds downTime,
287+ std::chrono::nanoseconds eventTime,
288 size_t pointerCount,
289 const PointerProperties* pointerProperties,
290 const PointerCoords* pointerCoords);
291@@ -295,7 +295,7 @@
292 * Other errors probably indicate that the channel is broken.
293 */
294 status_t consume(InputEventFactoryInterface* factory, bool consumeBatches,
295- nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent);
296+ std::chrono::nanoseconds frameTime, uint32_t* outSeq, InputEvent** outEvent);
297
298 /* Sends a finished signal to the publisher to inform it that the message
299 * with the specified sequence number has finished being process and whether
300@@ -354,13 +354,13 @@
301
302 // Touch state per device and source, only for sources of class pointer.
303 struct History {
304- nsecs_t eventTime;
305+ std::chrono::nanoseconds eventTime;
306 IntSet ids;
307 std::unordered_map<int32_t, size_t> idToIndex;
308 PointerCoords pointers[MAX_POINTERS];
309
310 void initializeFrom(const InputMessage* msg) {
311- eventTime = msg->body.motion.eventTime;
312+ eventTime = std::chrono::nanoseconds(msg->body.motion.eventTime);
313 ids.clear();
314 for (size_t i = 0; i < msg->body.motion.pointerCount; i++) {
315 uint32_t id = msg->body.motion.pointers[i].properties.id;
316@@ -387,7 +387,7 @@
317 this->source = source;
318 historyCurrent = 0;
319 historySize = 0;
320- lastResample.eventTime = 0;
321+ lastResample.eventTime = std::chrono::nanoseconds(0);
322 lastResample.ids.clear();
323 }
324
325@@ -416,13 +416,13 @@
326 Vector<SeqChain> mSeqChains;
327
328 status_t consumeBatch(InputEventFactoryInterface* factory,
329- nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent);
330+ std::chrono::nanoseconds frameTime, uint32_t* outSeq, InputEvent** outEvent);
331 status_t consumeSamples(InputEventFactoryInterface* factory,
332 Batch& batch, size_t count, uint32_t* outSeq, InputEvent** outEvent);
333
334 void updateTouchState(InputMessage* msg);
335 void rewriteMessage(const TouchState& state, InputMessage* msg);
336- void resampleTouchState(nsecs_t frameTime, MotionEvent* event,
337+ void resampleTouchState(std::chrono::nanoseconds frameTime, MotionEvent* event,
338 const InputMessage *next);
339
340 ssize_t findBatch(int32_t deviceId, int32_t source) const;
341@@ -434,7 +434,7 @@
342 static void initializeMotionEvent(MotionEvent* event, const InputMessage* msg);
343 static void addSample(MotionEvent* event, const InputMessage* msg);
344 static bool canAddSample(const Batch& batch, const InputMessage* msg);
345- static ssize_t findSampleNoLaterThan(const Batch& batch, nsecs_t time);
346+ static ssize_t findSampleNoLaterThan(const Batch& batch, std::chrono::nanoseconds time);
347 static bool shouldResampleTool(int32_t toolType);
348
349 static bool isTouchResamplingEnabled();
350
351=== modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h'
352--- 3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h 2013-05-03 16:38:07 +0000
353+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/KeyCharacterMap.h 2015-02-09 23:59:09 +0000
354@@ -230,22 +230,22 @@
355 static status_t load(Tokenizer* tokenizer, Format format, sp<KeyCharacterMap>* outMap);
356
357 static void addKey(Vector<KeyEvent>& outEvents,
358- int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, nsecs_t time);
359+ int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, std::chrono::nanoseconds time);
360 static void addMetaKeys(Vector<KeyEvent>& outEvents,
361- int32_t deviceId, int32_t metaState, bool down, nsecs_t time,
362+ int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
363 int32_t* currentMetaState);
364 static bool addSingleEphemeralMetaKey(Vector<KeyEvent>& outEvents,
365- int32_t deviceId, int32_t metaState, bool down, nsecs_t time,
366+ int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
367 int32_t keyCode, int32_t keyMetaState,
368 int32_t* currentMetaState);
369 static void addDoubleEphemeralMetaKey(Vector<KeyEvent>& outEvents,
370- int32_t deviceId, int32_t metaState, bool down, nsecs_t time,
371+ int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
372 int32_t leftKeyCode, int32_t leftKeyMetaState,
373 int32_t rightKeyCode, int32_t rightKeyMetaState,
374 int32_t eitherKeyMetaState,
375 int32_t* currentMetaState);
376 static void addLockedMetaKey(Vector<KeyEvent>& outEvents,
377- int32_t deviceId, int32_t metaState, nsecs_t time,
378+ int32_t deviceId, int32_t metaState, std::chrono::nanoseconds time,
379 int32_t keyCode, int32_t keyMetaState,
380 int32_t* currentMetaState);
381 };
382
383=== modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h'
384--- 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h 2014-03-06 06:05:17 +0000
385+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h 2015-02-09 23:59:09 +0000
386@@ -90,16 +90,16 @@
387
388 /* Translates a raw movement delta into an appropriately
389 * scaled / accelerated delta based on the current velocity. */
390- void move(nsecs_t eventTime, float* deltaX, float* deltaY);
391+ void move(std::chrono::nanoseconds eventTime, float* deltaX, float* deltaY);
392
393 private:
394 // If no movements are received within this amount of time,
395 // we assume the movement has stopped and reset the movement counters.
396- static const nsecs_t STOP_TIME = 500 * 1000000; // 500 ms
397+ static constexpr const std::chrono::nanoseconds STOP_TIME = std::chrono::nanoseconds(500 * 1000000); // 500 ms
398
399 VelocityControlParameters mParameters;
400
401- nsecs_t mLastMovementTime;
402+ std::chrono::nanoseconds mLastMovementTime;
403 VelocityTracker::Position mRawPosition;
404 VelocityTracker mVelocityTracker;
405 IntSet mIds;
406
407=== modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h'
408--- 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h 2014-03-06 06:05:17 +0000
409+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h 2015-02-09 23:59:09 +0000
410@@ -41,7 +41,7 @@
411 static const size_t MAX_DEGREE = 4;
412
413 // Estimator time base.
414- nsecs_t time;
415+ std::chrono::nanoseconds time;
416
417 // Polynomial coefficients describing motion in X and Y.
418 float xCoeff[MAX_DEGREE + 1], yCoeff[MAX_DEGREE + 1];
419@@ -54,7 +54,7 @@
420 float confidence;
421
422 inline void clear() {
423- time = 0;
424+ time = std::chrono::nanoseconds(0);
425 degree = 0;
426 confidence = 0;
427 for (size_t i = 0; i <= MAX_DEGREE; i++) {
428@@ -83,7 +83,7 @@
429 // are included in the movement.
430 // The positions array contains position information for each pointer in order by
431 // increasing id. Its size should be equal to the size of ids.
432- void addMovement(nsecs_t eventTime, const IntSet &ids, const Position* positions);
433+ void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids, const Position* positions);
434
435 // Adds movement information for all pointers in a MotionEvent, including historical samples.
436 void addMovement(const MotionEvent* event);
437@@ -107,7 +107,7 @@
438 private:
439 static const char* DEFAULT_STRATEGY;
440
441- nsecs_t mLastEventTime;
442+ std::chrono::nanoseconds mLastEventTime;
443 IntSet mCurrentPointerIds;
444 int32_t mActivePointerId;
445 VelocityTrackerStrategy* mStrategy;
446@@ -130,7 +130,7 @@
447
448 virtual void clear() = 0;
449 virtual void clearPointers(const IntSet &ids) = 0;
450- virtual void addMovement(nsecs_t eventTime, const IntSet &ids,
451+ virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
452 const VelocityTracker::Position* positions) = 0;
453 virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const = 0;
454 };
455@@ -162,7 +162,7 @@
456
457 virtual void clear();
458 virtual void clearPointers(const IntSet &ids);
459- virtual void addMovement(nsecs_t eventTime, const IntSet &ids,
460+ virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
461 const VelocityTracker::Position* positions);
462 virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
463
464@@ -170,13 +170,13 @@
465 // Sample horizon.
466 // We don't use too much history by default since we want to react to quick
467 // changes in direction.
468- static const nsecs_t HORIZON = 100 * 1000000; // 100 ms
469+ static constexpr const std::chrono::nanoseconds HORIZON = std::chrono::nanoseconds(100 * 1000000); // 100 ms
470
471 // Number of samples to keep.
472 static const uint32_t HISTORY_SIZE = 20;
473
474 struct Movement {
475- nsecs_t eventTime;
476+ std::chrono::nanoseconds eventTime;
477 IntSet ids;
478 VelocityTracker::Position positions[MAX_POINTERS];
479
480@@ -205,14 +205,14 @@
481
482 virtual void clear();
483 virtual void clearPointers(const IntSet &ids);
484- virtual void addMovement(nsecs_t eventTime, const IntSet &ids,
485+ virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
486 const VelocityTracker::Position* positions);
487 virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
488
489 private:
490 // Current state estimate for a particular pointer.
491 struct State {
492- nsecs_t updateTime;
493+ std::chrono::nanoseconds updateTime;
494 uint32_t degree;
495
496 float xpos, xvel, xaccel;
497@@ -223,8 +223,8 @@
498 IntSet mPointerIds;
499 std::unordered_map<int32_t, State> mPointerState; // maps the id of a pointer to its state
500
501- void initState(State& state, nsecs_t eventTime, float xpos, float ypos) const;
502- void updateState(State& state, nsecs_t eventTime, float xpos, float ypos) const;
503+ void initState(State& state, std::chrono::nanoseconds eventTime, float xpos, float ypos) const;
504+ void updateState(State& state, std::chrono::nanoseconds eventTime, float xpos, float ypos) const;
505 void populateEstimator(const State& state, VelocityTracker::Estimator* outEstimator) const;
506 };
507
508@@ -239,22 +239,22 @@
509
510 virtual void clear();
511 virtual void clearPointers(const IntSet &ids);
512- virtual void addMovement(nsecs_t eventTime, const IntSet &ids,
513+ virtual void addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
514 const VelocityTracker::Position* positions);
515 virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
516
517 private:
518 // Oldest sample to consider when calculating the velocity.
519- static const nsecs_t HORIZON = 200 * 1000000; // 100 ms
520+ static constexpr const std::chrono::nanoseconds HORIZON = std::chrono::nanoseconds(200 * 1000000); // 100 ms
521
522 // Number of samples to keep.
523 static const uint32_t HISTORY_SIZE = 20;
524
525 // The minimum duration between samples when estimating velocity.
526- static const nsecs_t MIN_DURATION = 10 * 1000000; // 10 ms
527+ static constexpr const std::chrono::nanoseconds MIN_DURATION = std::chrono::nanoseconds(10 * 1000000); // 10 ms
528
529 struct Movement {
530- nsecs_t eventTime;
531+ std::chrono::nanoseconds eventTime;
532 IntSet ids;
533 VelocityTracker::Position positions[MAX_POINTERS];
534
535
536=== modified file '3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp'
537--- 3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp 2014-11-24 03:09:00 +0000
538+++ 3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp 2015-02-09 23:59:09 +0000
539@@ -580,7 +580,7 @@
540 return false;
541 }
542
543-void EventHub::vibrate(int32_t deviceId, nsecs_t duration) {
544+void EventHub::vibrate(int32_t deviceId, std::chrono::nanoseconds duration) {
545 AutoMutex _l(mLock);
546 Device* device = getDeviceLocked(deviceId);
547 if (device && !device->isVirtual()) {
548@@ -590,7 +590,7 @@
549 effect.id = device->ffEffectId;
550 effect.u.rumble.strong_magnitude = 0xc000;
551 effect.u.rumble.weak_magnitude = 0xc000;
552- effect.replay.length = (duration + 999999LL) / 1000000LL;
553+ effect.replay.length = (duration + std::chrono::nanoseconds(999999)) / std::chrono::nanoseconds(1000000LL);
554 effect.replay.delay = 0;
555 if (ioctl(device->fd, EVIOCSFF, &effect)) {
556 ALOGW("Could not upload force feedback effect to device %s due to error %d.",
557@@ -665,7 +665,7 @@
558 size_t capacity = bufferSize;
559 bool awoken = false;
560 for (;;) {
561- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
562+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
563
564 // Reopen input devices if needed.
565 if (mNeedToReopenDevices) {
566@@ -802,8 +802,8 @@
567 // The systemTime(SYSTEM_TIME_MONOTONIC) function we use everywhere
568 // calls clock_gettime(CLOCK_MONOTONIC) which is implemented as a
569 // system call that also queries ktime_get_ts().
570- event->when = nsecs_t(iev.time.tv_sec) * 1000000000LL
571- + nsecs_t(iev.time.tv_usec) * 1000LL;
572+ event->when = std::chrono::nanoseconds(iev.time.tv_sec) * 1000000000LL
573+ + std::chrono::nanoseconds(iev.time.tv_usec) * 1000LL;
574 ALOGV("event time %lld, now %lld", event->when, now);
575 #else
576 event->when = now;
577@@ -813,7 +813,7 @@
578 event->code = iev.code;
579 event->value = iev.value;
580
581- input_report->received_event_from_kernel(event->when, event->type, event->code, event->value);
582+ input_report->received_event_from_kernel(event->when.count(), event->type, event->code, event->value);
583
584 event += 1;
585 }
586
587=== modified file '3rd_party/android-input/android/frameworks/base/services/input/EventHub.h'
588--- 3rd_party/android-input/android/frameworks/base/services/input/EventHub.h 2014-12-08 04:03:47 +0000
589+++ 3rd_party/android-input/android/frameworks/base/services/input/EventHub.h 2015-02-09 23:59:09 +0000
590@@ -64,7 +64,7 @@
591 * A raw event as retrieved from the EventHub.
592 */
593 struct RawEvent {
594- nsecs_t when;
595+ std::chrono::nanoseconds when;
596 int32_t deviceId;
597 int32_t type;
598 int32_t code;
599@@ -233,7 +233,7 @@
600 virtual bool setKeyboardLayoutOverlay(int32_t deviceId, const sp<KeyCharacterMap>& map) = 0;
601
602 /* Control the vibrator. */
603- virtual void vibrate(int32_t deviceId, nsecs_t duration) = 0;
604+ virtual void vibrate(int32_t deviceId, std::chrono::nanoseconds duration) = 0;
605 virtual void cancelVibrate(int32_t deviceId) = 0;
606
607 /* Requests the EventHub to reopen all input devices on the next call to getEvents(). */
608@@ -298,7 +298,7 @@
609 virtual sp<KeyCharacterMap> getKeyCharacterMap(int32_t deviceId) const;
610 virtual bool setKeyboardLayoutOverlay(int32_t deviceId, const sp<KeyCharacterMap>& map);
611
612- virtual void vibrate(int32_t deviceId, nsecs_t duration);
613+ virtual void vibrate(int32_t deviceId, std::chrono::nanoseconds duration);
614 virtual void cancelVibrate(int32_t deviceId);
615
616 virtual void requestReopenDevices();
617
618=== modified file '3rd_party/android-input/android/frameworks/base/services/input/Input.cpp'
619--- 3rd_party/android-input/android/frameworks/base/services/input/Input.cpp 2013-05-03 16:38:07 +0000
620+++ 3rd_party/android-input/android/frameworks/base/services/input/Input.cpp 2015-02-09 23:59:09 +0000
621@@ -130,8 +130,8 @@
622 int32_t scanCode,
623 int32_t metaState,
624 int32_t repeatCount,
625- nsecs_t downTime,
626- nsecs_t eventTime) {
627+ std::chrono::nanoseconds downTime,
628+ std::chrono::nanoseconds eventTime) {
629 InputEvent::initialize(deviceId, source);
630 mAction = action;
631 mFlags = flags;
632@@ -294,8 +294,8 @@
633 float yOffset,
634 float xPrecision,
635 float yPrecision,
636- nsecs_t downTime,
637- nsecs_t eventTime,
638+ std::chrono::nanoseconds downTime,
639+ std::chrono::nanoseconds eventTime,
640 size_t pointerCount,
641 const PointerProperties* pointerProperties,
642 const PointerCoords* pointerCoords) {
643@@ -346,7 +346,7 @@
644 }
645
646 void MotionEvent::addSample(
647- int64_t eventTime,
648+ std::chrono::nanoseconds eventTime,
649 const PointerCoords* pointerCoords) {
650 mSampleEventTimes.push(eventTime);
651 mSamplePointerCoords.appendArray(pointerCoords, getPointerCount());
652
653=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputApplication.h'
654--- 3rd_party/android-input/android/frameworks/base/services/input/InputApplication.h 2013-05-03 16:38:07 +0000
655+++ 3rd_party/android-input/android/frameworks/base/services/input/InputApplication.h 2015-02-09 23:59:09 +0000
656@@ -30,7 +30,7 @@
657 */
658 struct InputApplicationInfo {
659 String8 name;
660- nsecs_t dispatchingTimeout;
661+ std::chrono::nanoseconds dispatchingTimeout;
662 };
663
664
665@@ -50,7 +50,7 @@
666 return mInfo ? mInfo->name : String8("<invalid>");
667 }
668
669- inline nsecs_t getDispatchingTimeout(nsecs_t defaultValue) const {
670+ inline std::chrono::nanoseconds getDispatchingTimeout(std::chrono::nanoseconds defaultValue) const {
671 return mInfo ? mInfo->dispatchingTimeout : defaultValue;
672 }
673
674
675=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp'
676--- 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2014-12-08 04:03:47 +0000
677+++ 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2015-02-09 23:59:09 +0000
678@@ -88,7 +88,7 @@
679 const nsecs_t SLOW_EVENT_PROCESSING_WARNING_TIMEOUT = 2000 * 1000000LL; // 2sec
680
681
682-static inline nsecs_t now() {
683+static inline std::chrono::nanoseconds now() {
684 return systemTime(SYSTEM_TIME_MONOTONIC);
685 }
686
687@@ -203,7 +203,7 @@
688 }
689
690 void InputDispatcher::dispatchOnce() {
691- nsecs_t nextWakeupTime = LONG_LONG_MAX;
692+ std::chrono::nanoseconds nextWakeupTime(LONG_LONG_MAX);
693 { // acquire lock
694 AutoMutex _l(mLock);
695 broadcast(mDispatcherIsAliveCondition);
696@@ -211,18 +211,18 @@
697 dispatchOnceInnerLocked(&nextWakeupTime);
698
699 if (runCommandsLockedInterruptible()) {
700- nextWakeupTime = LONG_LONG_MIN; // force next poll to wake up immediately
701+ nextWakeupTime = std::chrono::nanoseconds(0);
702 }
703 } // release lock
704
705 // Wait for callback or timeout or wake. (make sure we round up, not down)
706- nsecs_t currentTime = now();
707+ std::chrono::nanoseconds currentTime = now();
708 int timeoutMillis = toMillisecondTimeoutDelay(currentTime, nextWakeupTime);
709 mLooper->pollOnce(timeoutMillis);
710 }
711
712-void InputDispatcher::dispatchOnceInnerLocked(nsecs_t* nextWakeupTime) {
713- nsecs_t currentTime = now();
714+void InputDispatcher::dispatchOnceInnerLocked(std::chrono::nanoseconds* nextWakeupTime) {
715+ std::chrono::nanoseconds currentTime = now();
716
717 // Reset the key repeat timer whenever we disallow key events, even if the next event
718 // is not a key. This is to ensure that we abort a key repeat if the device is just coming
719@@ -363,7 +363,7 @@
720 }
721
722 releasePendingEventLocked();
723- *nextWakeupTime = LONG_LONG_MIN; // force next poll to wake up immediately
724+ *nextWakeupTime = std::chrono::nanoseconds(LONG_LONG_MIN); // force next poll to wake up immediately
725 }
726 }
727
728@@ -385,7 +385,7 @@
729 #if DEBUG_APP_SWITCH
730 ALOGD("App switch is pending!");
731 #endif
732- mAppSwitchDueTime = keyEntry->eventTime + APP_SWITCH_TIMEOUT;
733+ mAppSwitchDueTime = keyEntry->eventTime + std::chrono::nanoseconds(APP_SWITCH_TIMEOUT);
734 mAppSwitchSawKeyDown = false;
735 needWake = true;
736 }
737@@ -515,11 +515,11 @@
738 }
739
740 bool InputDispatcher::isAppSwitchPendingLocked() {
741- return mAppSwitchDueTime != LONG_LONG_MAX;
742+ return mAppSwitchDueTime != std::chrono::nanoseconds(LONG_LONG_MAX);
743 }
744
745 void InputDispatcher::resetPendingAppSwitchLocked(bool handled) {
746- mAppSwitchDueTime = LONG_LONG_MAX;
747+ mAppSwitchDueTime = std::chrono::nanoseconds(LONG_LONG_MAX);
748
749 #if DEBUG_APP_SWITCH
750 if (handled) {
751@@ -530,8 +530,8 @@
752 #endif
753 }
754
755-bool InputDispatcher::isStaleEventLocked(nsecs_t currentTime, EventEntry* entry) {
756- return currentTime - entry->eventTime >= STALE_EVENT_TIMEOUT;
757+bool InputDispatcher::isStaleEventLocked(std::chrono::nanoseconds currentTime, EventEntry* entry) {
758+ return currentTime - entry->eventTime >= std::chrono::nanoseconds(STALE_EVENT_TIMEOUT);
759 }
760
761 bool InputDispatcher::runCommandsLockedInterruptible() {
762@@ -593,7 +593,7 @@
763 }
764 }
765
766-InputDispatcher::KeyEntry* InputDispatcher::synthesizeKeyRepeatLocked(nsecs_t currentTime) {
767+InputDispatcher::KeyEntry* InputDispatcher::synthesizeKeyRepeatLocked(std::chrono::nanoseconds currentTime) {
768 KeyEntry* entry = mKeyRepeatState.lastKeyEntry;
769
770 // Reuse the repeated key entry if it is otherwise unreferenced.
771@@ -626,7 +626,7 @@
772 }
773
774 bool InputDispatcher::dispatchConfigurationChangedLocked(
775- nsecs_t currentTime, ConfigurationChangedEntry* entry) {
776+ std::chrono::nanoseconds currentTime, ConfigurationChangedEntry* entry) {
777 #if DEBUG_OUTBOUND_EVENT_DETAILS
778 ALOGD("dispatchConfigurationChanged - eventTime=%lld", entry->eventTime);
779 #endif
780@@ -642,7 +642,7 @@
781 }
782
783 bool InputDispatcher::dispatchDeviceResetLocked(
784- nsecs_t currentTime, DeviceResetEntry* entry) {
785+ std::chrono::nanoseconds currentTime, DeviceResetEntry* entry) {
786 #if DEBUG_OUTBOUND_EVENT_DETAILS
787 ALOGD("dispatchDeviceReset - eventTime=%lld, deviceId=%d", entry->eventTime, entry->deviceId);
788 #endif
789@@ -654,8 +654,8 @@
790 return true;
791 }
792
793-bool InputDispatcher::dispatchKeyLocked(nsecs_t currentTime, KeyEntry* entry,
794- DropReason* dropReason, nsecs_t* nextWakeupTime) {
795+bool InputDispatcher::dispatchKeyLocked(std::chrono::nanoseconds currentTime, KeyEntry* entry,
796+ DropReason* dropReason, std::chrono::nanoseconds* nextWakeupTime) {
797 // Preprocessing.
798 if (! entry->dispatchInProgress) {
799 if (entry->repeatCount == 0
800@@ -670,7 +670,7 @@
801 // we will not need to synthesize key repeats ourselves.
802 entry->repeatCount = mKeyRepeatState.lastKeyEntry->repeatCount + 1;
803 resetKeyRepeatLocked();
804- mKeyRepeatState.nextRepeatTime = LONG_LONG_MAX; // don't generate repeats ourselves
805+ mKeyRepeatState.nextRepeatTime = std::chrono::nanoseconds(LONG_LONG_MAX); // don't generate repeats ourselves
806 } else {
807 // Not a repeat. Save key down state in case we do see a repeat later.
808 resetKeyRepeatLocked();
809@@ -702,7 +702,7 @@
810 return false; // wait until next wakeup
811 }
812 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_UNKNOWN;
813- entry->interceptKeyWakeupTime = 0;
814+ entry->interceptKeyWakeupTime = std::chrono::nanoseconds(0);
815 }
816
817 // Give the policy a chance to intercept the key.
818@@ -765,7 +765,7 @@
819 }
820
821 bool InputDispatcher::dispatchMotionLocked(
822- nsecs_t currentTime, MotionEntry* entry, DropReason* dropReason, nsecs_t* nextWakeupTime) {
823+ std::chrono::nanoseconds currentTime, MotionEntry* entry, DropReason* dropReason, std::chrono::nanoseconds* nextWakeupTime) {
824 // Preprocessing.
825 if (! entry->dispatchInProgress) {
826 entry->dispatchInProgress = true;
827@@ -851,7 +851,7 @@
828 #endif
829 }
830
831-void InputDispatcher::dispatchEventLocked(nsecs_t currentTime,
832+void InputDispatcher::dispatchEventLocked(std::chrono::nanoseconds currentTime,
833 EventEntry* eventEntry, const Vector<InputTarget>& inputTargets) {
834 #if DEBUG_DISPATCH_CYCLE
835 ALOGD("dispatchEventToCurrentInputTargets");
836@@ -876,11 +876,11 @@
837 }
838 }
839
840-int32_t InputDispatcher::handleTargetsNotReadyLocked(nsecs_t currentTime,
841+int32_t InputDispatcher::handleTargetsNotReadyLocked(std::chrono::nanoseconds currentTime,
842 const EventEntry* entry,
843 const sp<InputApplicationHandle>& applicationHandle,
844 const sp<InputWindowHandle>& windowHandle,
845- nsecs_t* nextWakeupTime, const char* reason) {
846+ std::chrono::nanoseconds* nextWakeupTime, const char* reason) {
847 if (applicationHandle == NULL && windowHandle == NULL) {
848 if (mInputTargetWaitCause != INPUT_TARGET_WAIT_CAUSE_SYSTEM_NOT_READY) {
849 #if DEBUG_FOCUS
850@@ -888,7 +888,7 @@
851 #endif
852 mInputTargetWaitCause = INPUT_TARGET_WAIT_CAUSE_SYSTEM_NOT_READY;
853 mInputTargetWaitStartTime = currentTime;
854- mInputTargetWaitTimeoutTime = LONG_LONG_MAX;
855+ mInputTargetWaitTimeoutTime = std::chrono::nanoseconds(LONG_LONG_MAX);
856 mInputTargetWaitTimeoutExpired = false;
857 mInputTargetWaitApplicationHandle.clear();
858 }
859@@ -899,14 +899,14 @@
860 c_str(getApplicationWindowLabelLocked(applicationHandle, windowHandle)),
861 reason);
862 #endif
863- nsecs_t timeout;
864+ std::chrono::nanoseconds timeout;
865 if (windowHandle != NULL) {
866- timeout = windowHandle->getDispatchingTimeout(DEFAULT_INPUT_DISPATCHING_TIMEOUT);
867+ timeout = windowHandle->getDispatchingTimeout(std::chrono::nanoseconds(DEFAULT_INPUT_DISPATCHING_TIMEOUT));
868 } else if (applicationHandle != NULL) {
869 timeout = applicationHandle->getDispatchingTimeout(
870- DEFAULT_INPUT_DISPATCHING_TIMEOUT);
871+ std::chrono::nanoseconds(DEFAULT_INPUT_DISPATCHING_TIMEOUT));
872 } else {
873- timeout = DEFAULT_INPUT_DISPATCHING_TIMEOUT;
874+ timeout = std::chrono::nanoseconds(DEFAULT_INPUT_DISPATCHING_TIMEOUT);
875 }
876
877 mInputTargetWaitCause = INPUT_TARGET_WAIT_CAUSE_APPLICATION_NOT_READY;
878@@ -934,7 +934,7 @@
879
880 // Force poll loop to wake up immediately on next iteration once we get the
881 // ANR response back from the policy.
882- *nextWakeupTime = LONG_LONG_MIN;
883+ *nextWakeupTime = std::chrono::nanoseconds(LONG_LONG_MIN);
884 return INPUT_EVENT_INJECTION_PENDING;
885 } else {
886 // Force poll loop to wake up when timeout is due.
887@@ -945,9 +945,9 @@
888 }
889 }
890
891-void InputDispatcher::resumeAfterTargetsNotReadyTimeoutLocked(nsecs_t newTimeout,
892+void InputDispatcher::resumeAfterTargetsNotReadyTimeoutLocked(std::chrono::nanoseconds newTimeout,
893 const sp<InputChannel>& inputChannel) {
894- if (newTimeout > 0) {
895+ if (newTimeout > std::chrono::nanoseconds(0)) {
896 // Extend the timeout.
897 mInputTargetWaitTimeoutTime = now() + newTimeout;
898 } else {
899@@ -975,12 +975,12 @@
900 }
901 }
902
903-nsecs_t InputDispatcher::getTimeSpentWaitingForApplicationLocked(
904- nsecs_t currentTime) {
905+std::chrono::nanoseconds InputDispatcher::getTimeSpentWaitingForApplicationLocked(
906+ std::chrono::nanoseconds currentTime) {
907 if (mInputTargetWaitCause == INPUT_TARGET_WAIT_CAUSE_APPLICATION_NOT_READY) {
908 return currentTime - mInputTargetWaitStartTime;
909 }
910- return 0;
911+ return std::chrono::nanoseconds(0);
912 }
913
914 void InputDispatcher::resetANRTimeoutsLocked() {
915@@ -993,8 +993,8 @@
916 mInputTargetWaitApplicationHandle.clear();
917 }
918
919-int32_t InputDispatcher::findFocusedWindowTargetsLocked(nsecs_t currentTime,
920- const EventEntry* entry, Vector<InputTarget>& inputTargets, nsecs_t* nextWakeupTime) {
921+int32_t InputDispatcher::findFocusedWindowTargetsLocked(std::chrono::nanoseconds currentTime,
922+ const EventEntry* entry, Vector<InputTarget>& inputTargets, std::chrono::nanoseconds* nextWakeupTime) {
923 int32_t injectionResult;
924
925 // If there is no currently focused window and no focused application
926@@ -1046,7 +1046,7 @@
927 // Done.
928 Failed:
929 Unresponsive:
930- nsecs_t timeSpentWaitingForApplication = getTimeSpentWaitingForApplicationLocked(currentTime);
931+ std::chrono::nanoseconds timeSpentWaitingForApplication = getTimeSpentWaitingForApplicationLocked(currentTime);
932 updateDispatchStatisticsLocked(currentTime, entry,
933 injectionResult, timeSpentWaitingForApplication);
934 #if DEBUG_FOCUS
935@@ -1057,8 +1057,8 @@
936 return injectionResult;
937 }
938
939-int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime,
940- const MotionEntry* entry, Vector<InputTarget>& inputTargets, nsecs_t* nextWakeupTime,
941+int32_t InputDispatcher::findTouchedWindowTargetsLocked(std::chrono::nanoseconds currentTime,
942+ const MotionEntry* entry, Vector<InputTarget>& inputTargets, std::chrono::nanoseconds* nextWakeupTime,
943 bool* outConflictingPointerActions) {
944 enum InjectionPermission {
945 INJECTION_PERMISSION_UNKNOWN,
946@@ -1066,7 +1066,7 @@
947 INJECTION_PERMISSION_DENIED
948 };
949
950- nsecs_t startTime = now();
951+ std::chrono::nanoseconds startTime = now();
952
953 // For security reasons, we defer updating the touch state until we are sure that
954 // event injection will be allowed.
955@@ -1524,7 +1524,7 @@
956 // Reset temporary touch state to ensure we release unnecessary references to input channels.
957 mTempTouchState.reset();
958
959- nsecs_t timeSpentWaitingForApplication = getTimeSpentWaitingForApplicationLocked(currentTime);
960+ std::chrono::nanoseconds timeSpentWaitingForApplication = getTimeSpentWaitingForApplicationLocked(currentTime);
961 updateDispatchStatisticsLocked(currentTime, entry,
962 injectionResult, timeSpentWaitingForApplication);
963 #if DEBUG_FOCUS
964@@ -1622,7 +1622,7 @@
965 return obscured;
966 }
967
968-bool InputDispatcher::isWindowReadyForMoreInputLocked(nsecs_t currentTime,
969+bool InputDispatcher::isWindowReadyForMoreInputLocked(std::chrono::nanoseconds currentTime,
970 const sp<InputWindowHandle>& windowHandle, const EventEntry* eventEntry) {
971 ssize_t connectionIndex = getConnectionIndexLocked(windowHandle->getInputChannel());
972 if (connectionIndex >= 0) {
973@@ -1662,7 +1662,7 @@
974 // This condition ensures that ANRs are detected reliably.
975 if (!connection->waitQueue.isEmpty()
976 && currentTime >= connection->waitQueue.head->eventEntry->eventTime
977- + STREAM_AHEAD_EVENT_TIMEOUT) {
978+ + std::chrono::nanoseconds(STREAM_AHEAD_EVENT_TIMEOUT)) {
979 return false;
980 }
981 }
982@@ -1688,7 +1688,7 @@
983 }
984 }
985
986-void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime,
987+void InputDispatcher::prepareDispatchCycleLocked(std::chrono::nanoseconds currentTime,
988 const sp<Connection>& connection, EventEntry* eventEntry, const InputTarget* inputTarget) {
989 #if DEBUG_DISPATCH_CYCLE
990 std::string pointerIdsString = inputTarget->pointerIds.toString();
991@@ -1737,7 +1737,7 @@
992 enqueueDispatchEntriesLocked(currentTime, connection, eventEntry, inputTarget);
993 }
994
995-void InputDispatcher::enqueueDispatchEntriesLocked(nsecs_t currentTime,
996+void InputDispatcher::enqueueDispatchEntriesLocked(std::chrono::nanoseconds currentTime,
997 const sp<Connection>& connection, EventEntry* eventEntry, const InputTarget* inputTarget) {
998 bool wasEmpty = connection->outboundQueue.isEmpty();
999
1000@@ -1847,7 +1847,7 @@
1001 connection->outboundQueue.enqueueAtTail(dispatchEntry);
1002 }
1003
1004-void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime,
1005+void InputDispatcher::startDispatchCycleLocked(std::chrono::nanoseconds currentTime,
1006 const sp<Connection>& connection) {
1007 #if DEBUG_DISPATCH_CYCLE
1008 ALOGD("channel '%s' ~ startDispatchCycle",
1009@@ -1875,7 +1875,7 @@
1010 keyEntry->eventTime);
1011 input_report->published_key_event(connection->inputChannel->getFd(),
1012 dispatchEntry->seq,
1013- keyEntry->eventTime);
1014+ keyEntry->eventTime.count());
1015 break;
1016 }
1017
1018@@ -1925,7 +1925,7 @@
1019 usingCoords);
1020 input_report->published_motion_event(connection->inputChannel->getFd(),
1021 dispatchEntry->seq,
1022- motionEntry->eventTime);
1023+ motionEntry->eventTime.count());
1024 break;
1025 }
1026
1027@@ -1967,7 +1967,7 @@
1028 }
1029 }
1030
1031-void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime,
1032+void InputDispatcher::finishDispatchCycleLocked(std::chrono::nanoseconds currentTime,
1033 const sp<Connection>& connection, uint32_t seq, bool handled) {
1034 #if DEBUG_DISPATCH_CYCLE
1035 ALOGD("channel '%s' ~ finishDispatchCycle - seq=%u, handled=%s",
1036@@ -1985,7 +1985,7 @@
1037 onDispatchCycleFinishedLocked(currentTime, connection, seq, handled);
1038 }
1039
1040-void InputDispatcher::abortBrokenDispatchCycleLocked(nsecs_t currentTime,
1041+void InputDispatcher::abortBrokenDispatchCycleLocked(std::chrono::nanoseconds currentTime,
1042 const sp<Connection>& connection, bool notify) {
1043 #if DEBUG_DISPATCH_CYCLE
1044 ALOGD("channel '%s' ~ abortBrokenDispatchCycle - notify=%s",
1045@@ -2044,7 +2044,7 @@
1046 return 1;
1047 }
1048
1049- nsecs_t currentTime = now();
1050+ std::chrono::nanoseconds currentTime = now();
1051 bool gotOne = false;
1052 status_t status;
1053 for (;;) {
1054@@ -2110,7 +2110,7 @@
1055 return;
1056 }
1057
1058- nsecs_t currentTime = now();
1059+ std::chrono::nanoseconds currentTime = now();
1060
1061 Vector<EventEntry*> cancelationEvents;
1062 connection->inputState.synthesizeCancelationEvents(currentTime,
1063@@ -2459,7 +2459,8 @@
1064 event->getType(), injectorPid, injectorUid, syncMode, timeoutMillis, policyFlags);
1065 #endif
1066
1067- nsecs_t endTime = now() + milliseconds_to_nanoseconds(timeoutMillis);
1068+ std::chrono::nanoseconds endTime =
1069+ now() + std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::milliseconds(timeoutMillis));
1070
1071 policyFlags |= POLICY_FLAG_INJECTED;
1072 if (hasInjectionPermission(injectorPid, injectorUid)) {
1073@@ -2509,12 +2510,12 @@
1074 }
1075
1076 if (!(policyFlags & POLICY_FLAG_FILTERED)) {
1077- nsecs_t eventTime = motionEvent->getEventTime();
1078+ std::chrono::nanoseconds eventTime = motionEvent->getEventTime();
1079 mPolicy->interceptMotionBeforeQueueing(eventTime, /*byref*/ policyFlags);
1080 }
1081
1082 mLock.lock();
1083- const nsecs_t* sampleEventTimes = motionEvent->getSampleEventTimes();
1084+ const std::chrono::nanoseconds* sampleEventTimes = motionEvent->getSampleEventTimes();
1085 const PointerCoords* samplePointerCoords = motionEvent->getSamplePointerCoords();
1086 firstInjectedEntry = new MotionEntry(*sampleEventTimes,
1087 motionEvent->getDeviceId(), motionEvent->getSource(), policyFlags,
1088@@ -2581,8 +2582,8 @@
1089 break;
1090 }
1091
1092- nsecs_t remainingTimeout = endTime - now();
1093- if (remainingTimeout <= 0) {
1094+ std::chrono::nanoseconds remainingTimeout = endTime - now();
1095+ if (remainingTimeout <= std::chrono::nanoseconds(0)) {
1096 #if DEBUG_INJECTION
1097 ALOGD("injectInputEvent - Timed out waiting for injection result "
1098 "to become available.");
1099@@ -2601,8 +2602,8 @@
1100 ALOGD("injectInputEvent - Waiting for %d pending foreground dispatches.",
1101 injectionState->pendingForegroundDispatches);
1102 #endif
1103- nsecs_t remainingTimeout = endTime - now();
1104- if (remainingTimeout <= 0) {
1105+ std::chrono::nanoseconds remainingTimeout = endTime - now();
1106+ if (remainingTimeout <= std::chrono::nanoseconds(0)) {
1107 #if DEBUG_INJECTION
1108 ALOGD("injectInputEvent - Timed out waiting for pending foreground "
1109 "dispatches to finish.");
1110@@ -2990,7 +2991,7 @@
1111 appendFormat(dump, INDENT "FocusedApplication: name='%s', dispatchingTimeout=%0.3fms\n",
1112 c_str(mFocusedApplicationHandle->getName()),
1113 mFocusedApplicationHandle->getDispatchingTimeout(
1114- DEFAULT_INPUT_DISPATCHING_TIMEOUT) / 1000000.0);
1115+ std::chrono::nanoseconds(DEFAULT_INPUT_DISPATCHING_TIMEOUT)) / 1000000.0);
1116 } else {
1117 dump.append(INDENT "FocusedApplication: <null>\n");
1118 }
1119@@ -3056,7 +3057,7 @@
1120 dump.append(INDENT "MonitoringChannels: <none>\n");
1121 }
1122
1123- nsecs_t currentTime = now();
1124+ std::chrono::nanoseconds currentTime = now();
1125
1126 if (!mInboundQueue.isEmpty()) {
1127 appendFormat(dump, INDENT "InboundQueue: length=%u\n", mInboundQueue.count());
1128@@ -3200,7 +3201,7 @@
1129
1130 mLooper->removeFd(inputChannel->getFd());
1131
1132- nsecs_t currentTime = now();
1133+ std::chrono::nanoseconds currentTime = now();
1134 abortBrokenDispatchCycleLocked(currentTime, connection, notify);
1135
1136 runCommandsLockedInterruptible();
1137@@ -3231,7 +3232,7 @@
1138 }
1139
1140 void InputDispatcher::onDispatchCycleFinishedLocked(
1141- nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled) {
1142+ std::chrono::nanoseconds currentTime, const sp<Connection>& connection, uint32_t seq, bool handled) {
1143 CommandEntry* commandEntry = postCommandLocked(
1144 & InputDispatcher::doDispatchCycleFinishedLockedInterruptible);
1145 commandEntry->connection = connection;
1146@@ -3241,7 +3242,7 @@
1147 }
1148
1149 void InputDispatcher::onDispatchCycleBrokenLocked(
1150- nsecs_t currentTime, const sp<Connection>& connection) {
1151+ std::chrono::nanoseconds currentTime, const sp<Connection>& connection) {
1152 ALOGE("channel '%s' ~ Channel is unrecoverably broken and will be disposed!",
1153 connection->getInputChannelName());
1154
1155@@ -3251,11 +3252,11 @@
1156 }
1157
1158 void InputDispatcher::onANRLocked(
1159- nsecs_t currentTime, const sp<InputApplicationHandle>& applicationHandle,
1160+ std::chrono::nanoseconds currentTime, const sp<InputApplicationHandle>& applicationHandle,
1161 const sp<InputWindowHandle>& windowHandle,
1162- nsecs_t eventTime, nsecs_t waitStartTime, const char* reason) {
1163- float dispatchLatency = (currentTime - eventTime) * 0.000001f;
1164- float waitDuration = (currentTime - waitStartTime) * 0.000001f;
1165+ std::chrono::nanoseconds eventTime, std::chrono::nanoseconds waitStartTime, const char* reason) {
1166+ float dispatchLatency = (currentTime - eventTime).count() * 0.000001f;
1167+ float waitDuration = (currentTime - waitStartTime).count() * 0.000001f;
1168 ALOGI("Application is not responding: %s. "
1169 "It has been %0.1fms since event, %0.1fms since wait started. Reason: %s",
1170 c_str(getApplicationWindowLabelLocked(applicationHandle, windowHandle)),
1171@@ -3309,7 +3310,7 @@
1172 CommandEntry* commandEntry) {
1173 mLock.unlock();
1174
1175- nsecs_t newTimeout = mPolicy->notifyANR(
1176+ std::chrono::nanoseconds newTimeout = mPolicy->notifyANR(
1177 commandEntry->inputApplicationHandle, commandEntry->inputWindowHandle);
1178
1179 mLock.lock();
1180@@ -3328,14 +3329,14 @@
1181
1182 mLock.unlock();
1183
1184- nsecs_t delay = mPolicy->interceptKeyBeforeDispatching(commandEntry->inputWindowHandle,
1185+ std::chrono::nanoseconds delay = mPolicy->interceptKeyBeforeDispatching(commandEntry->inputWindowHandle,
1186 &event, entry->policyFlags);
1187
1188 mLock.lock();
1189
1190- if (delay < 0) {
1191+ if (delay < std::chrono::nanoseconds(0)) {
1192 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_SKIP;
1193- } else if (!delay) {
1194+ } else if (!delay.count()) {
1195 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_CONTINUE;
1196 } else {
1197 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_TRY_AGAIN_LATER;
1198@@ -3347,15 +3348,15 @@
1199 void InputDispatcher::doDispatchCycleFinishedLockedInterruptible(
1200 CommandEntry* commandEntry) {
1201 sp<Connection> connection = commandEntry->connection;
1202- nsecs_t finishTime = commandEntry->eventTime;
1203+ std::chrono::nanoseconds finishTime = commandEntry->eventTime;
1204 uint32_t seq = commandEntry->seq;
1205 bool handled = commandEntry->handled;
1206
1207 // Handle post-event policy actions.
1208 DispatchEntry* dispatchEntry = connection->findWaitQueueEntry(seq);
1209 if (dispatchEntry) {
1210- nsecs_t eventDuration = finishTime - dispatchEntry->deliveryTime;
1211- if (eventDuration > SLOW_EVENT_PROCESSING_WARNING_TIMEOUT) {
1212+ std::chrono::nanoseconds eventDuration = finishTime - dispatchEntry->deliveryTime;
1213+ if (eventDuration > std::chrono::nanoseconds(SLOW_EVENT_PROCESSING_WARNING_TIMEOUT)) {
1214 String8 msg;
1215 appendFormat(msg, "Window '%s' spent %0.1fms processing the last input event: ",
1216 connection->getWindowName(), eventDuration * 0.000001f);
1217@@ -3585,8 +3586,8 @@
1218 entry->downTime, entry->eventTime);
1219 }
1220
1221-void InputDispatcher::updateDispatchStatisticsLocked(nsecs_t currentTime, const EventEntry* entry,
1222- int32_t injectionResult, nsecs_t timeSpentWaitingForApplication) {
1223+void InputDispatcher::updateDispatchStatisticsLocked(std::chrono::nanoseconds currentTime, const EventEntry* entry,
1224+ int32_t injectionResult, std::chrono::nanoseconds timeSpentWaitingForApplication) {
1225 // TODO Write some statistics about how long we spend waiting.
1226 }
1227
1228@@ -3646,7 +3647,7 @@
1229
1230 // --- InputDispatcher::EventEntry ---
1231
1232-InputDispatcher::EventEntry::EventEntry(int32_t type, nsecs_t eventTime, uint32_t policyFlags) :
1233+InputDispatcher::EventEntry::EventEntry(int32_t type, std::chrono::nanoseconds eventTime, uint32_t policyFlags) :
1234 refCount(1), type(type), eventTime(eventTime), policyFlags(policyFlags),
1235 injectionState(NULL), dispatchInProgress(false) {
1236 }
1237@@ -3674,7 +3675,7 @@
1238
1239 // --- InputDispatcher::ConfigurationChangedEntry ---
1240
1241-InputDispatcher::ConfigurationChangedEntry::ConfigurationChangedEntry(nsecs_t eventTime) :
1242+InputDispatcher::ConfigurationChangedEntry::ConfigurationChangedEntry(std::chrono::nanoseconds eventTime) :
1243 EventEntry(TYPE_CONFIGURATION_CHANGED, eventTime, 0) {
1244 }
1245
1246@@ -3688,7 +3689,7 @@
1247
1248 // --- InputDispatcher::DeviceResetEntry ---
1249
1250-InputDispatcher::DeviceResetEntry::DeviceResetEntry(nsecs_t eventTime, int32_t deviceId) :
1251+InputDispatcher::DeviceResetEntry::DeviceResetEntry(std::chrono::nanoseconds eventTime, int32_t deviceId) :
1252 EventEntry(TYPE_DEVICE_RESET, eventTime, 0),
1253 deviceId(deviceId) {
1254 }
1255@@ -3703,10 +3704,10 @@
1256
1257 // --- InputDispatcher::KeyEntry ---
1258
1259-InputDispatcher::KeyEntry::KeyEntry(nsecs_t eventTime,
1260+InputDispatcher::KeyEntry::KeyEntry(std::chrono::nanoseconds eventTime,
1261 int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action,
1262 int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState,
1263- int32_t repeatCount, nsecs_t downTime) :
1264+ int32_t repeatCount, std::chrono::nanoseconds downTime) :
1265 EventEntry(TYPE_KEY, eventTime, policyFlags),
1266 deviceId(deviceId), source(source), action(action), flags(flags),
1267 keyCode(keyCode), scanCode(scanCode), metaState(metaState),
1268@@ -3729,17 +3730,17 @@
1269 dispatchInProgress = false;
1270 syntheticRepeat = false;
1271 interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_UNKNOWN;
1272- interceptKeyWakeupTime = 0;
1273+ interceptKeyWakeupTime = std::chrono::nanoseconds(0);
1274 }
1275
1276
1277 // --- InputDispatcher::MotionEntry ---
1278
1279-InputDispatcher::MotionEntry::MotionEntry(nsecs_t eventTime,
1280+InputDispatcher::MotionEntry::MotionEntry(std::chrono::nanoseconds eventTime,
1281 int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags,
1282 int32_t metaState, int32_t buttonState,
1283 int32_t edgeFlags, float xPrecision, float yPrecision,
1284- nsecs_t downTime, uint32_t pointerCount,
1285+ std::chrono::nanoseconds downTime, uint32_t pointerCount,
1286 const PointerProperties* pointerProperties, const PointerCoords* pointerCoords) :
1287 EventEntry(TYPE_MOTION, eventTime, policyFlags),
1288 eventTime(eventTime),
1289@@ -4005,7 +4006,7 @@
1290 }
1291 }
1292
1293-void InputDispatcher::InputState::synthesizeCancelationEvents(nsecs_t currentTime,
1294+void InputDispatcher::InputState::synthesizeCancelationEvents(std::chrono::nanoseconds currentTime,
1295 Vector<EventEntry*>& outEvents, const CancelationOptions& options) {
1296 for (size_t i = 0; i < mKeyMementos.size(); i++) {
1297 const KeyMemento& memento = mKeyMementos.itemAt(i);
1298
1299=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h'
1300--- 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h 2014-12-08 04:03:47 +0000
1301+++ 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h 2015-02-09 23:59:09 +0000
1302@@ -180,10 +180,10 @@
1303 */
1304 struct InputDispatcherConfiguration {
1305 // The key repeat initial timeout.
1306- nsecs_t keyRepeatTimeout;
1307+ std::chrono::nanoseconds keyRepeatTimeout;
1308
1309 // The key repeat inter-key delay.
1310- nsecs_t keyRepeatDelay;
1311+ std::chrono::nanoseconds keyRepeatDelay;
1312
1313 InputDispatcherConfiguration() :
1314 keyRepeatTimeout(500 * 1000000LL),
1315@@ -207,11 +207,11 @@
1316
1317 public:
1318 /* Notifies the system that a configuration change has occurred. */
1319- virtual void notifyConfigurationChanged(nsecs_t when) = 0;
1320+ virtual void notifyConfigurationChanged(std::chrono::nanoseconds when) = 0;
1321
1322 /* Notifies the system that an application is not responding.
1323 * Returns a new timeout to continue waiting, or 0 to abort dispatch. */
1324- virtual nsecs_t notifyANR(const sp<InputApplicationHandle>& inputApplicationHandle,
1325+ virtual std::chrono::nanoseconds notifyANR(const sp<InputApplicationHandle>& inputApplicationHandle,
1326 const sp<InputWindowHandle>& inputWindowHandle) = 0;
1327
1328 /* Notifies the system that an input channel is unrecoverably broken. */
1329@@ -246,10 +246,10 @@
1330 * This method is expected to set the POLICY_FLAG_PASS_TO_USER policy flag if the event
1331 * should be dispatched to applications.
1332 */
1333- virtual void interceptMotionBeforeQueueing(nsecs_t when, uint32_t& policyFlags) = 0;
1334+ virtual void interceptMotionBeforeQueueing(std::chrono::nanoseconds when, uint32_t& policyFlags) = 0;
1335
1336 /* Allows the policy a chance to intercept a key before dispatching. */
1337- virtual nsecs_t interceptKeyBeforeDispatching(const sp<InputWindowHandle>& inputWindowHandle,
1338+ virtual std::chrono::nanoseconds interceptKeyBeforeDispatching(const sp<InputWindowHandle>& inputWindowHandle,
1339 const KeyEvent* keyEvent, uint32_t policyFlags) = 0;
1340
1341 /* Allows the policy a chance to perform default processing for an unhandled key.
1342@@ -259,11 +259,11 @@
1343
1344 /* Notifies the policy about switch events.
1345 */
1346- virtual void notifySwitch(nsecs_t when,
1347+ virtual void notifySwitch(std::chrono::nanoseconds when,
1348 int32_t switchCode, int32_t switchValue, uint32_t policyFlags) = 0;
1349
1350 /* Poke user activity for an event dispatched to a window. */
1351- virtual void pokeUserActivity(nsecs_t eventTime, int32_t eventType) = 0;
1352+ virtual void pokeUserActivity(std::chrono::nanoseconds eventTime, int32_t eventType) = 0;
1353
1354 /* Checks whether a given application pid/uid has permission to inject input events
1355 * into other applications.
1356@@ -451,7 +451,7 @@
1357
1358 mutable int32_t refCount;
1359 int32_t type;
1360- nsecs_t eventTime;
1361+ std::chrono::nanoseconds eventTime;
1362 uint32_t policyFlags;
1363 InjectionState* injectionState;
1364
1365@@ -464,13 +464,13 @@
1366 virtual void appendDescription(String8& msg) const = 0;
1367
1368 protected:
1369- EventEntry(int32_t type, nsecs_t eventTime, uint32_t policyFlags);
1370+ EventEntry(int32_t type, std::chrono::nanoseconds eventTime, uint32_t policyFlags);
1371 virtual ~EventEntry();
1372 void releaseInjectionState();
1373 };
1374
1375 struct ConfigurationChangedEntry : EventEntry {
1376- ConfigurationChangedEntry(nsecs_t eventTime);
1377+ ConfigurationChangedEntry(std::chrono::nanoseconds eventTime);
1378 virtual void appendDescription(String8& msg) const;
1379
1380 protected:
1381@@ -480,7 +480,7 @@
1382 struct DeviceResetEntry : EventEntry {
1383 int32_t deviceId;
1384
1385- DeviceResetEntry(nsecs_t eventTime, int32_t deviceId);
1386+ DeviceResetEntry(std::chrono::nanoseconds eventTime, int32_t deviceId);
1387 virtual void appendDescription(String8& msg) const;
1388
1389 protected:
1390@@ -496,7 +496,7 @@
1391 int32_t scanCode;
1392 int32_t metaState;
1393 int32_t repeatCount;
1394- nsecs_t downTime;
1395+ std::chrono::nanoseconds downTime;
1396
1397 bool syntheticRepeat; // set to true for synthetic key repeats
1398
1399@@ -507,12 +507,12 @@
1400 INTERCEPT_KEY_RESULT_TRY_AGAIN_LATER
1401 };
1402 InterceptKeyResult interceptKeyResult; // set based on the interception result
1403- nsecs_t interceptKeyWakeupTime; // used with INTERCEPT_KEY_RESULT_TRY_AGAIN_LATER
1404+ std::chrono::nanoseconds interceptKeyWakeupTime; // used with INTERCEPT_KEY_RESULT_TRY_AGAIN_LATER
1405
1406- KeyEntry(nsecs_t eventTime,
1407+ KeyEntry(std::chrono::nanoseconds eventTime,
1408 int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action,
1409 int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState,
1410- int32_t repeatCount, nsecs_t downTime);
1411+ int32_t repeatCount, std::chrono::nanoseconds downTime);
1412 virtual void appendDescription(String8& msg) const;
1413 void recycle();
1414
1415@@ -521,7 +521,7 @@
1416 };
1417
1418 struct MotionEntry : EventEntry {
1419- nsecs_t eventTime;
1420+ std::chrono::nanoseconds eventTime;
1421 int32_t deviceId;
1422 uint32_t source;
1423 int32_t action;
1424@@ -531,16 +531,16 @@
1425 int32_t edgeFlags;
1426 float xPrecision;
1427 float yPrecision;
1428- nsecs_t downTime;
1429+ std::chrono::nanoseconds downTime;
1430 uint32_t pointerCount;
1431 PointerProperties pointerProperties[MAX_POINTERS];
1432 PointerCoords pointerCoords[MAX_POINTERS];
1433
1434- MotionEntry(nsecs_t eventTime,
1435+ MotionEntry(std::chrono::nanoseconds eventTime,
1436 int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action,
1437 int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags,
1438 float xPrecision, float yPrecision,
1439- nsecs_t downTime, uint32_t pointerCount,
1440+ std::chrono::nanoseconds downTime, uint32_t pointerCount,
1441 const PointerProperties* pointerProperties, const PointerCoords* pointerCoords);
1442 virtual void appendDescription(String8& msg) const;
1443
1444@@ -557,7 +557,7 @@
1445 float xOffset;
1446 float yOffset;
1447 float scaleFactor;
1448- nsecs_t deliveryTime; // time when the event was actually delivered
1449+ std::chrono::nanoseconds deliveryTime; // time when the event was actually delivered
1450
1451 // Set to the resolved action and flags when the event is enqueued.
1452 int32_t resolvedAction;
1453@@ -609,7 +609,7 @@
1454
1455 // parameters for the command (usage varies by command)
1456 sp<Connection> connection;
1457- nsecs_t eventTime;
1458+ std::chrono::nanoseconds eventTime;
1459 KeyEntry* keyEntry;
1460 sp<InputApplicationHandle> inputApplicationHandle;
1461 sp<InputWindowHandle> inputWindowHandle;
1462@@ -730,7 +730,7 @@
1463 bool trackMotion(const MotionEntry* entry, int32_t action, int32_t flags);
1464
1465 // Synthesizes cancelation events for the current state and resets the tracked state.
1466- void synthesizeCancelationEvents(nsecs_t currentTime,
1467+ void synthesizeCancelationEvents(std::chrono::nanoseconds currentTime,
1468 Vector<EventEntry*>& outEvents, const CancelationOptions& options);
1469
1470 // Clears the current state.
1471@@ -762,7 +762,7 @@
1472 int32_t scanCode;
1473 int32_t metaState;
1474 int32_t flags;
1475- nsecs_t downTime;
1476+ std::chrono::nanoseconds downTime;
1477 uint32_t policyFlags;
1478 };
1479
1480@@ -772,7 +772,7 @@
1481 int32_t flags;
1482 float xPrecision;
1483 float yPrecision;
1484- nsecs_t downTime;
1485+ std::chrono::nanoseconds downTime;
1486 uint32_t pointerCount;
1487 PointerProperties pointerProperties[MAX_POINTERS];
1488 PointerCoords pointerCoords[MAX_POINTERS];
1489@@ -864,7 +864,7 @@
1490 Queue<EventEntry> mInboundQueue;
1491 Queue<CommandEntry> mCommandQueue;
1492
1493- void dispatchOnceInnerLocked(nsecs_t* nextWakeupTime);
1494+ void dispatchOnceInnerLocked(std::chrono::nanoseconds* nextWakeupTime);
1495
1496 // Enqueues an inbound event. Returns true if mLooper->wake() should be called.
1497 bool enqueueInboundEventLocked(EventEntry* entry);
1498@@ -874,7 +874,7 @@
1499
1500 // App switch latency optimization.
1501 bool mAppSwitchSawKeyDown;
1502- nsecs_t mAppSwitchDueTime;
1503+ std::chrono::nanoseconds mAppSwitchDueTime;
1504
1505 static bool isAppSwitchKeyCode(int32_t keyCode);
1506 bool isAppSwitchKeyEventLocked(KeyEntry* keyEntry);
1507@@ -882,7 +882,7 @@
1508 void resetPendingAppSwitchLocked(bool handled);
1509
1510 // Stale event latency optimization.
1511- static bool isStaleEventLocked(nsecs_t currentTime, EventEntry* entry);
1512+ static bool isStaleEventLocked(std::chrono::nanoseconds currentTime, EventEntry* entry);
1513
1514 // Blocked event latency optimization. Drops old events when the user intends
1515 // to transfer focus to a new application.
1516@@ -910,11 +910,11 @@
1517 // Key repeat tracking.
1518 struct KeyRepeatState {
1519 KeyEntry* lastKeyEntry; // or null if no repeat
1520- nsecs_t nextRepeatTime;
1521+ std::chrono::nanoseconds nextRepeatTime;
1522 } mKeyRepeatState;
1523
1524 void resetKeyRepeatLocked();
1525- KeyEntry* synthesizeKeyRepeatLocked(nsecs_t currentTime);
1526+ KeyEntry* synthesizeKeyRepeatLocked(std::chrono::nanoseconds currentTime);
1527
1528 // Deferred command processing.
1529 bool runCommandsLockedInterruptible();
1530@@ -974,16 +974,16 @@
1531
1532 // Dispatch inbound events.
1533 bool dispatchConfigurationChangedLocked(
1534- nsecs_t currentTime, ConfigurationChangedEntry* entry);
1535+ std::chrono::nanoseconds currentTime, ConfigurationChangedEntry* entry);
1536 bool dispatchDeviceResetLocked(
1537- nsecs_t currentTime, DeviceResetEntry* entry);
1538+ std::chrono::nanoseconds currentTime, DeviceResetEntry* entry);
1539 bool dispatchKeyLocked(
1540- nsecs_t currentTime, KeyEntry* entry,
1541- DropReason* dropReason, nsecs_t* nextWakeupTime);
1542+ std::chrono::nanoseconds currentTime, KeyEntry* entry,
1543+ DropReason* dropReason, std::chrono::nanoseconds* nextWakeupTime);
1544 bool dispatchMotionLocked(
1545- nsecs_t currentTime, MotionEntry* entry,
1546- DropReason* dropReason, nsecs_t* nextWakeupTime);
1547- void dispatchEventLocked(nsecs_t currentTime, EventEntry* entry,
1548+ std::chrono::nanoseconds currentTime, MotionEntry* entry,
1549+ DropReason* dropReason, std::chrono::nanoseconds* nextWakeupTime);
1550+ void dispatchEventLocked(std::chrono::nanoseconds currentTime, EventEntry* entry,
1551 const Vector<InputTarget>& inputTargets);
1552
1553 void logOutboundKeyDetailsLocked(const char* prefix, const KeyEntry* entry);
1554@@ -997,8 +997,8 @@
1555 };
1556
1557 InputTargetWaitCause mInputTargetWaitCause;
1558- nsecs_t mInputTargetWaitStartTime;
1559- nsecs_t mInputTargetWaitTimeoutTime;
1560+ std::chrono::nanoseconds mInputTargetWaitStartTime;
1561+ std::chrono::nanoseconds mInputTargetWaitTimeoutTime;
1562 bool mInputTargetWaitTimeoutExpired;
1563 sp<InputApplicationHandle> mInputTargetWaitApplicationHandle;
1564
1565@@ -1006,19 +1006,19 @@
1566 sp<InputWindowHandle> mLastHoverWindowHandle;
1567
1568 // Finding targets for input events.
1569- int32_t handleTargetsNotReadyLocked(nsecs_t currentTime, const EventEntry* entry,
1570+ int32_t handleTargetsNotReadyLocked(std::chrono::nanoseconds currentTime, const EventEntry* entry,
1571 const sp<InputApplicationHandle>& applicationHandle,
1572 const sp<InputWindowHandle>& windowHandle,
1573- nsecs_t* nextWakeupTime, const char* reason);
1574- void resumeAfterTargetsNotReadyTimeoutLocked(nsecs_t newTimeout,
1575+ std::chrono::nanoseconds* nextWakeupTime, const char* reason);
1576+ void resumeAfterTargetsNotReadyTimeoutLocked(std::chrono::nanoseconds newTimeout,
1577 const sp<InputChannel>& inputChannel);
1578- nsecs_t getTimeSpentWaitingForApplicationLocked(nsecs_t currentTime);
1579+ std::chrono::nanoseconds getTimeSpentWaitingForApplicationLocked(std::chrono::nanoseconds currentTime);
1580 void resetANRTimeoutsLocked();
1581
1582- int32_t findFocusedWindowTargetsLocked(nsecs_t currentTime, const EventEntry* entry,
1583- Vector<InputTarget>& inputTargets, nsecs_t* nextWakeupTime);
1584- int32_t findTouchedWindowTargetsLocked(nsecs_t currentTime, const MotionEntry* entry,
1585- Vector<InputTarget>& inputTargets, nsecs_t* nextWakeupTime,
1586+ int32_t findFocusedWindowTargetsLocked(std::chrono::nanoseconds currentTime, const EventEntry* entry,
1587+ Vector<InputTarget>& inputTargets, std::chrono::nanoseconds* nextWakeupTime);
1588+ int32_t findTouchedWindowTargetsLocked(std::chrono::nanoseconds currentTime, const MotionEntry* entry,
1589+ Vector<InputTarget>& inputTargets, std::chrono::nanoseconds* nextWakeupTime,
1590 bool* outConflictingPointerActions);
1591
1592 void addWindowTargetLocked(const sp<InputWindowHandle>& windowHandle,
1593@@ -1029,7 +1029,7 @@
1594 const InjectionState* injectionState);
1595 bool isWindowObscuredAtPointLocked(const sp<InputWindowHandle>& windowHandle,
1596 int32_t x, int32_t y) const;
1597- bool isWindowReadyForMoreInputLocked(nsecs_t currentTime,
1598+ bool isWindowReadyForMoreInputLocked(std::chrono::nanoseconds currentTime,
1599 const sp<InputWindowHandle>& windowHandle, const EventEntry* eventEntry);
1600 String8 getApplicationWindowLabelLocked(const sp<InputApplicationHandle>& applicationHandle,
1601 const sp<InputWindowHandle>& windowHandle);
1602@@ -1038,16 +1038,16 @@
1603 // These methods are deliberately not Interruptible because doing all of the work
1604 // with the mutex held makes it easier to ensure that connection invariants are maintained.
1605 // If needed, the methods post commands to run later once the critical bits are done.
1606- void prepareDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection,
1607+ void prepareDispatchCycleLocked(std::chrono::nanoseconds currentTime, const sp<Connection>& connection,
1608 EventEntry* eventEntry, const InputTarget* inputTarget);
1609- void enqueueDispatchEntriesLocked(nsecs_t currentTime, const sp<Connection>& connection,
1610+ void enqueueDispatchEntriesLocked(std::chrono::nanoseconds currentTime, const sp<Connection>& connection,
1611 EventEntry* eventEntry, const InputTarget* inputTarget);
1612 void enqueueDispatchEntryLocked(const sp<Connection>& connection,
1613 EventEntry* eventEntry, const InputTarget* inputTarget, int32_t dispatchMode);
1614- void startDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection);
1615- void finishDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection,
1616+ void startDispatchCycleLocked(std::chrono::nanoseconds currentTime, const sp<Connection>& connection);
1617+ void finishDispatchCycleLocked(std::chrono::nanoseconds currentTime, const sp<Connection>& connection,
1618 uint32_t seq, bool handled);
1619- void abortBrokenDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection,
1620+ void abortBrokenDispatchCycleLocked(std::chrono::nanoseconds currentTime, const sp<Connection>& connection,
1621 bool notify);
1622 void drainDispatchQueueLocked(Queue<DispatchEntry>* queue);
1623 void releaseDispatchEntryLocked(DispatchEntry* dispatchEntry);
1624@@ -1080,13 +1080,13 @@
1625
1626 // Interesting events that we might like to log or tell the framework about.
1627 void onDispatchCycleFinishedLocked(
1628- nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled);
1629+ std::chrono::nanoseconds currentTime, const sp<Connection>& connection, uint32_t seq, bool handled);
1630 void onDispatchCycleBrokenLocked(
1631- nsecs_t currentTime, const sp<Connection>& connection);
1632+ std::chrono::nanoseconds currentTime, const sp<Connection>& connection);
1633 void onANRLocked(
1634- nsecs_t currentTime, const sp<InputApplicationHandle>& applicationHandle,
1635+ std::chrono::nanoseconds currentTime, const sp<InputApplicationHandle>& applicationHandle,
1636 const sp<InputWindowHandle>& windowHandle,
1637- nsecs_t eventTime, nsecs_t waitStartTime, const char* reason);
1638+ std::chrono::nanoseconds eventTime, std::chrono::nanoseconds waitStartTime, const char* reason);
1639
1640 // Outbound policy interactions.
1641 void doNotifyConfigurationChangedInterruptible(CommandEntry* commandEntry);
1642@@ -1102,8 +1102,8 @@
1643 void initializeKeyEvent(KeyEvent* event, const KeyEntry* entry);
1644
1645 // Statistics gathering.
1646- void updateDispatchStatisticsLocked(nsecs_t currentTime, const EventEntry* entry,
1647- int32_t injectionResult, nsecs_t timeSpentWaitingForApplication);
1648+ void updateDispatchStatisticsLocked(std::chrono::nanoseconds currentTime, const EventEntry* entry,
1649+ int32_t injectionResult, std::chrono::nanoseconds timeSpentWaitingForApplication);
1650
1651 void setKeyboardFocusLocked(const sp<InputWindowHandle>& windowHandle);
1652 };
1653
1654=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp'
1655--- 3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp 2014-12-08 04:03:47 +0000
1656+++ 3rd_party/android-input/android/frameworks/base/services/input/InputListener.cpp 2015-02-09 23:59:09 +0000
1657@@ -26,7 +26,7 @@
1658
1659 // --- NotifyConfigurationChangedArgs ---
1660
1661-NotifyConfigurationChangedArgs::NotifyConfigurationChangedArgs(nsecs_t eventTime) :
1662+NotifyConfigurationChangedArgs::NotifyConfigurationChangedArgs(std::chrono::nanoseconds eventTime) :
1663 eventTime(eventTime) {
1664 }
1665
1666@@ -42,10 +42,10 @@
1667
1668 // --- NotifyKeyArgs ---
1669
1670-NotifyKeyArgs::NotifyKeyArgs(nsecs_t eventTime, int32_t deviceId, uint32_t source,
1671+NotifyKeyArgs::NotifyKeyArgs(std::chrono::nanoseconds eventTime, int32_t deviceId, uint32_t source,
1672 uint32_t policyFlags,
1673 int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode,
1674- int32_t metaState, nsecs_t downTime) :
1675+ int32_t metaState, std::chrono::nanoseconds downTime) :
1676 eventTime(eventTime), deviceId(deviceId), source(source), policyFlags(policyFlags),
1677 action(action), flags(flags), keyCode(keyCode), scanCode(scanCode),
1678 metaState(metaState), downTime(downTime) {
1679@@ -66,12 +66,12 @@
1680
1681 // --- NotifyMotionArgs ---
1682
1683-NotifyMotionArgs::NotifyMotionArgs(nsecs_t eventTime, int32_t deviceId, uint32_t source,
1684+NotifyMotionArgs::NotifyMotionArgs(std::chrono::nanoseconds eventTime, int32_t deviceId, uint32_t source,
1685 uint32_t policyFlags,
1686 int32_t action, int32_t flags, int32_t metaState, int32_t buttonState,
1687 int32_t edgeFlags, uint32_t pointerCount,
1688 const PointerProperties* pointerProperties, const PointerCoords* pointerCoords,
1689- float xPrecision, float yPrecision, nsecs_t downTime) :
1690+ float xPrecision, float yPrecision, std::chrono::nanoseconds downTime) :
1691 eventTime(eventTime), deviceId(deviceId), source(source), policyFlags(policyFlags),
1692 action(action), flags(flags), metaState(metaState), buttonState(buttonState),
1693 edgeFlags(edgeFlags), pointerCount(pointerCount),
1694@@ -102,7 +102,7 @@
1695
1696 // --- NotifySwitchArgs ---
1697
1698-NotifySwitchArgs::NotifySwitchArgs(nsecs_t eventTime, uint32_t policyFlags,
1699+NotifySwitchArgs::NotifySwitchArgs(std::chrono::nanoseconds eventTime, uint32_t policyFlags,
1700 int32_t switchCode, int32_t switchValue) :
1701 eventTime(eventTime), policyFlags(policyFlags),
1702 switchCode(switchCode), switchValue(switchValue) {
1703@@ -120,7 +120,7 @@
1704
1705 // --- NotifyDeviceResetArgs ---
1706
1707-NotifyDeviceResetArgs::NotifyDeviceResetArgs(nsecs_t eventTime, int32_t deviceId) :
1708+NotifyDeviceResetArgs::NotifyDeviceResetArgs(std::chrono::nanoseconds eventTime, int32_t deviceId) :
1709 eventTime(eventTime), deviceId(deviceId) {
1710 }
1711
1712
1713=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputListener.h'
1714--- 3rd_party/android-input/android/frameworks/base/services/input/InputListener.h 2014-12-08 04:03:47 +0000
1715+++ 3rd_party/android-input/android/frameworks/base/services/input/InputListener.h 2015-02-09 23:59:09 +0000
1716@@ -37,11 +37,11 @@
1717
1718 /* Describes a configuration change event. */
1719 struct NotifyConfigurationChangedArgs : public NotifyArgs {
1720- nsecs_t eventTime;
1721+ std::chrono::nanoseconds eventTime;
1722
1723 inline NotifyConfigurationChangedArgs() : eventTime{0} { }
1724
1725- NotifyConfigurationChangedArgs(nsecs_t eventTime);
1726+ NotifyConfigurationChangedArgs(std::chrono::nanoseconds eventTime);
1727
1728 NotifyConfigurationChangedArgs(const NotifyConfigurationChangedArgs& other);
1729
1730@@ -53,7 +53,7 @@
1731
1732 /* Describes a key event. */
1733 struct NotifyKeyArgs : public NotifyArgs {
1734- nsecs_t eventTime;
1735+ std::chrono::nanoseconds eventTime;
1736 int32_t deviceId;
1737 uint32_t source;
1738 uint32_t policyFlags;
1739@@ -62,13 +62,13 @@
1740 int32_t keyCode;
1741 int32_t scanCode;
1742 int32_t metaState;
1743- nsecs_t downTime;
1744+ std::chrono::nanoseconds downTime;
1745
1746 inline NotifyKeyArgs() { }
1747
1748- NotifyKeyArgs(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags,
1749+ NotifyKeyArgs(std::chrono::nanoseconds eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags,
1750 int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode,
1751- int32_t metaState, nsecs_t downTime);
1752+ int32_t metaState, std::chrono::nanoseconds downTime);
1753
1754 NotifyKeyArgs(const NotifyKeyArgs& other);
1755
1756@@ -80,7 +80,7 @@
1757
1758 /* Describes a motion event. */
1759 struct NotifyMotionArgs : public NotifyArgs {
1760- nsecs_t eventTime;
1761+ std::chrono::nanoseconds eventTime;
1762 int32_t deviceId;
1763 uint32_t source;
1764 uint32_t policyFlags;
1765@@ -94,15 +94,15 @@
1766 PointerCoords pointerCoords[MAX_POINTERS];
1767 float xPrecision;
1768 float yPrecision;
1769- nsecs_t downTime;
1770+ std::chrono::nanoseconds downTime;
1771
1772 inline NotifyMotionArgs() { }
1773
1774- NotifyMotionArgs(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags,
1775+ NotifyMotionArgs(std::chrono::nanoseconds eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags,
1776 int32_t action, int32_t flags, int32_t metaState, int32_t buttonState,
1777 int32_t edgeFlags, uint32_t pointerCount,
1778 const PointerProperties* pointerProperties, const PointerCoords* pointerCoords,
1779- float xPrecision, float yPrecision, nsecs_t downTime);
1780+ float xPrecision, float yPrecision, std::chrono::nanoseconds downTime);
1781
1782 NotifyMotionArgs(const NotifyMotionArgs& other);
1783
1784@@ -114,14 +114,14 @@
1785
1786 /* Describes a switch event. */
1787 struct NotifySwitchArgs : public NotifyArgs {
1788- nsecs_t eventTime;
1789+ std::chrono::nanoseconds eventTime;
1790 uint32_t policyFlags;
1791 int32_t switchCode;
1792 int32_t switchValue;
1793
1794 inline NotifySwitchArgs() { }
1795
1796- NotifySwitchArgs(nsecs_t eventTime, uint32_t policyFlags,
1797+ NotifySwitchArgs(std::chrono::nanoseconds eventTime, uint32_t policyFlags,
1798 int32_t switchCode, int32_t switchValue);
1799
1800 NotifySwitchArgs(const NotifySwitchArgs& other);
1801@@ -135,12 +135,12 @@
1802 /* Describes a device reset event, such as when a device is added,
1803 * reconfigured, or removed. */
1804 struct NotifyDeviceResetArgs : public NotifyArgs {
1805- nsecs_t eventTime;
1806+ std::chrono::nanoseconds eventTime;
1807 int32_t deviceId;
1808
1809 inline NotifyDeviceResetArgs() { }
1810
1811- NotifyDeviceResetArgs(nsecs_t eventTime, int32_t deviceId);
1812+ NotifyDeviceResetArgs(std::chrono::nanoseconds eventTime, int32_t deviceId);
1813
1814 NotifyDeviceResetArgs(const NotifyDeviceResetArgs& other);
1815
1816
1817=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp'
1818--- 3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp 2014-12-08 04:03:47 +0000
1819+++ 3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp 2015-02-09 23:59:09 +0000
1820@@ -181,7 +181,7 @@
1821 }
1822
1823 static void synthesizeButtonKey(InputReaderContext* context, int32_t action,
1824- nsecs_t when, int32_t deviceId, uint32_t source,
1825+ std::chrono::nanoseconds when, int32_t deviceId, uint32_t source,
1826 uint32_t policyFlags, int32_t lastButtonState, int32_t currentButtonState,
1827 int32_t buttonState, int32_t keyCode) {
1828 if (
1829@@ -198,7 +198,7 @@
1830 }
1831
1832 static void synthesizeButtonKeys(InputReaderContext* context, int32_t action,
1833- nsecs_t when, int32_t deviceId, uint32_t source,
1834+ std::chrono::nanoseconds when, int32_t deviceId, uint32_t source,
1835 uint32_t policyFlags, int32_t lastButtonState, int32_t currentButtonState) {
1836 synthesizeButtonKey(context, action, when, deviceId, source, policyFlags,
1837 lastButtonState, currentButtonState,
1838@@ -283,8 +283,8 @@
1839 mConfigurationChangesToRefresh = 0;
1840 timeoutMillis = 0;
1841 refreshConfigurationLocked(changes);
1842- } else if (mNextTimeout != LLONG_MAX) {
1843- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
1844+ } else if (mNextTimeout != std::chrono::nanoseconds(LLONG_MAX)) {
1845+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
1846 timeoutMillis = toMillisecondTimeoutDelay(now, mNextTimeout);
1847 }
1848 } // release lock
1849@@ -299,13 +299,13 @@
1850 processEventsLocked(mEventBuffer, count);
1851 }
1852
1853- if (mNextTimeout != LLONG_MAX) {
1854- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
1855+ if (mNextTimeout != std::chrono::nanoseconds(LLONG_MAX)) {
1856+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
1857 if (now >= mNextTimeout) {
1858 #if DEBUG_RAW_EVENTS
1859 ALOGD("Timeout expired, latency=%0.3fms", (now - mNextTimeout) * 0.000001f);
1860 #endif
1861- mNextTimeout = LLONG_MAX;
1862+ mNextTimeout = std::chrono::nanoseconds(LLONG_MAX);
1863 timeoutExpiredLocked(now);
1864 }
1865 }
1866@@ -369,7 +369,7 @@
1867 }
1868 }
1869
1870-void InputReader::addDeviceLocked(nsecs_t when, int32_t deviceId) {
1871+void InputReader::addDeviceLocked(std::chrono::nanoseconds when, int32_t deviceId) {
1872 ssize_t deviceIndex = mDevices.indexOfKey(deviceId);
1873 if (deviceIndex >= 0) {
1874 ALOGW("Ignoring spurious device added event for deviceId %d.", deviceId);
1875@@ -395,7 +395,7 @@
1876 bumpGenerationLocked();
1877 }
1878
1879-void InputReader::removeDeviceLocked(nsecs_t when, int32_t deviceId) {
1880+void InputReader::removeDeviceLocked(std::chrono::nanoseconds when, int32_t deviceId) {
1881 InputDevice* device = NULL;
1882 ssize_t deviceIndex = mDevices.indexOfKey(deviceId);
1883 if (deviceIndex < 0) {
1884@@ -496,7 +496,7 @@
1885 device->process(rawEvents, count);
1886 }
1887
1888-void InputReader::timeoutExpiredLocked(nsecs_t when) {
1889+void InputReader::timeoutExpiredLocked(std::chrono::nanoseconds when) {
1890 for (size_t i = 0; i < mDevices.size(); i++) {
1891 InputDevice* device = mDevices.valueAt(i);
1892 if (!device->isIgnored()) {
1893@@ -505,7 +505,7 @@
1894 }
1895 }
1896
1897-void InputReader::handleConfigurationChangedLocked(nsecs_t when) {
1898+void InputReader::handleConfigurationChangedLocked(std::chrono::nanoseconds when) {
1899 // Reset global meta state because it depends on the list of all configured devices.
1900 updateGlobalMetaStateLocked();
1901
1902@@ -520,7 +520,7 @@
1903
1904 if (changes) {
1905 ALOGI("Reconfiguring input devices. changes=0x%08x", changes);
1906- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
1907+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
1908
1909 if (changes & InputReaderConfiguration::CHANGE_MUST_REOPEN) {
1910 mEventHub->requestReopenDevices();
1911@@ -546,11 +546,11 @@
1912 return mGlobalMetaState;
1913 }
1914
1915-void InputReader::disableVirtualKeysUntilLocked(nsecs_t time) {
1916+void InputReader::disableVirtualKeysUntilLocked(std::chrono::nanoseconds time) {
1917 mDisableVirtualKeysTimeout = time;
1918 }
1919
1920-bool InputReader::shouldDropVirtualKeyLocked(nsecs_t now,
1921+bool InputReader::shouldDropVirtualKeyLocked(std::chrono::nanoseconds now,
1922 InputDevice* device, int32_t keyCode, int32_t scanCode) {
1923 if (now < mDisableVirtualKeysTimeout) {
1924 ALOGI("Dropping virtual key from device %s because virtual keys are "
1925@@ -571,7 +571,7 @@
1926 }
1927 }
1928
1929-void InputReader::requestTimeoutAtTimeLocked(nsecs_t when) {
1930+void InputReader::requestTimeoutAtTimeLocked(std::chrono::nanoseconds when) {
1931 if (when < mNextTimeout) {
1932 mNextTimeout = when;
1933 mEventHub->wake();
1934@@ -696,7 +696,7 @@
1935 }
1936 }
1937
1938-void InputReader::vibrate(int32_t deviceId, const nsecs_t* pattern, size_t patternSize,
1939+void InputReader::vibrate(int32_t deviceId, const std::chrono::nanoseconds* pattern, size_t patternSize,
1940 ssize_t repeat, int32_t token) {
1941 AutoMutex _l(mLock);
1942
1943@@ -810,12 +810,12 @@
1944 return mReader->getGlobalMetaStateLocked();
1945 }
1946
1947-void InputReader::ContextImpl::disableVirtualKeysUntil(nsecs_t time) {
1948+void InputReader::ContextImpl::disableVirtualKeysUntil(std::chrono::nanoseconds time) {
1949 // lock is already held by the input loop
1950 mReader->disableVirtualKeysUntilLocked(time);
1951 }
1952
1953-bool InputReader::ContextImpl::shouldDropVirtualKey(nsecs_t now,
1954+bool InputReader::ContextImpl::shouldDropVirtualKey(std::chrono::nanoseconds now,
1955 InputDevice* device, int32_t keyCode, int32_t scanCode) {
1956 // lock is already held by the input loop
1957 return mReader->shouldDropVirtualKeyLocked(now, device, keyCode, scanCode);
1958@@ -826,7 +826,7 @@
1959 mReader->fadePointerLocked();
1960 }
1961
1962-void InputReader::ContextImpl::requestTimeoutAtTime(nsecs_t when) {
1963+void InputReader::ContextImpl::requestTimeoutAtTime(std::chrono::nanoseconds when) {
1964 // lock is already held by the input loop
1965 mReader->requestTimeoutAtTimeLocked(when);
1966 }
1967@@ -922,7 +922,7 @@
1968 mMappers.add(mapper);
1969 }
1970
1971-void InputDevice::configure(nsecs_t when, InputReaderConfiguration const* config, uint32_t changes) {
1972+void InputDevice::configure(std::chrono::nanoseconds when, InputReaderConfiguration const* config, uint32_t changes) {
1973 mSources = 0;
1974
1975 if (!isIgnored()) {
1976@@ -959,7 +959,7 @@
1977 }
1978 }
1979
1980-void InputDevice::reset(nsecs_t when) {
1981+void InputDevice::reset(std::chrono::nanoseconds when) {
1982 size_t numMappers = mMappers.size();
1983 for (size_t i = 0; i < numMappers; i++) {
1984 InputMapper* mapper = mMappers[i];
1985@@ -1009,7 +1009,7 @@
1986 }
1987 }
1988
1989-void InputDevice::timeoutExpired(nsecs_t when) {
1990+void InputDevice::timeoutExpired(std::chrono::nanoseconds when) {
1991 size_t numMappers = mMappers.size();
1992 for (size_t i = 0; i < numMappers; i++) {
1993 InputMapper* mapper = mMappers[i];
1994@@ -1071,7 +1071,7 @@
1995 return result;
1996 }
1997
1998-void InputDevice::vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
1999+void InputDevice::vibrate(const std::chrono::nanoseconds* pattern, size_t patternSize, ssize_t repeat,
2000 int32_t token) {
2001 size_t numMappers = mMappers.size();
2002 for (size_t i = 0; i < numMappers; i++) {
2003@@ -1110,7 +1110,7 @@
2004 mGeneration = mContext->bumpGeneration();
2005 }
2006
2007-void InputDevice::notifyReset(nsecs_t when) {
2008+void InputDevice::notifyReset(std::chrono::nanoseconds when) {
2009 NotifyDeviceResetArgs args(when, mId);
2010 mContext->getListener()->notifyDeviceReset(&args);
2011 }
2012@@ -1760,14 +1760,14 @@
2013 void InputMapper::dump(String8& dump) {
2014 }
2015
2016-void InputMapper::configure(nsecs_t when,
2017+void InputMapper::configure(std::chrono::nanoseconds when,
2018 const InputReaderConfiguration* config, uint32_t changes) {
2019 }
2020
2021-void InputMapper::reset(nsecs_t when) {
2022+void InputMapper::reset(std::chrono::nanoseconds when) {
2023 }
2024
2025-void InputMapper::timeoutExpired(nsecs_t when) {
2026+void InputMapper::timeoutExpired(std::chrono::nanoseconds when) {
2027 }
2028
2029 int32_t InputMapper::getKeyCodeState(uint32_t sourceMask, int32_t keyCode) {
2030@@ -1787,7 +1787,7 @@
2031 return false;
2032 }
2033
2034-void InputMapper::vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
2035+void InputMapper::vibrate(const std::chrono::nanoseconds* pattern, size_t patternSize, ssize_t repeat,
2036 int32_t token) {
2037 }
2038
2039@@ -1841,7 +1841,7 @@
2040 }
2041 }
2042
2043-void SwitchInputMapper::processSwitch(nsecs_t when, int32_t switchCode, int32_t switchValue) {
2044+void SwitchInputMapper::processSwitch(std::chrono::nanoseconds when, int32_t switchCode, int32_t switchValue) {
2045 NotifySwitchArgs args(when, 0, switchCode, switchValue);
2046 getListener()->notifySwitch(&args);
2047 }
2048@@ -1874,7 +1874,7 @@
2049 // TODO: Handle FF_STATUS, although it does not seem to be widely supported.
2050 }
2051
2052-void VibratorInputMapper::vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
2053+void VibratorInputMapper::vibrate(const std::chrono::nanoseconds* pattern, size_t patternSize, ssize_t repeat,
2054 int32_t token) {
2055 #if DEBUG_VIBRATOR
2056 String8 patternStr;
2057@@ -1889,7 +1889,7 @@
2058 #endif
2059
2060 mVibrating = true;
2061- memcpy(mPattern, pattern, patternSize * sizeof(nsecs_t));
2062+ memcpy(mPattern, pattern, patternSize * sizeof(std::chrono::nanoseconds));
2063 mPatternSize = patternSize;
2064 mRepeat = repeat;
2065 mToken = token;
2066@@ -1908,7 +1908,7 @@
2067 }
2068 }
2069
2070-void VibratorInputMapper::timeoutExpired(nsecs_t when) {
2071+void VibratorInputMapper::timeoutExpired(std::chrono::nanoseconds when) {
2072 if (mVibrating) {
2073 if (when >= mNextStepTime) {
2074 nextStep();
2075@@ -1930,7 +1930,7 @@
2076 }
2077
2078 bool vibratorOn = mIndex & 1;
2079- nsecs_t duration = mPattern[mIndex];
2080+ std::chrono::nanoseconds duration = mPattern[mIndex];
2081 if (vibratorOn) {
2082 #if DEBUG_VIBRATOR
2083 ALOGD("nextStep: sending vibrate deviceId=%d, duration=%lld",
2084@@ -1943,7 +1943,7 @@
2085 #endif
2086 getEventHub()->cancelVibrate(getDeviceId());
2087 }
2088- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
2089+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
2090 mNextStepTime = now + duration;
2091 getContext()->requestTimeoutAtTime(mNextStepTime);
2092 #if DEBUG_VIBRATOR
2093@@ -1998,7 +1998,7 @@
2094 }
2095
2096
2097-void KeyboardInputMapper::configure(nsecs_t when, InputReaderConfiguration const* config, uint32_t changes) {
2098+void KeyboardInputMapper::configure(std::chrono::nanoseconds when, InputReaderConfiguration const* config, uint32_t changes) {
2099 InputMapper::configure(when, config, changes);
2100
2101 if (!changes) { // first time only
2102@@ -2037,9 +2037,9 @@
2103 toString(mParameters.orientationAware));
2104 }
2105
2106-void KeyboardInputMapper::reset(nsecs_t when) {
2107+void KeyboardInputMapper::reset(std::chrono::nanoseconds when) {
2108 mMetaState = AMETA_NONE;
2109- mDownTime = 0;
2110+ mDownTime = std::chrono::nanoseconds(0);
2111 mKeyDowns.clear();
2112 mCurrentHidUsage = 0;
2113
2114@@ -2087,7 +2087,7 @@
2115 || (scanCode >= BTN_JOYSTICK && scanCode < BTN_DIGI);
2116 }
2117
2118-void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode,
2119+void KeyboardInputMapper::processKey(std::chrono::nanoseconds when, bool down, int32_t keyCode,
2120 int32_t scanCode, uint32_t policyFlags) {
2121
2122 if (down) {
2123@@ -2141,7 +2141,7 @@
2124 updateLedState(false);
2125 }
2126
2127- nsecs_t downTime = mDownTime;
2128+ std::chrono::nanoseconds downTime = mDownTime;
2129
2130 // Key down on external an keyboard should wake the device.
2131 // We don't do this for internal keyboards to prevent them from waking up in your pocket.
2132@@ -2283,7 +2283,7 @@
2133 appendFormat(dump, INDENT3 "DownTime: %lld\n", mDownTime);
2134 }
2135
2136-void CursorInputMapper::configure(nsecs_t when, InputReaderConfiguration const* config, uint32_t changes) {
2137+void CursorInputMapper::configure(std::chrono::nanoseconds when, InputReaderConfiguration const* config, uint32_t changes) {
2138 InputMapper::configure(when, config, changes);
2139
2140 if (!changes) { // first time only
2141@@ -2375,9 +2375,9 @@
2142 toString(mParameters.orientationAware));
2143 }
2144
2145-void CursorInputMapper::reset(nsecs_t when) {
2146+void CursorInputMapper::reset(std::chrono::nanoseconds when) {
2147 mButtonState = 0;
2148- mDownTime = 0;
2149+ mDownTime = std::chrono::nanoseconds(0);
2150
2151 mPointerVelocityControl.reset();
2152 mWheelXVelocityControl.reset();
2153@@ -2400,7 +2400,7 @@
2154 }
2155 }
2156
2157-void CursorInputMapper::sync(nsecs_t when) {
2158+void CursorInputMapper::sync(std::chrono::nanoseconds when) {
2159 int32_t lastButtonState = mButtonState;
2160 int32_t currentButtonState = mCursorButtonAccumulator.getButtonState();
2161 mButtonState = currentButtonState;
2162@@ -2416,7 +2416,7 @@
2163 } else {
2164 downChanged = false;
2165 }
2166- nsecs_t downTime = mDownTime;
2167+ std::chrono::nanoseconds downTime = mDownTime;
2168 bool buttonsChanged = currentButtonState != lastButtonState;
2169 bool buttonsPressed = currentButtonState & ~lastButtonState;
2170
2171@@ -2692,7 +2692,7 @@
2172 }
2173 }
2174
2175-void TouchInputMapper::configure(nsecs_t when, const InputReaderConfiguration* config,
2176+void TouchInputMapper::configure(std::chrono::nanoseconds when, const InputReaderConfiguration* config,
2177 uint32_t changes) {
2178 InputMapper::configure(when, config, changes);
2179
2180@@ -2850,7 +2850,7 @@
2181 dumpRawAbsoluteAxisInfo(dump, mRawPointerAxes.slot, "Slot");
2182 }
2183
2184-void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {
2185+void TouchInputMapper::configureSurface(std::chrono::nanoseconds when, bool* outResetNeeded) {
2186 int32_t oldDeviceMode = mDeviceMode;
2187
2188 // Determine device mode.
2189@@ -3479,7 +3479,7 @@
2190 }
2191 }
2192
2193-void TouchInputMapper::reset(nsecs_t when) {
2194+void TouchInputMapper::reset(std::chrono::nanoseconds when) {
2195 mCursorButtonAccumulator.reset(getDevice());
2196 mCursorScrollAccumulator.reset(getDevice());
2197 mTouchButtonAccumulator.reset(getDevice());
2198@@ -3504,7 +3504,7 @@
2199 mLastMouseIds.clear();
2200 mPointerUsage = POINTER_USAGE_NONE;
2201 mSentHoverEnter = false;
2202- mDownTime = 0;
2203+ mDownTime = std::chrono::nanoseconds(0);
2204
2205 mCurrentVirtualKey.down = false;
2206
2207@@ -3529,7 +3529,7 @@
2208 }
2209 }
2210
2211-void TouchInputMapper::sync(nsecs_t when) {
2212+void TouchInputMapper::sync(std::chrono::nanoseconds when) {
2213 // Sync button state.
2214 mCurrentButtonState = mTouchButtonAccumulator.getButtonState()
2215 | mCursorButtonAccumulator.getButtonState();
2216@@ -3686,7 +3686,7 @@
2217 mCurrentRawHScroll = 0;
2218 }
2219
2220-void TouchInputMapper::timeoutExpired(nsecs_t when) {
2221+void TouchInputMapper::timeoutExpired(std::chrono::nanoseconds when) {
2222 if (mDeviceMode == DEVICE_MODE_POINTER) {
2223 if (mPointerUsage == POINTER_USAGE_GESTURES) {
2224 dispatchPointerGestures(when, 0 /*policyFlags*/, true /*isTimeout*/);
2225@@ -3694,7 +3694,7 @@
2226 }
2227 }
2228
2229-bool TouchInputMapper::consumeRawTouches(nsecs_t when, uint32_t policyFlags) {
2230+bool TouchInputMapper::consumeRawTouches(std::chrono::nanoseconds when, uint32_t policyFlags) {
2231 // Check for release of a virtual key.
2232 if (mCurrentVirtualKey.down) {
2233 if (mCurrentRawPointerData.touchingIds.isEmpty()) {
2234@@ -3787,17 +3787,17 @@
2235 // area and accidentally triggers a virtual key. This often happens when virtual keys
2236 // are layed out below the screen near to where the on screen keyboard's space bar
2237 // is displayed.
2238- if (mConfig.virtualKeyQuietTime > 0 && !mCurrentRawPointerData.touchingIds.isEmpty()) {
2239+ if (mConfig.virtualKeyQuietTime > std::chrono::nanoseconds(0) && !mCurrentRawPointerData.touchingIds.isEmpty()) {
2240 mContext->disableVirtualKeysUntil(when + mConfig.virtualKeyQuietTime);
2241 }
2242 return false;
2243 }
2244
2245-void TouchInputMapper::dispatchVirtualKey(nsecs_t when, uint32_t policyFlags,
2246+void TouchInputMapper::dispatchVirtualKey(std::chrono::nanoseconds when, uint32_t policyFlags,
2247 int32_t keyEventAction, int32_t keyEventFlags) {
2248 int32_t keyCode = mCurrentVirtualKey.keyCode;
2249 int32_t scanCode = mCurrentVirtualKey.scanCode;
2250- nsecs_t downTime = mCurrentVirtualKey.downTime;
2251+ std::chrono::nanoseconds downTime = mCurrentVirtualKey.downTime;
2252 int32_t metaState = mContext->getGlobalMetaState();
2253 policyFlags |= POLICY_FLAG_VIRTUAL;
2254
2255@@ -3806,7 +3806,7 @@
2256 getListener()->notifyKey(&args);
2257 }
2258
2259-void TouchInputMapper::dispatchTouches(nsecs_t when, uint32_t policyFlags) {
2260+void TouchInputMapper::dispatchTouches(std::chrono::nanoseconds when, uint32_t policyFlags) {
2261 IntSet &currentIds = mCurrentCookedPointerData.touchingIds;
2262 IntSet &lastIds = mLastCookedPointerData.touchingIds;
2263 int32_t metaState = getContext()->getGlobalMetaState();
2264@@ -3893,7 +3893,7 @@
2265 }
2266 }
2267
2268-void TouchInputMapper::dispatchHoverExit(nsecs_t when, uint32_t policyFlags) {
2269+void TouchInputMapper::dispatchHoverExit(std::chrono::nanoseconds when, uint32_t policyFlags) {
2270 if (mSentHoverEnter &&
2271 (mCurrentCookedPointerData.hoveringIds.isEmpty()
2272 || !mCurrentCookedPointerData.touchingIds.isEmpty())) {
2273@@ -3909,7 +3909,7 @@
2274 }
2275 }
2276
2277-void TouchInputMapper::dispatchHoverEnterAndMove(nsecs_t when, uint32_t policyFlags) {
2278+void TouchInputMapper::dispatchHoverEnterAndMove(std::chrono::nanoseconds when, uint32_t policyFlags) {
2279 if (mCurrentCookedPointerData.touchingIds.isEmpty()
2280 && !mCurrentCookedPointerData.hoveringIds.isEmpty()) {
2281 int32_t metaState = getContext()->getGlobalMetaState();
2282@@ -4135,7 +4135,7 @@
2283 }
2284 }
2285
2286-void TouchInputMapper::dispatchPointerUsage(nsecs_t when, uint32_t policyFlags,
2287+void TouchInputMapper::dispatchPointerUsage(std::chrono::nanoseconds when, uint32_t policyFlags,
2288 PointerUsage pointerUsage) {
2289 if (pointerUsage != mPointerUsage) {
2290 abortPointerUsage(when, policyFlags);
2291@@ -4157,7 +4157,7 @@
2292 }
2293 }
2294
2295-void TouchInputMapper::abortPointerUsage(nsecs_t when, uint32_t policyFlags) {
2296+void TouchInputMapper::abortPointerUsage(std::chrono::nanoseconds when, uint32_t policyFlags) {
2297 switch (mPointerUsage) {
2298 case POINTER_USAGE_GESTURES:
2299 abortPointerGestures(when, policyFlags);
2300@@ -4175,7 +4175,7 @@
2301 mPointerUsage = POINTER_USAGE_NONE;
2302 }
2303
2304-void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlags,
2305+void TouchInputMapper::dispatchPointerGestures(std::chrono::nanoseconds when, uint32_t policyFlags,
2306 bool isTimeout) {
2307 // Update current gesture coordinates.
2308 bool cancelPreviousGesture, finishPreviousGesture;
2309@@ -4376,7 +4376,7 @@
2310 }
2311 }
2312
2313-void TouchInputMapper::abortPointerGestures(nsecs_t when, uint32_t policyFlags) {
2314+void TouchInputMapper::abortPointerGestures(std::chrono::nanoseconds when, uint32_t policyFlags) {
2315 // Cancel previously dispatches pointers.
2316 if (!mPointerGesture.lastGestureIds.isEmpty()) {
2317 int32_t metaState = getContext()->getGlobalMetaState();
2318@@ -4400,7 +4400,7 @@
2319 }
2320 }
2321
2322-bool TouchInputMapper::preparePointerGestures(nsecs_t when,
2323+bool TouchInputMapper::preparePointerGestures(std::chrono::nanoseconds when,
2324 bool* outCancelPreviousGesture, bool* outFinishPreviousGesture, bool isTimeout) {
2325 *outCancelPreviousGesture = false;
2326 *outFinishPreviousGesture = false;
2327@@ -5148,7 +5148,7 @@
2328 return true;
2329 }
2330
2331-void TouchInputMapper::dispatchPointerStylus(nsecs_t when, uint32_t policyFlags) {
2332+void TouchInputMapper::dispatchPointerStylus(std::chrono::nanoseconds when, uint32_t policyFlags) {
2333 mPointerSimple.currentCoords.clear();
2334 mPointerSimple.currentProperties.clear();
2335
2336@@ -5178,11 +5178,11 @@
2337 dispatchPointerSimple(when, policyFlags, down, hovering);
2338 }
2339
2340-void TouchInputMapper::abortPointerStylus(nsecs_t when, uint32_t policyFlags) {
2341+void TouchInputMapper::abortPointerStylus(std::chrono::nanoseconds when, uint32_t policyFlags) {
2342 abortPointerSimple(when, policyFlags);
2343 }
2344
2345-void TouchInputMapper::dispatchPointerMouse(nsecs_t when, uint32_t policyFlags) {
2346+void TouchInputMapper::dispatchPointerMouse(std::chrono::nanoseconds when, uint32_t policyFlags) {
2347 mPointerSimple.currentCoords.clear();
2348 mPointerSimple.currentProperties.clear();
2349
2350@@ -5231,13 +5231,13 @@
2351 dispatchPointerSimple(when, policyFlags, down, hovering);
2352 }
2353
2354-void TouchInputMapper::abortPointerMouse(nsecs_t when, uint32_t policyFlags) {
2355+void TouchInputMapper::abortPointerMouse(std::chrono::nanoseconds when, uint32_t policyFlags) {
2356 abortPointerSimple(when, policyFlags);
2357
2358 mPointerVelocityControl.reset();
2359 }
2360
2361-void TouchInputMapper::dispatchPointerSimple(nsecs_t when, uint32_t policyFlags,
2362+void TouchInputMapper::dispatchPointerSimple(std::chrono::nanoseconds when, uint32_t policyFlags,
2363 bool down, bool hovering) {
2364 int32_t metaState = getContext()->getGlobalMetaState();
2365
2366@@ -5350,17 +5350,17 @@
2367 }
2368 }
2369
2370-void TouchInputMapper::abortPointerSimple(nsecs_t when, uint32_t policyFlags) {
2371+void TouchInputMapper::abortPointerSimple(std::chrono::nanoseconds when, uint32_t policyFlags) {
2372 mPointerSimple.currentCoords.clear();
2373 mPointerSimple.currentProperties.clear();
2374
2375 dispatchPointerSimple(when, policyFlags, false, false);
2376 }
2377
2378-void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source,
2379+void TouchInputMapper::dispatchMotion(std::chrono::nanoseconds when, uint32_t policyFlags, uint32_t source,
2380 int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags,
2381 const PointerProperties* properties, const PointerCoords* coords, uint32_t inPointerCount,
2382- int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime) {
2383+ int32_t changedId, float xPrecision, float yPrecision, std::chrono::nanoseconds downTime) {
2384 PointerCoords pointerCoords[MAX_POINTERS];
2385 PointerProperties pointerProperties[MAX_POINTERS];
2386 uint32_t pointerCount = 0;
2387@@ -5398,11 +5398,11 @@
2388 getListener()->notifyMotion(&args);
2389 }
2390
2391-void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source,
2392+void TouchInputMapper::dispatchMotion(std::chrono::nanoseconds when, uint32_t policyFlags, uint32_t source,
2393 int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags,
2394 const PointerProperties* properties, const PointerCoords* coords,
2395 uint32_t inPointerCount, const IntSet &idsToDispatch,
2396- int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime) {
2397+ int32_t changedId, float xPrecision, float yPrecision, std::chrono::nanoseconds downTime) {
2398 PointerCoords pointerCoords[MAX_POINTERS];
2399 PointerProperties pointerProperties[MAX_POINTERS];
2400 uint32_t pointerCount = 0;
2401@@ -5768,7 +5768,7 @@
2402 SingleTouchInputMapper::~SingleTouchInputMapper() {
2403 }
2404
2405-void SingleTouchInputMapper::reset(nsecs_t when) {
2406+void SingleTouchInputMapper::reset(std::chrono::nanoseconds when) {
2407 mSingleTouchMotionAccumulator.reset(getDevice());
2408
2409 TouchInputMapper::reset(when);
2410@@ -5780,7 +5780,7 @@
2411 mSingleTouchMotionAccumulator.process(rawEvent);
2412 }
2413
2414-void SingleTouchInputMapper::syncTouch(nsecs_t when, bool* outHavePointerIds) {
2415+void SingleTouchInputMapper::syncTouch(std::chrono::nanoseconds when, bool* outHavePointerIds) {
2416 if (mTouchButtonAccumulator.isToolActive()) {
2417 mCurrentRawPointerData.pointerCount = 1;
2418
2419@@ -5844,7 +5844,7 @@
2420 MultiTouchInputMapper::~MultiTouchInputMapper() {
2421 }
2422
2423-void MultiTouchInputMapper::reset(nsecs_t when) {
2424+void MultiTouchInputMapper::reset(std::chrono::nanoseconds when) {
2425 mMultiTouchMotionAccumulator.reset(getDevice());
2426
2427 mPointerIds.clear();
2428@@ -5858,7 +5858,7 @@
2429 mMultiTouchMotionAccumulator.process(rawEvent);
2430 }
2431
2432-void MultiTouchInputMapper::syncTouch(nsecs_t when, bool* outHavePointerIds) {
2433+void MultiTouchInputMapper::syncTouch(std::chrono::nanoseconds when, bool* outHavePointerIds) {
2434 size_t inCount = mMultiTouchMotionAccumulator.getSlotCount();
2435 size_t outCount = 0;
2436 IntSet newPointerIds;
2437@@ -6046,7 +6046,7 @@
2438 }
2439 }
2440
2441-void JoystickInputMapper::configure(nsecs_t when, const InputReaderConfiguration* config, uint32_t changes) {
2442+void JoystickInputMapper::configure(std::chrono::nanoseconds when, const InputReaderConfiguration* config, uint32_t changes) {
2443 InputMapper::configure(when, config, changes);
2444
2445 if (!changes) { // first time only
2446@@ -6181,7 +6181,7 @@
2447 }
2448 }
2449
2450-void JoystickInputMapper::reset(nsecs_t when) {
2451+void JoystickInputMapper::reset(std::chrono::nanoseconds when) {
2452 // Recenter all axes.
2453 size_t numAxes = mAxes.size();
2454 for (size_t i = 0; i < numAxes; i++) {
2455@@ -6240,7 +6240,7 @@
2456 }
2457 }
2458
2459-void JoystickInputMapper::sync(nsecs_t when, bool force) {
2460+void JoystickInputMapper::sync(std::chrono::nanoseconds when, bool force) {
2461 if (!filterAxes(force)) {
2462 return;
2463 }
2464@@ -6273,7 +6273,7 @@
2465
2466 NotifyMotionArgs args(when, getDeviceId(), AINPUT_SOURCE_JOYSTICK, policyFlags,
2467 AMOTION_EVENT_ACTION_MOVE, 0, metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE,
2468- 1, &pointerProperties, &pointerCoords, 0, 0, 0);
2469+ 1, &pointerProperties, &pointerCoords, 0, 0, std::chrono::nanoseconds(0));
2470 getListener()->notifyMotion(&args);
2471 }
2472
2473
2474=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputReader.h'
2475--- 3rd_party/android-input/android/frameworks/base/services/input/InputReader.h 2014-12-08 04:03:47 +0000
2476+++ 3rd_party/android-input/android/frameworks/base/services/input/InputReader.h 2015-02-09 23:59:09 +0000
2477@@ -86,7 +86,7 @@
2478 // Gets the amount of time to disable virtual keys after the screen is touched
2479 // in order to filter out accidental virtual key presses due to swiping gestures
2480 // or taps near the edge of the display. May be 0 to disable the feature.
2481- nsecs_t virtualKeyQuietTime;
2482+ std::chrono::nanoseconds virtualKeyQuietTime;
2483
2484 // The excluded device names for the platform.
2485 // Devices with these names will be ignored.
2486@@ -104,7 +104,7 @@
2487 // Quiet time between certain pointer gesture transitions.
2488 // Time to allow for all fingers or buttons to settle into a stable state before
2489 // starting a new gesture.
2490- nsecs_t pointerGestureQuietInterval;
2491+ std::chrono::nanoseconds pointerGestureQuietInterval;
2492
2493 // The minimum speed that a pointer must travel for us to consider switching the active
2494 // touch pointer to it during a drag. This threshold is set to avoid switching due
2495@@ -113,7 +113,7 @@
2496
2497 // Tap gesture delay time.
2498 // The time between down and up must be less than this to be considered a tap.
2499- nsecs_t pointerGestureTapInterval;
2500+ std::chrono::nanoseconds pointerGestureTapInterval;
2501
2502 // Tap drag gesture delay time.
2503 // The time between the previous tap's up and the next down must be less than
2504@@ -122,7 +122,7 @@
2505 //
2506 // Note that the previous tap will be held down for this entire duration so this
2507 // interval must be shorter than the long press timeout.
2508- nsecs_t pointerGestureTapDragInterval;
2509+ std::chrono::nanoseconds pointerGestureTapDragInterval;
2510
2511 // The distance in pixels that the pointer is allowed to move from initial down
2512 // to up and still be called a tap.
2513@@ -131,7 +131,7 @@
2514 // Time after the first touch points go down to settle on an initial centroid.
2515 // This is intended to be enough time to handle cases where the user puts down two
2516 // fingers at almost but not quite exactly the same time.
2517- nsecs_t pointerGestureMultitouchSettleInterval;
2518+ std::chrono::nanoseconds pointerGestureMultitouchSettleInterval;
2519
2520 // The transition from PRESS to SWIPE or FREEFORM gesture mode is made when
2521 // at least two pointers have moved at least this far from their starting place.
2522@@ -293,7 +293,7 @@
2523 virtual void requestRefreshConfiguration(uint32_t changes) = 0;
2524
2525 /* Controls the vibrator of a particular input device. */
2526- virtual void vibrate(int32_t deviceId, const nsecs_t* pattern, size_t patternSize,
2527+ virtual void vibrate(int32_t deviceId, const std::chrono::nanoseconds* pattern, size_t patternSize,
2528 ssize_t repeat, int32_t token) = 0;
2529 virtual void cancelVibrate(int32_t deviceId, int32_t token) = 0;
2530 };
2531@@ -310,13 +310,13 @@
2532 virtual void updateGlobalMetaState() = 0;
2533 virtual int32_t getGlobalMetaState() = 0;
2534
2535- virtual void disableVirtualKeysUntil(nsecs_t time) = 0;
2536- virtual bool shouldDropVirtualKey(nsecs_t now,
2537+ virtual void disableVirtualKeysUntil(std::chrono::nanoseconds time) = 0;
2538+ virtual bool shouldDropVirtualKey(std::chrono::nanoseconds now,
2539 InputDevice* device, int32_t keyCode, int32_t scanCode) = 0;
2540
2541 virtual void fadePointer() = 0;
2542
2543- virtual void requestTimeoutAtTime(nsecs_t when) = 0;
2544+ virtual void requestTimeoutAtTime(std::chrono::nanoseconds when) = 0;
2545 virtual int32_t bumpGeneration() = 0;
2546
2547 virtual InputReaderPolicyInterface* getPolicy() = 0;
2548@@ -362,7 +362,7 @@
2549
2550 virtual void requestRefreshConfiguration(uint32_t changes);
2551
2552- virtual void vibrate(int32_t deviceId, const nsecs_t* pattern, size_t patternSize,
2553+ virtual void vibrate(int32_t deviceId, const std::chrono::nanoseconds* pattern, size_t patternSize,
2554 ssize_t repeat, int32_t token);
2555 virtual void cancelVibrate(int32_t deviceId, int32_t token);
2556
2557@@ -379,11 +379,11 @@
2558
2559 virtual void updateGlobalMetaState();
2560 virtual int32_t getGlobalMetaState();
2561- virtual void disableVirtualKeysUntil(nsecs_t time);
2562- virtual bool shouldDropVirtualKey(nsecs_t now,
2563+ virtual void disableVirtualKeysUntil(std::chrono::nanoseconds time);
2564+ virtual bool shouldDropVirtualKey(std::chrono::nanoseconds now,
2565 InputDevice* device, int32_t keyCode, int32_t scanCode);
2566 virtual void fadePointer();
2567- virtual void requestTimeoutAtTime(nsecs_t when);
2568+ virtual void requestTimeoutAtTime(std::chrono::nanoseconds when);
2569 virtual int32_t bumpGeneration();
2570 virtual InputReaderPolicyInterface* getPolicy();
2571 virtual InputListenerInterface* getListener();
2572@@ -412,12 +412,12 @@
2573 // low-level input event decoding and device management
2574 void processEventsLocked(const RawEvent* rawEvents, size_t count);
2575
2576- void addDeviceLocked(nsecs_t when, int32_t deviceId);
2577- void removeDeviceLocked(nsecs_t when, int32_t deviceId);
2578+ void addDeviceLocked(std::chrono::nanoseconds when, int32_t deviceId);
2579+ void removeDeviceLocked(std::chrono::nanoseconds when, int32_t deviceId);
2580 void processEventsForDeviceLocked(int32_t deviceId, const RawEvent* rawEvents, size_t count);
2581- void timeoutExpiredLocked(nsecs_t when);
2582+ void timeoutExpiredLocked(std::chrono::nanoseconds when);
2583
2584- void handleConfigurationChangedLocked(nsecs_t when);
2585+ void handleConfigurationChangedLocked(std::chrono::nanoseconds when);
2586
2587 int32_t mGlobalMetaState;
2588 void updateGlobalMetaStateLocked();
2589@@ -430,13 +430,13 @@
2590
2591 void getInputDevicesLocked(Vector<InputDeviceInfo>& outInputDevices);
2592
2593- nsecs_t mDisableVirtualKeysTimeout;
2594- void disableVirtualKeysUntilLocked(nsecs_t time);
2595- bool shouldDropVirtualKeyLocked(nsecs_t now,
2596+ std::chrono::nanoseconds mDisableVirtualKeysTimeout;
2597+ void disableVirtualKeysUntilLocked(std::chrono::nanoseconds time);
2598+ bool shouldDropVirtualKeyLocked(std::chrono::nanoseconds now,
2599 InputDevice* device, int32_t keyCode, int32_t scanCode);
2600
2601- nsecs_t mNextTimeout;
2602- void requestTimeoutAtTimeLocked(nsecs_t when);
2603+ std::chrono::nanoseconds mNextTimeout;
2604+ void requestTimeoutAtTimeLocked(std::chrono::nanoseconds when);
2605
2606 uint32_t mConfigurationChangesToRefresh;
2607 void refreshConfigurationLocked(uint32_t changes);
2608@@ -485,10 +485,10 @@
2609
2610 void dump(String8& dump);
2611 void addMapper(InputMapper* mapper);
2612- void configure(nsecs_t when, InputReaderConfiguration const* config, uint32_t changes);
2613- void reset(nsecs_t when);
2614+ void configure(std::chrono::nanoseconds when, InputReaderConfiguration const* config, uint32_t changes);
2615+ void reset(std::chrono::nanoseconds when);
2616 void process(const RawEvent* rawEvents, size_t count);
2617- void timeoutExpired(nsecs_t when);
2618+ void timeoutExpired(std::chrono::nanoseconds when);
2619
2620 void getDeviceInfo(InputDeviceInfo* outDeviceInfo);
2621 int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
2622@@ -496,7 +496,7 @@
2623 int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode);
2624 bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes,
2625 const int32_t* keyCodes, uint8_t* outFlags);
2626- void vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat, int32_t token);
2627+ void vibrate(const std::chrono::nanoseconds* pattern, size_t patternSize, ssize_t repeat, int32_t token);
2628 void cancelVibrate(int32_t token);
2629
2630 int32_t getMetaState();
2631@@ -505,7 +505,7 @@
2632
2633 void bumpGeneration();
2634
2635- void notifyReset(nsecs_t when);
2636+ void notifyReset(std::chrono::nanoseconds when);
2637
2638 inline const PropertyMap& getConfiguration() { return mConfiguration; }
2639 inline EventHubInterface* getEventHub() { return mContext->getEventHub(); }
2640@@ -897,17 +897,17 @@
2641 virtual uint32_t getSources() = 0;
2642 virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
2643 virtual void dump(String8& dump);
2644- virtual void configure(nsecs_t when, InputReaderConfiguration const* config, uint32_t changes);
2645- virtual void reset(nsecs_t when);
2646+ virtual void configure(std::chrono::nanoseconds when, InputReaderConfiguration const* config, uint32_t changes);
2647+ virtual void reset(std::chrono::nanoseconds when);
2648 virtual void process(const RawEvent* rawEvent) = 0;
2649- virtual void timeoutExpired(nsecs_t when);
2650+ virtual void timeoutExpired(std::chrono::nanoseconds when);
2651
2652 virtual int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
2653 virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
2654 virtual int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode);
2655 virtual bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes,
2656 const int32_t* keyCodes, uint8_t* outFlags);
2657- virtual void vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
2658+ virtual void vibrate(const std::chrono::nanoseconds* pattern, size_t patternSize, ssize_t repeat,
2659 int32_t token);
2660 virtual void cancelVibrate(int32_t token);
2661
2662@@ -938,7 +938,7 @@
2663 virtual int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode);
2664
2665 private:
2666- void processSwitch(nsecs_t when, int32_t switchCode, int32_t switchValue);
2667+ void processSwitch(std::chrono::nanoseconds when, int32_t switchCode, int32_t switchValue);
2668 };
2669
2670
2671@@ -951,20 +951,20 @@
2672 virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
2673 virtual void process(const RawEvent* rawEvent);
2674
2675- virtual void vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
2676+ virtual void vibrate(const std::chrono::nanoseconds* pattern, size_t patternSize, ssize_t repeat,
2677 int32_t token);
2678 virtual void cancelVibrate(int32_t token);
2679- virtual void timeoutExpired(nsecs_t when);
2680+ virtual void timeoutExpired(std::chrono::nanoseconds when);
2681 virtual void dump(String8& dump);
2682
2683 private:
2684 bool mVibrating;
2685- nsecs_t mPattern[MAX_VIBRATE_PATTERN_SIZE];
2686+ std::chrono::nanoseconds mPattern[MAX_VIBRATE_PATTERN_SIZE];
2687 size_t mPatternSize;
2688 ssize_t mRepeat;
2689 int32_t mToken;
2690 ssize_t mIndex;
2691- nsecs_t mNextStepTime;
2692+ std::chrono::nanoseconds mNextStepTime;
2693
2694 void nextStep();
2695 void stopVibrating();
2696@@ -979,9 +979,9 @@
2697 virtual uint32_t getSources();
2698 virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
2699 virtual void dump(String8& dump);
2700- virtual void configure(nsecs_t when,
2701+ virtual void configure(std::chrono::nanoseconds when,
2702 InputReaderConfiguration const* config, uint32_t changes);
2703- virtual void reset(nsecs_t when);
2704+ virtual void reset(std::chrono::nanoseconds when);
2705 virtual void process(const RawEvent* rawEvent);
2706
2707 virtual int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
2708@@ -1004,7 +1004,7 @@
2709
2710 Vector<KeyDown> mKeyDowns; // keys that are down
2711 int32_t mMetaState;
2712- nsecs_t mDownTime; // time of most recent key down
2713+ std::chrono::nanoseconds mDownTime; // time of most recent key down
2714
2715 int32_t mCurrentHidUsage; // most recent HID usage seen this packet, or 0 if none
2716
2717@@ -1027,7 +1027,7 @@
2718
2719 bool isKeyboardOrGamepadKey(int32_t scanCode);
2720
2721- void processKey(nsecs_t when, bool down, int32_t keyCode, int32_t scanCode,
2722+ void processKey(std::chrono::nanoseconds when, bool down, int32_t keyCode, int32_t scanCode,
2723 uint32_t policyFlags);
2724
2725 ssize_t findKeyDown(int32_t scanCode);
2726@@ -1048,9 +1048,9 @@
2727 virtual uint32_t getSources();
2728 virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
2729 virtual void dump(String8& dump);
2730- virtual void configure(nsecs_t when,
2731+ virtual void configure(std::chrono::nanoseconds when,
2732 InputReaderConfiguration const* config, uint32_t changes);
2733- virtual void reset(nsecs_t when);
2734+ virtual void reset(std::chrono::nanoseconds when);
2735 virtual void process(const RawEvent* rawEvent);
2736
2737 virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
2738@@ -1097,12 +1097,12 @@
2739 sp<PointerControllerInterface> mPointerController;
2740
2741 int32_t mButtonState;
2742- nsecs_t mDownTime;
2743+ std::chrono::nanoseconds mDownTime;
2744
2745 void configureParameters();
2746 void dumpParameters(String8& dump);
2747
2748- void sync(nsecs_t when);
2749+ void sync(std::chrono::nanoseconds when);
2750 };
2751
2752
2753@@ -1114,9 +1114,9 @@
2754 virtual uint32_t getSources();
2755 virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
2756 virtual void dump(String8& dump);
2757- virtual void configure(nsecs_t when,
2758+ virtual void configure(std::chrono::nanoseconds when,
2759 InputReaderConfiguration const* config, uint32_t changes);
2760- virtual void reset(nsecs_t when);
2761+ virtual void reset(std::chrono::nanoseconds when);
2762 virtual void process(const RawEvent* rawEvent);
2763
2764 virtual int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
2765@@ -1125,7 +1125,7 @@
2766 const int32_t* keyCodes, uint8_t* outFlags);
2767
2768 virtual void fadePointer();
2769- virtual void timeoutExpired(nsecs_t when);
2770+ virtual void timeoutExpired(std::chrono::nanoseconds when);
2771
2772 protected:
2773 CursorButtonAccumulator mCursorButtonAccumulator;
2774@@ -1276,7 +1276,7 @@
2775 bool mSentHoverEnter;
2776
2777 // The time the primary pointer last went down.
2778- nsecs_t mDownTime;
2779+ std::chrono::nanoseconds mDownTime;
2780
2781 // The pointer controller, or null if the device is not a pointer.
2782 sp<PointerControllerInterface> mPointerController;
2783@@ -1287,7 +1287,7 @@
2784 virtual void dumpParameters(String8& dump);
2785 virtual void configureRawPointerAxes();
2786 virtual void dumpRawPointerAxes(String8& dump);
2787- virtual void configureSurface(nsecs_t when, bool* outResetNeeded);
2788+ virtual void configureSurface(std::chrono::nanoseconds when, bool* outResetNeeded);
2789 virtual void dumpSurface(String8& dump);
2790 virtual void configureVirtualKeys();
2791 virtual void dumpVirtualKeys(String8& dump);
2792@@ -1296,7 +1296,7 @@
2793 virtual void dumpCalibration(String8& dump);
2794 virtual bool hasStylus() const = 0;
2795
2796- virtual void syncTouch(nsecs_t when, bool* outHavePointerIds) = 0;
2797+ virtual void syncTouch(std::chrono::nanoseconds when, bool* outHavePointerIds) = 0;
2798 int32_t fetchNewPointerId();
2799
2800 private:
2801@@ -1383,7 +1383,7 @@
2802 struct CurrentVirtualKeyState {
2803 bool down;
2804 bool ignored;
2805- nsecs_t downTime;
2806+ std::chrono::nanoseconds downTime;
2807 int32_t keyCode;
2808 int32_t scanCode;
2809 } mCurrentVirtualKey;
2810@@ -1467,7 +1467,7 @@
2811 };
2812
2813 // Time the first finger went down.
2814- nsecs_t firstTouchTime;
2815+ std::chrono::nanoseconds firstTouchTime;
2816
2817 // The active pointer id from the raw touch data.
2818 int32_t activeTouchId; // -1 if none
2819@@ -1489,19 +1489,19 @@
2820 PointerCoords lastGestureCoords[MAX_POINTERS];
2821
2822 // Time the pointer gesture last went down.
2823- nsecs_t downTime;
2824+ std::chrono::nanoseconds downTime;
2825
2826 // Time when the pointer went down for a TAP.
2827- nsecs_t tapDownTime;
2828+ std::chrono::nanoseconds tapDownTime;
2829
2830 // Time when the pointer went up for a TAP.
2831- nsecs_t tapUpTime;
2832+ std::chrono::nanoseconds tapUpTime;
2833
2834 // Location of initial tap.
2835 float tapX, tapY;
2836
2837 // Time we started waiting for quiescence.
2838- nsecs_t quietTime;
2839+ std::chrono::nanoseconds quietTime;
2840
2841 // Reference points for multitouch gestures.
2842 float referenceTouchX; // reference touch X/Y coordinates in surface units
2843@@ -1524,26 +1524,26 @@
2844 VelocityTracker velocityTracker;
2845
2846 void reset() {
2847- firstTouchTime = LLONG_MIN;
2848+ firstTouchTime = std::chrono::nanoseconds(LLONG_MIN);
2849 activeTouchId = -1;
2850 activeGestureId = -1;
2851 currentGestureMode = NEUTRAL;
2852 currentGestureIds.clear();
2853 lastGestureMode = NEUTRAL;
2854 lastGestureIds.clear();
2855- downTime = 0;
2856+ downTime = std::chrono::nanoseconds(0);
2857 velocityTracker.clear();
2858 resetTap();
2859 resetQuietTime();
2860 }
2861
2862 void resetTap() {
2863- tapDownTime = LLONG_MIN;
2864- tapUpTime = LLONG_MIN;
2865+ tapDownTime = std::chrono::nanoseconds(LLONG_MIN);
2866+ tapUpTime = std::chrono::nanoseconds(LLONG_MIN);
2867 }
2868
2869 void resetQuietTime() {
2870- quietTime = LLONG_MIN;
2871+ quietTime = std::chrono::nanoseconds(LLONG_MIN);
2872 }
2873 } mPointerGesture;
2874
2875@@ -1560,7 +1560,7 @@
2876 bool hovering;
2877
2878 // Time the pointer last went down.
2879- nsecs_t downTime;
2880+ std::chrono::nanoseconds downTime;
2881
2882 void reset() {
2883 currentCoords.clear();
2884@@ -1569,7 +1569,7 @@
2885 lastProperties.clear();
2886 down = false;
2887 hovering = false;
2888- downTime = 0;
2889+ downTime = std::chrono::nanoseconds(0);
2890 }
2891 } mPointerSimple;
2892
2893@@ -1578,52 +1578,52 @@
2894 VelocityControl mWheelXVelocityControl;
2895 VelocityControl mWheelYVelocityControl;
2896
2897- void sync(nsecs_t when);
2898+ void sync(std::chrono::nanoseconds when);
2899
2900- bool consumeRawTouches(nsecs_t when, uint32_t policyFlags);
2901- void dispatchVirtualKey(nsecs_t when, uint32_t policyFlags,
2902+ bool consumeRawTouches(std::chrono::nanoseconds when, uint32_t policyFlags);
2903+ void dispatchVirtualKey(std::chrono::nanoseconds when, uint32_t policyFlags,
2904 int32_t keyEventAction, int32_t keyEventFlags);
2905
2906- void dispatchTouches(nsecs_t when, uint32_t policyFlags);
2907- void dispatchHoverExit(nsecs_t when, uint32_t policyFlags);
2908- void dispatchHoverEnterAndMove(nsecs_t when, uint32_t policyFlags);
2909+ void dispatchTouches(std::chrono::nanoseconds when, uint32_t policyFlags);
2910+ void dispatchHoverExit(std::chrono::nanoseconds when, uint32_t policyFlags);
2911+ void dispatchHoverEnterAndMove(std::chrono::nanoseconds when, uint32_t policyFlags);
2912 void cookPointerData();
2913
2914- void dispatchPointerUsage(nsecs_t when, uint32_t policyFlags, PointerUsage pointerUsage);
2915- void abortPointerUsage(nsecs_t when, uint32_t policyFlags);
2916+ void dispatchPointerUsage(std::chrono::nanoseconds when, uint32_t policyFlags, PointerUsage pointerUsage);
2917+ void abortPointerUsage(std::chrono::nanoseconds when, uint32_t policyFlags);
2918
2919- void dispatchPointerGestures(nsecs_t when, uint32_t policyFlags, bool isTimeout);
2920- void abortPointerGestures(nsecs_t when, uint32_t policyFlags);
2921- bool preparePointerGestures(nsecs_t when,
2922+ void dispatchPointerGestures(std::chrono::nanoseconds when, uint32_t policyFlags, bool isTimeout);
2923+ void abortPointerGestures(std::chrono::nanoseconds when, uint32_t policyFlags);
2924+ bool preparePointerGestures(std::chrono::nanoseconds when,
2925 bool* outCancelPreviousGesture, bool* outFinishPreviousGesture,
2926 bool isTimeout);
2927
2928- void dispatchPointerStylus(nsecs_t when, uint32_t policyFlags);
2929- void abortPointerStylus(nsecs_t when, uint32_t policyFlags);
2930-
2931- void dispatchPointerMouse(nsecs_t when, uint32_t policyFlags);
2932- void abortPointerMouse(nsecs_t when, uint32_t policyFlags);
2933-
2934- void dispatchPointerSimple(nsecs_t when, uint32_t policyFlags,
2935+ void dispatchPointerStylus(std::chrono::nanoseconds when, uint32_t policyFlags);
2936+ void abortPointerStylus(std::chrono::nanoseconds when, uint32_t policyFlags);
2937+
2938+ void dispatchPointerMouse(std::chrono::nanoseconds when, uint32_t policyFlags);
2939+ void abortPointerMouse(std::chrono::nanoseconds when, uint32_t policyFlags);
2940+
2941+ void dispatchPointerSimple(std::chrono::nanoseconds when, uint32_t policyFlags,
2942 bool down, bool hovering);
2943- void abortPointerSimple(nsecs_t when, uint32_t policyFlags);
2944+ void abortPointerSimple(std::chrono::nanoseconds when, uint32_t policyFlags);
2945
2946 // Dispatches a motion event.
2947 // If the changedId is >= 0 and the action is POINTER_DOWN or POINTER_UP, the
2948 // method will take care of setting the index and transmuting the action to DOWN or UP
2949 // it is the first / last pointer to go down / up.
2950- void dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source,
2951+ void dispatchMotion(std::chrono::nanoseconds when, uint32_t policyFlags, uint32_t source,
2952 int32_t action, int32_t flags, int32_t metaState, int32_t buttonState,
2953 int32_t edgeFlags,
2954 const PointerProperties* properties, const PointerCoords* coords,
2955 uint32_t inPointerCount,
2956- int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime);
2957- void dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source,
2958+ int32_t changedId, float xPrecision, float yPrecision, std::chrono::nanoseconds downTime);
2959+ void dispatchMotion(std::chrono::nanoseconds when, uint32_t policyFlags, uint32_t source,
2960 int32_t action, int32_t flags, int32_t metaState, int32_t buttonState,
2961 int32_t edgeFlags,
2962 const PointerProperties* properties, const PointerCoords* coords,
2963 uint32_t inPointerCount, const IntSet &idsToDispatch,
2964- int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime);
2965+ int32_t changedId, float xPrecision, float yPrecision, std::chrono::nanoseconds downTime);
2966
2967 // Updates pointer coords and properties for pointers that have moved.
2968 // Returns true if any of them changed.
2969@@ -1644,11 +1644,11 @@
2970 SingleTouchInputMapper(InputDevice* device);
2971 virtual ~SingleTouchInputMapper();
2972
2973- virtual void reset(nsecs_t when);
2974+ virtual void reset(std::chrono::nanoseconds when);
2975 virtual void process(const RawEvent* rawEvent);
2976
2977 protected:
2978- virtual void syncTouch(nsecs_t when, bool* outHavePointerIds);
2979+ virtual void syncTouch(std::chrono::nanoseconds when, bool* outHavePointerIds);
2980 virtual void configureRawPointerAxes();
2981 virtual bool hasStylus() const;
2982
2983@@ -1662,11 +1662,11 @@
2984 MultiTouchInputMapper(InputDevice* device);
2985 virtual ~MultiTouchInputMapper();
2986
2987- virtual void reset(nsecs_t when);
2988+ virtual void reset(std::chrono::nanoseconds when);
2989 virtual void process(const RawEvent* rawEvent);
2990
2991 protected:
2992- virtual void syncTouch(nsecs_t when, bool* outHavePointerIds);
2993+ virtual void syncTouch(std::chrono::nanoseconds when, bool* outHavePointerIds);
2994 virtual void configureRawPointerAxes();
2995 virtual bool hasStylus() const;
2996
2997@@ -1687,9 +1687,9 @@
2998 virtual uint32_t getSources();
2999 virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
3000 virtual void dump(String8& dump);
3001- virtual void configure(nsecs_t when,
3002+ virtual void configure(std::chrono::nanoseconds when,
3003 InputReaderConfiguration const* config, uint32_t changes);
3004- virtual void reset(nsecs_t when);
3005+ virtual void reset(std::chrono::nanoseconds when);
3006 virtual void process(const RawEvent* rawEvent);
3007
3008 private:
3009@@ -1745,7 +1745,7 @@
3010 // Axes indexed by raw ABS_* axis index.
3011 KeyedVector<int32_t, Axis> mAxes;
3012
3013- void sync(nsecs_t when, bool force);
3014+ void sync(std::chrono::nanoseconds when, bool force);
3015
3016 bool haveAxis(int32_t axisId);
3017 void pruneAxes(bool ignoreExplicitlyMappedAxes);
3018
3019=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp'
3020--- 3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp 2014-03-06 06:05:17 +0000
3021+++ 3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp 2015-02-09 23:59:09 +0000
3022@@ -39,18 +39,18 @@
3023 static const size_t SOCKET_BUFFER_SIZE = 32 * 1024;
3024
3025 // Nanoseconds per milliseconds.
3026-static const nsecs_t NANOS_PER_MS = 1000000;
3027+static constexpr const std::chrono::nanoseconds NANOS_PER_MS = std::chrono::nanoseconds(1000000);
3028
3029 // Latency added during resampling. A few milliseconds doesn't hurt much but
3030 // reduces the impact of mispredicted touch positions.
3031-static const nsecs_t RESAMPLE_LATENCY = 5 * NANOS_PER_MS;
3032+static constexpr const std::chrono::nanoseconds RESAMPLE_LATENCY = std::chrono::nanoseconds(5 * NANOS_PER_MS);
3033
3034 // Minimum time difference between consecutive samples before attempting to resample.
3035-static const nsecs_t RESAMPLE_MIN_DELTA = 2 * NANOS_PER_MS;
3036+static constexpr const std::chrono::nanoseconds RESAMPLE_MIN_DELTA = std::chrono::nanoseconds(2 * NANOS_PER_MS);
3037
3038 // Maximum time to predict forward from the last known state, to avoid predicting too
3039 // far into the future. This time is further bounded by 50% of the last time delta.
3040-static const nsecs_t RESAMPLE_MAX_PREDICTION = 8 * NANOS_PER_MS;
3041+static constexpr const std::chrono::nanoseconds RESAMPLE_MAX_PREDICTION = std::chrono::nanoseconds(8 * NANOS_PER_MS);
3042
3043 template<typename T>
3044 inline static T min(const T& a, const T& b) {
3045@@ -236,8 +236,8 @@
3046 int32_t scanCode,
3047 int32_t metaState,
3048 int32_t repeatCount,
3049- nsecs_t downTime,
3050- nsecs_t eventTime) {
3051+ std::chrono::nanoseconds downTime,
3052+ std::chrono::nanoseconds eventTime) {
3053 #if DEBUG_TRANSPORT_ACTIONS
3054 ALOGD("channel '%s' publisher ~ publishKeyEvent: seq=%u, deviceId=%d, source=0x%x, "
3055 "action=0x%x, flags=0x%x, keyCode=%d, scanCode=%d, metaState=0x%x, repeatCount=%d,"
3056@@ -263,8 +263,8 @@
3057 msg.body.key.scanCode = scanCode;
3058 msg.body.key.metaState = metaState;
3059 msg.body.key.repeatCount = repeatCount;
3060- msg.body.key.downTime = downTime;
3061- msg.body.key.eventTime = eventTime;
3062+ msg.body.key.downTime = downTime.count();
3063+ msg.body.key.eventTime = eventTime.count();
3064 return mChannel->sendMessage(&msg);
3065 }
3066
3067@@ -281,8 +281,8 @@
3068 float yOffset,
3069 float xPrecision,
3070 float yPrecision,
3071- nsecs_t downTime,
3072- nsecs_t eventTime,
3073+ std::chrono::nanoseconds downTime,
3074+ std::chrono::nanoseconds eventTime,
3075 size_t pointerCount,
3076 const PointerProperties* pointerProperties,
3077 const PointerCoords* pointerCoords) {
3078@@ -322,8 +322,8 @@
3079 msg.body.motion.yOffset = yOffset;
3080 msg.body.motion.xPrecision = xPrecision;
3081 msg.body.motion.yPrecision = yPrecision;
3082- msg.body.motion.downTime = downTime;
3083- msg.body.motion.eventTime = eventTime;
3084+ msg.body.motion.downTime = downTime.count();
3085+ msg.body.motion.eventTime = eventTime.count();
3086 msg.body.motion.pointerCount = pointerCount;
3087 for (size_t i = 0; i < pointerCount; i++) {
3088 msg.body.motion.pointers[i].properties.copyFrom(pointerProperties[i]);
3089@@ -381,7 +381,7 @@
3090 }
3091
3092 status_t InputConsumer::consume(InputEventFactoryInterface* factory,
3093- bool consumeBatches, nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent) {
3094+ bool consumeBatches, std::chrono::nanoseconds frameTime, uint32_t* outSeq, InputEvent** outEvent) {
3095 #if DEBUG_TRANSPORT_ACTIONS
3096 ALOGD("channel '%s' consumer ~ consume: consumeBatches=%s, frameTime=%lld",
3097 c_str(mChannel->getName()), consumeBatches ? "true" : "false", frameTime);
3098@@ -498,18 +498,18 @@
3099 }
3100
3101 status_t InputConsumer::consumeBatch(InputEventFactoryInterface* factory,
3102- nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent) {
3103+ std::chrono::nanoseconds frameTime, uint32_t* outSeq, InputEvent** outEvent) {
3104 status_t result;
3105 for (size_t i = mBatches.size(); i-- > 0; ) {
3106 Batch& batch = mBatches.editItemAt(i);
3107- if (frameTime < 0) {
3108+ if (frameTime < std::chrono::nanoseconds(0)) {
3109 result = consumeSamples(factory, batch, batch.samples.size(),
3110 outSeq, outEvent);
3111 mBatches.removeAt(i);
3112 return result;
3113 }
3114
3115- nsecs_t sampleTime = frameTime - RESAMPLE_LATENCY;
3116+ std::chrono::nanoseconds sampleTime = frameTime - RESAMPLE_LATENCY;
3117 ssize_t split = findSampleNoLaterThan(batch, sampleTime);
3118 if (split < 0) {
3119 continue;
3120@@ -567,7 +567,7 @@
3121
3122 int32_t deviceId = msg->body.motion.deviceId;
3123 int32_t source = msg->body.motion.source;
3124- nsecs_t eventTime = msg->body.motion.eventTime;
3125+ std::chrono::nanoseconds eventTime = std::chrono::nanoseconds(msg->body.motion.eventTime);
3126
3127 // Update the touch state history to incorporate the new input message.
3128 // If the message is in the past relative to the most recently produced resampled
3129@@ -660,7 +660,7 @@
3130 }
3131 }
3132
3133-void InputConsumer::resampleTouchState(nsecs_t sampleTime, MotionEvent* event,
3134+void InputConsumer::resampleTouchState(std::chrono::nanoseconds sampleTime, MotionEvent* event,
3135 const InputMessage* next) {
3136 if (!mResampleTouch
3137 || !(event->getSource() & AINPUT_SOURCE_CLASS_POINTER)
3138@@ -706,26 +706,26 @@
3139 // So current->eventTime <= sampleTime <= future.eventTime.
3140 future.initializeFrom(next);
3141 other = &future;
3142- nsecs_t delta = future.eventTime - current->eventTime;
3143+ std::chrono::nanoseconds delta = future.eventTime - current->eventTime;
3144 if (delta < RESAMPLE_MIN_DELTA) {
3145 #if DEBUG_RESAMPLING
3146 ALOGD("Not resampled, delta time is %lld ns.", delta);
3147 #endif
3148 return;
3149 }
3150- alpha = float(sampleTime - current->eventTime) / delta;
3151+ alpha = (float)((sampleTime - current->eventTime).count()) / delta.count();
3152 } else if (touchState.historySize >= 2) {
3153 // Extrapolate future sample using current sample and past sample.
3154 // So other->eventTime <= current->eventTime <= sampleTime.
3155 other = touchState.getHistory(1);
3156- nsecs_t delta = current->eventTime - other->eventTime;
3157+ std::chrono::nanoseconds delta = current->eventTime - other->eventTime;
3158 if (delta < RESAMPLE_MIN_DELTA) {
3159 #if DEBUG_RESAMPLING
3160 ALOGD("Not resampled, delta time is %lld ns.", delta);
3161 #endif
3162 return;
3163 }
3164- nsecs_t maxPredict = current->eventTime + min(delta / 2, RESAMPLE_MAX_PREDICTION);
3165+ std::chrono::nanoseconds maxPredict = current->eventTime + std::chrono::nanoseconds(min(delta.count()/2, RESAMPLE_MAX_PREDICTION.count()));
3166 if (sampleTime > maxPredict) {
3167 #if DEBUG_RESAMPLING
3168 ALOGD("Sample time is too far in the future, adjusting prediction "
3169@@ -734,7 +734,7 @@
3170 #endif
3171 sampleTime = maxPredict;
3172 }
3173- alpha = float(current->eventTime - sampleTime) / delta;
3174+ alpha = (float)((current->eventTime - sampleTime).count()) / delta.count();
3175 } else {
3176 #if DEBUG_RESAMPLING
3177 ALOGD("Not resampled, insufficient data.");
3178@@ -877,8 +877,8 @@
3179 msg->body.key.scanCode,
3180 msg->body.key.metaState,
3181 msg->body.key.repeatCount,
3182- msg->body.key.downTime,
3183- msg->body.key.eventTime);
3184+ std::chrono::nanoseconds(msg->body.key.downTime),
3185+ std::chrono::nanoseconds(msg->body.key.eventTime));
3186 }
3187
3188 void InputConsumer::initializeMotionEvent(MotionEvent* event, const InputMessage* msg) {
3189@@ -902,8 +902,8 @@
3190 msg->body.motion.yOffset,
3191 msg->body.motion.xPrecision,
3192 msg->body.motion.yPrecision,
3193- msg->body.motion.downTime,
3194- msg->body.motion.eventTime,
3195+ std::chrono::nanoseconds(msg->body.motion.downTime),
3196+ std::chrono::nanoseconds(msg->body.motion.eventTime),
3197 pointerCount,
3198 pointerProperties,
3199 pointerCoords);
3200@@ -917,7 +917,7 @@
3201 }
3202
3203 event->setMetaState(event->getMetaState() | msg->body.motion.metaState);
3204- event->addSample(msg->body.motion.eventTime, pointerCoords);
3205+ event->addSample(std::chrono::nanoseconds(msg->body.motion.eventTime), pointerCoords);
3206 }
3207
3208 bool InputConsumer::canAddSample(const Batch& batch, const InputMessage *msg) {
3209@@ -936,11 +936,11 @@
3210 return true;
3211 }
3212
3213-ssize_t InputConsumer::findSampleNoLaterThan(const Batch& batch, nsecs_t time) {
3214+ssize_t InputConsumer::findSampleNoLaterThan(const Batch& batch, std::chrono::nanoseconds time) {
3215 size_t numSamples = batch.samples.size();
3216 size_t index = 0;
3217 while (index < numSamples
3218- && batch.samples.itemAt(index).body.motion.eventTime <= time) {
3219+ && batch.samples.itemAt(index).body.motion.eventTime <= time.count()) {
3220 index += 1;
3221 }
3222 return ssize_t(index) - 1;
3223
3224=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputWindow.h'
3225--- 3rd_party/android-input/android/frameworks/base/services/input/InputWindow.h 2013-06-28 17:59:49 +0000
3226+++ 3rd_party/android-input/android/frameworks/base/services/input/InputWindow.h 2015-02-09 23:59:09 +0000
3227@@ -115,7 +115,7 @@
3228 String8 name;
3229 int32_t layoutParamsFlags;
3230 int32_t layoutParamsType;
3231- nsecs_t dispatchingTimeout;
3232+ std::chrono::nanoseconds dispatchingTimeout;
3233 int32_t frameLeft;
3234 int32_t frameTop;
3235 int32_t frameRight;
3236@@ -174,7 +174,7 @@
3237 return mInfo ? mInfo->name : String8("<invalid>");
3238 }
3239
3240- inline nsecs_t getDispatchingTimeout(nsecs_t defaultValue) const {
3241+ inline std::chrono::nanoseconds getDispatchingTimeout(std::chrono::nanoseconds defaultValue) const {
3242 return mInfo ? mInfo->dispatchingTimeout : defaultValue;
3243 }
3244
3245
3246=== modified file '3rd_party/android-input/android/frameworks/base/services/input/KeyCharacterMap.cpp'
3247--- 3rd_party/android-input/android/frameworks/base/services/input/KeyCharacterMap.cpp 2013-05-03 16:38:07 +0000
3248+++ 3rd_party/android-input/android/frameworks/base/services/input/KeyCharacterMap.cpp 2015-02-09 23:59:09 +0000
3249@@ -141,12 +141,12 @@
3250 status = NO_MEMORY;
3251 } else {
3252 #if DEBUG_PARSER_PERFORMANCE
3253- nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC);
3254+ std::chrono::nanoseconds startTime = systemTime(SYSTEM_TIME_MONOTONIC);
3255 #endif
3256 Parser parser(map.get(), tokenizer, format);
3257 status = parser.parse();
3258 #if DEBUG_PARSER_PERFORMANCE
3259- nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
3260+ std::chrono::nanoseconds elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
3261 ALOGD("Parsed key character map file '%s' %d lines in %0.3fms.",
3262 c_str(tokenizer->getFilename()), tokenizer->getLineNumber(),
3263 elapsedTime / 1000000.0);
3264@@ -294,7 +294,7 @@
3265
3266 bool KeyCharacterMap::getEvents(int32_t deviceId, const char16_t* chars, size_t numChars,
3267 Vector<KeyEvent>& outEvents) const {
3268- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
3269+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
3270
3271 for (size_t i = 0; i < numChars; i++) {
3272 int32_t keyCode, metaState;
3273@@ -439,7 +439,7 @@
3274 }
3275
3276 void KeyCharacterMap::addKey(Vector<KeyEvent>& outEvents,
3277- int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, nsecs_t time) {
3278+ int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, std::chrono::nanoseconds time) {
3279 outEvents.push();
3280 KeyEvent& event = outEvents.editTop();
3281 event.initialize(deviceId, AINPUT_SOURCE_KEYBOARD,
3282@@ -448,7 +448,7 @@
3283 }
3284
3285 void KeyCharacterMap::addMetaKeys(Vector<KeyEvent>& outEvents,
3286- int32_t deviceId, int32_t metaState, bool down, nsecs_t time,
3287+ int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
3288 int32_t* currentMetaState) {
3289 // Add and remove meta keys symmetrically.
3290 if (down) {
3291@@ -513,7 +513,7 @@
3292 }
3293
3294 bool KeyCharacterMap::addSingleEphemeralMetaKey(Vector<KeyEvent>& outEvents,
3295- int32_t deviceId, int32_t metaState, bool down, nsecs_t time,
3296+ int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
3297 int32_t keyCode, int32_t keyMetaState,
3298 int32_t* currentMetaState) {
3299 if ((metaState & keyMetaState) == keyMetaState) {
3300@@ -525,7 +525,7 @@
3301 }
3302
3303 void KeyCharacterMap::addDoubleEphemeralMetaKey(Vector<KeyEvent>& outEvents,
3304- int32_t deviceId, int32_t metaState, bool down, nsecs_t time,
3305+ int32_t deviceId, int32_t metaState, bool down, std::chrono::nanoseconds time,
3306 int32_t leftKeyCode, int32_t leftKeyMetaState,
3307 int32_t rightKeyCode, int32_t rightKeyMetaState,
3308 int32_t eitherKeyMetaState,
3309@@ -543,7 +543,7 @@
3310 }
3311
3312 void KeyCharacterMap::addLockedMetaKey(Vector<KeyEvent>& outEvents,
3313- int32_t deviceId, int32_t metaState, nsecs_t time,
3314+ int32_t deviceId, int32_t metaState, std::chrono::nanoseconds time,
3315 int32_t keyCode, int32_t keyMetaState,
3316 int32_t* currentMetaState) {
3317 if ((metaState & keyMetaState) == keyMetaState) {
3318
3319=== modified file '3rd_party/android-input/android/frameworks/base/services/input/KeyLayoutMap.cpp'
3320--- 3rd_party/android-input/android/frameworks/base/services/input/KeyLayoutMap.cpp 2013-05-03 16:38:07 +0000
3321+++ 3rd_party/android-input/android/frameworks/base/services/input/KeyLayoutMap.cpp 2015-02-09 23:59:09 +0000
3322@@ -57,12 +57,12 @@
3323 status = NO_MEMORY;
3324 } else {
3325 #if DEBUG_PARSER_PERFORMANCE
3326- nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC);
3327+ std::chrono::nanoseconds startTime = systemTime(SYSTEM_TIME_MONOTONIC);
3328 #endif
3329 Parser parser(map.get(), tokenizer);
3330 status = parser.parse();
3331 #if DEBUG_PARSER_PERFORMANCE
3332- nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
3333+ std::chrono::nanoseconds elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
3334 ALOGD("Parsed key layout map file '%s' %d lines in %0.3fms.",
3335 tokenizer->getFilename().string(), tokenizer->getLineNumber(),
3336 elapsedTime / 1000000.0);
3337
3338=== modified file '3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp'
3339--- 3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp 2014-03-06 06:05:17 +0000
3340+++ 3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp 2015-02-09 23:59:09 +0000
3341@@ -30,7 +30,7 @@
3342
3343 // --- VelocityControl ---
3344
3345-const nsecs_t VelocityControl::STOP_TIME;
3346+const constexpr std::chrono::nanoseconds VelocityControl::STOP_TIME;
3347
3348 VelocityControl::VelocityControl() {
3349 reset();
3350@@ -43,13 +43,13 @@
3351 }
3352
3353 void VelocityControl::reset() {
3354- mLastMovementTime = LLONG_MIN;
3355+ mLastMovementTime = std::chrono::nanoseconds(LLONG_MIN);
3356 mRawPosition.x = 0;
3357 mRawPosition.y = 0;
3358 mVelocityTracker.clear();
3359 }
3360
3361-void VelocityControl::move(nsecs_t eventTime, float* deltaX, float* deltaY) {
3362+void VelocityControl::move(std::chrono::nanoseconds eventTime, float* deltaX, float* deltaY) {
3363 if ((deltaX && *deltaX) || (deltaY && *deltaY)) {
3364 if (eventTime >= mLastMovementTime + STOP_TIME) {
3365 #if DEBUG_ACCELERATION
3366
3367=== modified file '3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp'
3368--- 3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp 2014-03-06 06:05:17 +0000
3369+++ 3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp 2015-02-09 23:59:09 +0000
3370@@ -37,13 +37,13 @@
3371 namespace android {
3372
3373 // Nanoseconds per milliseconds.
3374-static const nsecs_t NANOS_PER_MS = 1000000;
3375+static const int64_t NANOS_PER_MS = 1000000;
3376
3377 // Threshold for determining that a pointer has stopped moving.
3378 // Some input devices do not send ACTION_MOVE events in the case where a pointer has
3379 // stopped. We need to detect this case so that we can accurately predict the
3380 // velocity after the pointer starts moving again.
3381-static const nsecs_t ASSUME_POINTER_STOPPED_TIME = 40 * NANOS_PER_MS;
3382+static constexpr const std::chrono::nanoseconds ASSUME_POINTER_STOPPED_TIME = std::chrono::nanoseconds(40 * NANOS_PER_MS);
3383
3384
3385 static float vectorDot(const float* a, const float* b, uint32_t m) {
3386@@ -218,7 +218,7 @@
3387 mStrategy->clearPointers(ids);
3388 }
3389
3390-void VelocityTracker::addMovement(nsecs_t eventTime, const IntSet &ids, const Position* positions) {
3391+void VelocityTracker::addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids, const Position* positions) {
3392 if (!(mCurrentPointerIds & ids).isEmpty()
3393 && eventTime >= mLastEventTime + ASSUME_POINTER_STOPPED_TIME) {
3394 #if DEBUG_VELOCITY
3395@@ -305,7 +305,7 @@
3396 pointerIndex[i] = ids.indexOf(event->getPointerId(i));
3397 }
3398
3399- nsecs_t eventTime;
3400+ std::chrono::nanoseconds eventTime;
3401 Position positions[pointerCount];
3402
3403 size_t historySize = event->getHistorySize();
3404@@ -347,7 +347,7 @@
3405
3406 // --- LeastSquaresVelocityTrackerStrategy ---
3407
3408-const nsecs_t LeastSquaresVelocityTrackerStrategy::HORIZON;
3409+constexpr const std::chrono::nanoseconds LeastSquaresVelocityTrackerStrategy::HORIZON;
3410 const uint32_t LeastSquaresVelocityTrackerStrategy::HISTORY_SIZE;
3411
3412 LeastSquaresVelocityTrackerStrategy::LeastSquaresVelocityTrackerStrategy(
3413@@ -368,7 +368,7 @@
3414 mMovements[mIndex].ids.remove(ids);
3415 }
3416
3417-void LeastSquaresVelocityTrackerStrategy::addMovement(nsecs_t eventTime, const IntSet &ids,
3418+void LeastSquaresVelocityTrackerStrategy::addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
3419 const VelocityTracker::Position* positions) {
3420 if (++mIndex == HISTORY_SIZE) {
3421 mIndex = 0;
3422@@ -567,7 +567,7 @@
3423 break;
3424 }
3425
3426- nsecs_t age = newestMovement.eventTime - movement.eventTime;
3427+ std::chrono::nanoseconds age = newestMovement.eventTime - movement.eventTime;
3428 if (age > HORIZON) {
3429 break;
3430 }
3431@@ -576,7 +576,7 @@
3432 x[m] = position.x;
3433 y[m] = position.y;
3434 w[m] = chooseWeight(index);
3435- time[m] = -age * 0.000000001f;
3436+ time[m] = -age.count() * 0.000000001f;
3437 index = (index == 0 ? HISTORY_SIZE : index) - 1;
3438 } while (++m < HISTORY_SIZE);
3439
3440@@ -628,7 +628,7 @@
3441 return 1.0f;
3442 }
3443 uint32_t nextIndex = (index + 1) % HISTORY_SIZE;
3444- float deltaMillis = (mMovements[nextIndex].eventTime- mMovements[index].eventTime)
3445+ float deltaMillis = (mMovements[nextIndex].eventTime- mMovements[index].eventTime).count()
3446 * 0.000001f;
3447 if (deltaMillis < 0) {
3448 return 0.5f;
3449@@ -645,7 +645,7 @@
3450 // age 10ms: 1.0
3451 // age 50ms: 1.0
3452 // age 60ms: 0.5
3453- float ageMillis = (mMovements[mIndex].eventTime - mMovements[index].eventTime)
3454+ float ageMillis = (mMovements[mIndex].eventTime - mMovements[index].eventTime).count()
3455 * 0.000001f;
3456 if (ageMillis < 0) {
3457 return 0.5f;
3458@@ -667,7 +667,7 @@
3459 // age 0ms: 1.0
3460 // age 50ms: 1.0
3461 // age 100ms: 0.5
3462- float ageMillis = (mMovements[mIndex].eventTime - mMovements[index].eventTime)
3463+ float ageMillis = (mMovements[mIndex].eventTime - mMovements[index].eventTime).count()
3464 * 0.000001f;
3465 if (ageMillis < 50) {
3466 return 1.0f;
3467@@ -702,7 +702,7 @@
3468 mPointerIds.remove(ids);
3469 }
3470
3471-void IntegratingVelocityTrackerStrategy::addMovement(nsecs_t eventTime, const IntSet &ids,
3472+void IntegratingVelocityTrackerStrategy::addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
3473 const VelocityTracker::Position* positions) {
3474
3475 {
3476@@ -741,7 +741,7 @@
3477 }
3478
3479 void IntegratingVelocityTrackerStrategy::initState(State& state,
3480- nsecs_t eventTime, float xpos, float ypos) const {
3481+ std::chrono::nanoseconds eventTime, float xpos, float ypos) const {
3482 state.updateTime = eventTime;
3483 state.degree = 0;
3484
3485@@ -754,15 +754,15 @@
3486 }
3487
3488 void IntegratingVelocityTrackerStrategy::updateState(State& state,
3489- nsecs_t eventTime, float xpos, float ypos) const {
3490- const nsecs_t MIN_TIME_DELTA = 2 * NANOS_PER_MS;
3491+ std::chrono::nanoseconds eventTime, float xpos, float ypos) const {
3492+ const std::chrono::nanoseconds MIN_TIME_DELTA = std::chrono::nanoseconds(2 * NANOS_PER_MS);
3493 const float FILTER_TIME_CONSTANT = 0.010f; // 10 milliseconds
3494
3495 if (eventTime <= state.updateTime + MIN_TIME_DELTA) {
3496 return;
3497 }
3498
3499- float dt = (eventTime - state.updateTime) * 0.000000001f;
3500+ float dt = (eventTime - state.updateTime).count() * 0.000000001f;
3501 state.updateTime = eventTime;
3502
3503 float xvel = (xpos - state.xpos) / dt;
3504@@ -811,9 +811,9 @@
3505
3506 // --- LegacyVelocityTrackerStrategy ---
3507
3508-const nsecs_t LegacyVelocityTrackerStrategy::HORIZON;
3509+constexpr const std::chrono::nanoseconds LegacyVelocityTrackerStrategy::HORIZON;
3510 const uint32_t LegacyVelocityTrackerStrategy::HISTORY_SIZE;
3511-const nsecs_t LegacyVelocityTrackerStrategy::MIN_DURATION;
3512+constexpr const std::chrono::nanoseconds LegacyVelocityTrackerStrategy::MIN_DURATION;
3513
3514 LegacyVelocityTrackerStrategy::LegacyVelocityTrackerStrategy() {
3515 clear();
3516@@ -831,7 +831,7 @@
3517 mMovements[mIndex].ids.remove(ids);
3518 }
3519
3520-void LegacyVelocityTrackerStrategy::addMovement(nsecs_t eventTime, const IntSet &ids,
3521+void LegacyVelocityTrackerStrategy::addMovement(std::chrono::nanoseconds eventTime, const IntSet &ids,
3522 const VelocityTracker::Position* positions) {
3523 if (++mIndex == HISTORY_SIZE) {
3524 mIndex = 0;
3525@@ -853,7 +853,7 @@
3526 }
3527
3528 // Find the oldest sample that contains the pointer and that is not older than HORIZON.
3529- nsecs_t minTime = newestMovement.eventTime - HORIZON;
3530+ std::chrono::nanoseconds minTime = newestMovement.eventTime - HORIZON;
3531 uint32_t oldestIndex = mIndex;
3532 uint32_t numTouches = 1;
3533 do {
3534@@ -883,21 +883,21 @@
3535 uint32_t samplesUsed = 0;
3536 const Movement& oldestMovement = mMovements[oldestIndex];
3537 const VelocityTracker::Position& oldestPosition = oldestMovement.getPosition(id);
3538- nsecs_t lastDuration = 0;
3539+ std::chrono::nanoseconds lastDuration = std::chrono::nanoseconds(0);
3540
3541 while (numTouches-- > 1) {
3542 if (++index == HISTORY_SIZE) {
3543 index = 0;
3544 }
3545 const Movement& movement = mMovements[index];
3546- nsecs_t duration = movement.eventTime - oldestMovement.eventTime;
3547+ std::chrono::nanoseconds duration = movement.eventTime - oldestMovement.eventTime;
3548
3549 // If the duration between samples is small, we may significantly overestimate
3550 // the velocity. Consequently, we impose a minimum duration constraint on the
3551 // samples that we include in the calculation.
3552 if (duration >= MIN_DURATION) {
3553 const VelocityTracker::Position& position = movement.getPosition(id);
3554- float scale = 1000000000.0f / duration; // one over time delta in seconds
3555+ float scale = 1000000000.0f / duration.count(); // one over time delta in seconds
3556 float vx = (position.x - oldestPosition.x) * scale;
3557 float vy = (position.y - oldestPosition.y) * scale;
3558 accumVx = (accumVx * lastDuration + vx * duration) / (duration + lastDuration);
3559
3560=== modified file '3rd_party/android-input/android/frameworks/base/services/input/VirtualKeyMap.cpp'
3561--- 3rd_party/android-input/android/frameworks/base/services/input/VirtualKeyMap.cpp 2013-05-03 16:38:07 +0000
3562+++ 3rd_party/android-input/android/frameworks/base/services/input/VirtualKeyMap.cpp 2015-02-09 23:59:09 +0000
3563@@ -59,12 +59,12 @@
3564 status = NO_MEMORY;
3565 } else {
3566 #if DEBUG_PARSER_PERFORMANCE
3567- nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC);
3568+ std::chrono::nanoseconds startTime = systemTime(SYSTEM_TIME_MONOTONIC);
3569 #endif
3570 Parser parser(map, tokenizer);
3571 status = parser.parse();
3572 #if DEBUG_PARSER_PERFORMANCE
3573- nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
3574+ std::chrono::nanoseconds elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
3575 ALOGD("Parsed key character map file '%s' %d lines in %0.3fms.",
3576 c_str(tokenizer->getFilename()), tokenizer->getLineNumber(),
3577 elapsedTime / 1000000.0);
3578
3579=== modified file '3rd_party/android-input/android/frameworks/native/include/utils/Looper.h'
3580--- 3rd_party/android-input/android/frameworks/native/include/utils/Looper.h 2013-05-03 16:38:07 +0000
3581+++ 3rd_party/android-input/android/frameworks/native/include/utils/Looper.h 2015-02-09 23:59:09 +0000
3582@@ -270,7 +270,7 @@
3583 * The handler must not be null.
3584 * This method can be called on any thread.
3585 */
3586- void sendMessageDelayed(nsecs_t uptimeDelay, const sp<MessageHandler>& handler,
3587+ void sendMessageDelayed(std::chrono::nanoseconds uptimeDelay, const sp<MessageHandler>& handler,
3588 const Message& message);
3589
3590 /**
3591@@ -281,7 +281,7 @@
3592 * The handler must not be null.
3593 * This method can be called on any thread.
3594 */
3595- void sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler,
3596+ void sendMessageAtTime(std::chrono::nanoseconds uptime, const sp<MessageHandler>& handler,
3597 const Message& message);
3598
3599 /**
3600@@ -339,11 +339,11 @@
3601 struct MessageEnvelope {
3602 MessageEnvelope() : uptime(0) { }
3603
3604- MessageEnvelope(nsecs_t uptime, const sp<MessageHandler> handler,
3605+ MessageEnvelope(std::chrono::nanoseconds uptime, const sp<MessageHandler> handler,
3606 const Message& message) : uptime(uptime), handler(handler), message(message) {
3607 }
3608
3609- nsecs_t uptime;
3610+ std::chrono::nanoseconds uptime;
3611 sp<MessageHandler> handler;
3612 Message message;
3613 };
3614@@ -366,7 +366,7 @@
3615 // it runs on a single thread.
3616 Vector<Response> mResponses;
3617 size_t mResponseIndex;
3618- nsecs_t mNextMessageUptime; // set to LLONG_MAX when none
3619+ std::chrono::nanoseconds mNextMessageUptime; // set to LLONG_MAX when none
3620
3621 int pollInner(int timeoutMillis);
3622 void awoken();
3623
3624=== modified file '3rd_party/android-input/android/frameworks/native/libs/utils/Looper.cpp'
3625--- 3rd_party/android-input/android/frameworks/native/libs/utils/Looper.cpp 2012-11-21 00:36:10 +0000
3626+++ 3rd_party/android-input/android/frameworks/native/libs/utils/Looper.cpp 2015-02-09 23:59:09 +0000
3627@@ -68,7 +68,7 @@
3628
3629 Looper::Looper(bool allowNonCallbacks) :
3630 mAllowNonCallbacks(allowNonCallbacks), mSendingMessage(false),
3631- mResponseIndex(0), mNextMessageUptime(LLONG_MAX) {
3632+ mResponseIndex(0), mNextMessageUptime(std::chrono::nanoseconds(LLONG_MAX)) {
3633 int wakeFds[2];
3634 int result = pipe(wakeFds);
3635 LOG_ALWAYS_FATAL_IF(result != 0, "Could not create wake pipe. errno=%d", errno);
3636@@ -196,8 +196,8 @@
3637 #endif
3638
3639 // Adjust the timeout based on when the next message is due.
3640- if (timeoutMillis != 0 && mNextMessageUptime != LLONG_MAX) {
3641- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
3642+ if (timeoutMillis != 0 && mNextMessageUptime != std::chrono::nanoseconds(LLONG_MAX)) {
3643+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
3644 int messageTimeoutMillis = toMillisecondTimeoutDelay(now, mNextMessageUptime);
3645 if (messageTimeoutMillis >= 0
3646 && (timeoutMillis < 0 || messageTimeoutMillis < timeoutMillis)) {
3647@@ -271,9 +271,9 @@
3648 Done: ;
3649
3650 // Invoke pending message callbacks.
3651- mNextMessageUptime = LLONG_MAX;
3652+ mNextMessageUptime = std::chrono::nanoseconds(LLONG_MAX);
3653 while (mMessageEnvelopes.size() != 0) {
3654- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
3655+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
3656 const MessageEnvelope& messageEnvelope = mMessageEnvelopes.itemAt(0);
3657 if (messageEnvelope.uptime <= now) {
3658 // Remove the envelope from the list.
3659@@ -339,8 +339,8 @@
3660 } while (result == ALOOPER_POLL_CALLBACK);
3661 return result;
3662 } else {
3663- nsecs_t endTime = systemTime(SYSTEM_TIME_MONOTONIC)
3664- + milliseconds_to_nanoseconds(timeoutMillis);
3665+ std::chrono::nanoseconds endTime = systemTime(SYSTEM_TIME_MONOTONIC)
3666+ + std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::milliseconds(timeoutMillis));
3667
3668 for (;;) {
3669 int result = pollOnce(timeoutMillis, outFd, outEvents, outData);
3670@@ -348,7 +348,7 @@
3671 return result;
3672 }
3673
3674- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
3675+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
3676 timeoutMillis = toMillisecondTimeoutDelay(now, endTime);
3677 if (timeoutMillis == 0) {
3678 return ALOOPER_POLL_TIMEOUT;
3679@@ -479,17 +479,17 @@
3680 }
3681
3682 void Looper::sendMessage(const sp<MessageHandler>& handler, const Message& message) {
3683- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
3684+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
3685 sendMessageAtTime(now, handler, message);
3686 }
3687
3688-void Looper::sendMessageDelayed(nsecs_t uptimeDelay, const sp<MessageHandler>& handler,
3689+void Looper::sendMessageDelayed(std::chrono::nanoseconds uptimeDelay, const sp<MessageHandler>& handler,
3690 const Message& message) {
3691- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
3692+ std::chrono::nanoseconds now = systemTime(SYSTEM_TIME_MONOTONIC);
3693 sendMessageAtTime(now + uptimeDelay, handler, message);
3694 }
3695
3696-void Looper::sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler,
3697+void Looper::sendMessageAtTime(std::chrono::nanoseconds uptime, const sp<MessageHandler>& handler,
3698 const Message& message) {
3699 #if DEBUG_CALLBACKS
3700 ALOGD("%p ~ sendMessageAtTime - uptime=%lld, handler=%p, what=%d",
3701
3702=== modified file '3rd_party/android-input/android/frameworks/native/libs/utils/Timers.cpp'
3703--- 3rd_party/android-input/android/frameworks/native/libs/utils/Timers.cpp 2013-05-03 16:38:07 +0000
3704+++ 3rd_party/android-input/android/frameworks/native/libs/utils/Timers.cpp 2015-02-09 23:59:09 +0000
3705@@ -32,7 +32,7 @@
3706 #include <windows.h>
3707 #endif
3708
3709-nsecs_t systemTime(int clock)
3710+std::chrono::nanoseconds systemTime(int clock)
3711 {
3712 #if defined(HAVE_POSIX_CLOCKS)
3713 static const clockid_t clocks[] = {
3714@@ -44,21 +44,21 @@
3715 struct timespec t;
3716 t.tv_sec = t.tv_nsec = 0;
3717 clock_gettime(clocks[clock], &t);
3718- return nsecs_t(t.tv_sec)*1000000000LL + t.tv_nsec;
3719+ return std::chrono::nanoseconds(t.tv_sec)*1000000000LL + t.tv_nsec;
3720 #else
3721 // we don't support the clocks here.
3722 struct timeval t;
3723 t.tv_sec = t.tv_usec = 0;
3724 gettimeofday(&t, NULL);
3725- return nsecs_t(t.tv_sec)*1000000000LL + nsecs_t(t.tv_usec)*1000LL;
3726+ return std::chrono::nanoseconds(t.tv_sec)*1000000000LL + std::chrono::nanoseconds(t.tv_usec)*1000LL;
3727 #endif
3728 }
3729
3730-int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime)
3731+int toMillisecondTimeoutDelay(std::chrono::nanoseconds referenceTime, std::chrono::nanoseconds timeoutTime)
3732 {
3733 int timeoutDelayMillis;
3734 if (timeoutTime > referenceTime) {
3735- uint64_t timeoutDelay = uint64_t(timeoutTime - referenceTime);
3736+ uint64_t timeoutDelay = (timeoutTime - referenceTime).count();
3737 if (timeoutDelay > uint64_t((INT_MAX - 1) * 1000000LL)) {
3738 timeoutDelayMillis = -1;
3739 } else {
3740
3741=== modified file 'CMakeLists.txt'
3742--- CMakeLists.txt 2014-12-08 04:03:47 +0000
3743+++ CMakeLists.txt 2015-02-09 23:59:09 +0000
3744@@ -27,9 +27,13 @@
3745 set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
3746
3747 set(MIR_VERSION_MAJOR 0)
3748-set(MIR_VERSION_MINOR 10) # This should change at least with every MIRSERVER_ABI
3749+set(MIR_VERSION_MINOR 11) # This should change at least with every MIRSERVER_ABI
3750 set(MIR_VERSION_PATCH 0)
3751
3752+add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
3753+add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
3754+add_definitions(-DMIR_VERSION_MICRO=${MIR_VERSION_PATCH})
3755+
3756 set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH})
3757
3758 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
3759@@ -48,7 +52,7 @@
3760 include (cmake/PrePush.cmake)
3761 include (GNUInstallDirs)
3762
3763-set(build_types "None;Debug;Release;RelWithDebInfo;MinSizeRel;Coverage;AddressSanitizer")
3764+set(build_types "None;Debug;Release;RelWithDebInfo;MinSizeRel;Coverage;AddressSanitizer;ThreadSanitizer")
3765 # Change informational string for CMAKE_BUILD_TYPE
3766 set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "${build_types}" FORCE)
3767 # Enable cmake-gui to display a drop down list for CMAKE_BUILD_TYPE
3768@@ -92,16 +96,32 @@
3769 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
3770 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
3771 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
3772+elseif(cmake_build_type_lower MATCHES "threadsanitizer")
3773+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
3774+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
3775+ if (CMAKE_COMPILER_IS_GNUCXX)
3776+ # Work around GCC bug. It should automatically link to tsan when
3777+ # -fsanitize=thread is used, but doesn't.
3778+ #
3779+ # Linking everything with tsan is harmless and simple, so do that.
3780+ link_libraries(tsan)
3781+ endif()
3782 else()
3783 # AddressSanitizer builds fail if we disallow undefined symbols
3784 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
3785 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
3786 endif()
3787
3788+set(CMAKE_MODULE_LINKER_FLAGS_THREADSANITIZER "-fsanitize=thread")
3789+set(CMAKE_SHARED_LINKER_FLAGS_THREADSANITZIER "-fsanitize=thread")
3790+set(CMAKE_EXE_LINKER_FLAGS_THREADSANITIZER "-pie")
3791+
3792 # Define LOG_NDEBUG=1 to ensure Android ALOGV calls are not compiled in to
3793 # consume CPU time...
3794 add_definitions(-DLOG_NDEBUG=1)
3795
3796+add_definitions(-DMIR_REQUIRE_DEPRECATED_EVENT_OPT_IN=1)
3797+
3798 enable_testing()
3799
3800 include_directories(include/common)
3801
3802=== modified file 'benchmarks/android-input/input_reader_perf.cpp'
3803--- benchmarks/android-input/input_reader_perf.cpp 2014-12-08 04:03:47 +0000
3804+++ benchmarks/android-input/input_reader_perf.cpp 2015-02-09 23:59:09 +0000
3805@@ -147,7 +147,7 @@
3806 size_t i = 0;
3807 while (gInputEvents[i].nsecs > 0)
3808 {
3809- fakeEventHub->synthesize_event(gInputEvents[i].nsecs, DEVICE_ID,
3810+ fakeEventHub->synthesize_event(std::chrono::nanoseconds(gInputEvents[i].nsecs), DEVICE_ID,
3811 gInputEvents[i].type,
3812 gInputEvents[i].code,
3813 gInputEvents[i].value);
3814
3815=== modified file 'benchmarks/frame-uniformity/touch_samples.cpp'
3816--- benchmarks/frame-uniformity/touch_samples.cpp 2014-10-22 14:08:51 +0000
3817+++ benchmarks/frame-uniformity/touch_samples.cpp 2015-02-09 23:59:09 +0000
3818@@ -16,6 +16,8 @@
3819 * Authored by: Robert Carr <robert.carr@canonical.com>
3820 */
3821
3822+#define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
3823+
3824 #include "touch_samples.h"
3825
3826 void TouchSamples::record_frame_time(std::chrono::high_resolution_clock::time_point time)
3827
3828=== modified file 'client-ABI-sha1sums'
3829--- client-ABI-sha1sums 2014-12-24 01:59:05 +0000
3830+++ client-ABI-sha1sums 2015-02-09 23:59:09 +0000
3831@@ -1,27 +1,27 @@
3832 afd66e984f4f8c0303fd25fb6fea32fa47bbd37f include/client/mir_toolkit/debug/surface.h
3833 b53736bcb22ddc09aab8275cfdd05c109fdd0f12 include/client/mir_toolkit/mir_client_library_drm.h
3834 532af89e0f48d8d2a7cf01621db25d3338ae3abf include/client/mir_toolkit/mir_client_library.h
3835-750aa35e6a5173bcba47cb524c508d05a4df746c include/client/mir_toolkit/mir_connection.h
3836+615df675ffba805fb0594e19fb006f514f2100a7 include/client/mir_toolkit/mir_connection.h
3837 1ef8f51a3e3f8d1559266c5af58fbfde7cfabf0a include/client/mir_toolkit/mir_cursor_configuration.h
3838 d739af6e64db6b314a727b5fb00be662b98ccd57 include/client/mir_toolkit/mir_platform_message.h
3839 9d50df5a141ca03ee8a79f7e844ed4b8b3b7d5d3 include/client/mir_toolkit/mir_prompt_session.h
3840 21d07e655e85eeec8a3523e1c6f9c2252176ec01 include/client/mir_toolkit/mir_screencast.h
3841-82a2a3d219747a778284811ba0c01e0fdf167b30 include/client/mir_toolkit/mir_surface.h
3842+07c140966a72af13606993f7f8e58b79441f92e6 include/client/mir_toolkit/mir_surface.h
3843 b141c4d79802ad626d969249c0004744e5c2a525 include/client/mir_toolkit/mir_wait.h
3844 6f7b4ecc22afba923806ed2bd7d8244be90b0cfd include/client/mir_toolkit/version.h
3845 3350dac884d6006753de2a955bc7a05663cd9449 include/common/mir_toolkit/client_types.h
3846-c7c708734715a6d1b6fb2652584adb912071a518 include/common/mir_toolkit/common.h
3847+b042ff8f542759fb82ad4cf1f4bab4aa2824e7f0 include/common/mir_toolkit/common.h
3848 fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/common/mir_toolkit/cursors.h
3849 f4d39e9893ce6308bddd83a49b90f0051f565323 include/common/mir_toolkit/event.h
3850 2507f2929415aa423f9551d3c595c439fe1c6efd include/common/mir_toolkit/events/event_deprecated.h
3851-cb2358a701db2b9c8d9ba1c877f29f834af259a7 include/common/mir_toolkit/events/event.h
3852-c591a02a8e9851db342c310cf829d018a1eddb51 include/common/mir_toolkit/events/input/input_event.h
3853+75f81e8250bd76c5281b8792aeadf5319eb2f169 include/common/mir_toolkit/events/event.h
3854+003b178a1d2418e03a13c54ca02353fa24beb1d6 include/common/mir_toolkit/events/input/input_event.h
3855 7748a12138474e9be218eeb8f14b372af0fcec7e include/common/mir_toolkit/events/input/key_input_event.h
3856+489e8bae7c3e949ac449b09bd3bf554dae0e8986 include/common/mir_toolkit/events/input/pointer_input_event.h
3857 de7c23453e6d897296f32e49d9ba952a1baa0200 include/common/mir_toolkit/events/input/touch_input_event.h
3858 8642e85a50e2de651589da3ced70e0fc0a915f26 include/common/mir_toolkit/events/orientation_event.h
3859 f623dcf3c2ed134c1be20106eb54bcccc84af462 include/common/mir_toolkit/events/prompt_session_event.h
3860 633893b0def2b71f969872908a5b3529bc2fbf10 include/common/mir_toolkit/events/resize_event.h
3861 5944dc0556223cc54b45b32c8aa70b8c60ee0337 include/common/mir_toolkit/events/surface_event.h
3862-4975998aa1056ed0d39dcc538127453e516ad8e9 include/common/mir_toolkit/mesa/native_display.h
3863 101017c17714a57db57d79b7b5e7df40a3568236 include/common/mir_toolkit/mir_native_buffer.h
3864 4ce105a3a18241f5d33db31939ca15256f353c37 include/common/mir_toolkit/mir_version_number.h
3865
3866=== modified file 'cmake/FindGtest.cmake'
3867--- cmake/FindGtest.cmake 2014-12-11 06:14:56 +0000
3868+++ cmake/FindGtest.cmake 2015-02-09 23:59:09 +0000
3869@@ -20,7 +20,12 @@
3870 set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)
3871 set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
3872
3873-set(GTEST_CMAKE_ARGS "-DCMAKE_CXX_FLAGS=-fPIC")
3874+set(GTEST_CXX_FLAGS "-fPIC")
3875+if (cmake_build_type_lower MATCHES "threadsanitizer")
3876+ set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread")
3877+endif()
3878+
3879+set(GTEST_CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${GTEST_CXX_FLAGS}")
3880 if (${CMAKE_CROSSCOMPILING})
3881 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
3882 endif()
3883
3884=== modified file 'common-ABI-sha1sums'
3885--- common-ABI-sha1sums 2015-01-06 02:28:04 +0000
3886+++ common-ABI-sha1sums 2015-02-09 23:59:09 +0000
3887@@ -1,13 +1,17 @@
3888 3329ada91412ded2f127aee9a92f065e57b81cb2 include/common/mir/cached_ptr.h
3889+d20a846dfa0e46fb276b4c181a6a5a56e7a884da include/common/mir/dispatch/dispatchable.h
3890+7bdc0e58dc228ac655a618208bf133c6a499ca13 include/common/mir/dispatch/simple_dispatch_thread.h
3891+4bbb26ec91310e250d3d7803575c36fd8cd8b87c include/common/mir/events/event_builders.h
3892 82ff9499ef62739379616e02164dc98f9914c329 include/common/mir/fd.h
3893-b399dc08514751c86e23824612a52378dd9b1e23 include/common/mir/geometry/dimensions.h
3894-5870ce0fdde3546bfb67997c730fa51379359cae include/common/mir/geometry/displacement.h
3895+fe0275d9c64e7a2d99990382d04b1fe956d7b7e4 include/common/mir/frontend/surface_id.h
3896+212be468fdca8134c1dff7a9cd61ecec76b26967 include/common/mir/geometry/dimensions.h
3897+dd2eb355262622f08280e63dbc2680068fe81d9e include/common/mir/geometry/displacement.h
3898 283cb0ecf9d544300681fc2ab86bec568e2d20ff include/common/mir/geometry/forward.h
3899 bfd87d9fb800c1c1b528c00185570abac569caf2 include/common/mir/geometry/length.h
3900 d954464ef2d20c2876db68c94512a443186da09b include/common/mir/geometry/point.h
3901 dc7c62d3916eec025e8e7deaf57e06077ce38928 include/common/mir/geometry/rectangle.h
3902-5161774957e3ca4f5fa4e7db025d0978d2bbef06 include/common/mir/geometry/rectangles.h
3903-42646c2367b9821e3aa71feff6e31cf50526acaa include/common/mir/geometry/size.h
3904+41446a309ee25148a9b1a66ebee205c57e014a8f include/common/mir/geometry/rectangles.h
3905+20fa71bf856b1f391ad84b0afd8c197e0ca9e982 include/common/mir/geometry/size.h
3906 e1be9faee8b844ca2ce617f8fd82c9ee08d56bed include/common/mir/graphics/native_buffer.h
3907 dcf8b8982f138bdde39a241825c610e955cd5e33 include/common/mir/input/input_platform.h
3908 208cd6aed5ef5f8f39b3eb86604e4133cb840485 include/common/mir/input/input_receiver_thread.h
3909@@ -17,18 +21,18 @@
3910 31b9c24e2ce7194aeea6694e81c160354033d28a include/common/mir/optional_value.h
3911 9ae8473df05dd9e048a73797f01a2f34f7447554 include/common/mir/time/types.h
3912 3350dac884d6006753de2a955bc7a05663cd9449 include/common/mir_toolkit/client_types.h
3913-c7c708734715a6d1b6fb2652584adb912071a518 include/common/mir_toolkit/common.h
3914+b042ff8f542759fb82ad4cf1f4bab4aa2824e7f0 include/common/mir_toolkit/common.h
3915 fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/common/mir_toolkit/cursors.h
3916 f4d39e9893ce6308bddd83a49b90f0051f565323 include/common/mir_toolkit/event.h
3917 2507f2929415aa423f9551d3c595c439fe1c6efd include/common/mir_toolkit/events/event_deprecated.h
3918-cb2358a701db2b9c8d9ba1c877f29f834af259a7 include/common/mir_toolkit/events/event.h
3919-c591a02a8e9851db342c310cf829d018a1eddb51 include/common/mir_toolkit/events/input/input_event.h
3920+75f81e8250bd76c5281b8792aeadf5319eb2f169 include/common/mir_toolkit/events/event.h
3921+003b178a1d2418e03a13c54ca02353fa24beb1d6 include/common/mir_toolkit/events/input/input_event.h
3922 7748a12138474e9be218eeb8f14b372af0fcec7e include/common/mir_toolkit/events/input/key_input_event.h
3923+489e8bae7c3e949ac449b09bd3bf554dae0e8986 include/common/mir_toolkit/events/input/pointer_input_event.h
3924 de7c23453e6d897296f32e49d9ba952a1baa0200 include/common/mir_toolkit/events/input/touch_input_event.h
3925 8642e85a50e2de651589da3ced70e0fc0a915f26 include/common/mir_toolkit/events/orientation_event.h
3926 f623dcf3c2ed134c1be20106eb54bcccc84af462 include/common/mir_toolkit/events/prompt_session_event.h
3927 633893b0def2b71f969872908a5b3529bc2fbf10 include/common/mir_toolkit/events/resize_event.h
3928 5944dc0556223cc54b45b32c8aa70b8c60ee0337 include/common/mir_toolkit/events/surface_event.h
3929-4975998aa1056ed0d39dcc538127453e516ad8e9 include/common/mir_toolkit/mesa/native_display.h
3930 101017c17714a57db57d79b7b5e7df40a3568236 include/common/mir_toolkit/mir_native_buffer.h
3931 4ce105a3a18241f5d33db31939ca15256f353c37 include/common/mir_toolkit/mir_version_number.h
3932
3933=== modified file 'debian/changelog'
3934--- debian/changelog 2015-01-07 23:50:17 +0000
3935+++ debian/changelog 2015-02-09 23:59:09 +0000
3936@@ -1,3 +1,70 @@
3937+mir (0.11.0-0ubuntu1) UNRELEASED; urgency=medium
3938+
3939+ * New upstream release 0.11.0 (https://launchpad.net/mir/+milestone/0.11.0)
3940+ - Packaging changes:
3941+ . Due to changes in the Mir driver model the client platforms are no
3942+ longer versioned by soname. Thusly libmirplatform5driver-(mesa|android) is
3943+ replaced by mir-client-platform-(mesa-android). A new package
3944+ mir-client-platform-mesa-dev is introduced containing headers
3945+ previously in mirplatform-dev.
3946+ - Enhancements:
3947+ . Lots more major plumbing in the Android code, on the path to
3948+ supporting external displays.
3949+ . Add support for clang 3.6.
3950+ . Major redesign of server classes in mir::shell,scene and friends
3951+ (still in progress).
3952+ . Added client API for creating dialogs and tooltips.
3953+ . Added new surface states: mir_surface_state_hidden and
3954+ mir_surface_state_horizmaximized.
3955+ . Performance: Use optimally efficient fragment shading when possible.
3956+ . Performance: (Desktop) Composite using double buffering instead of
3957+ triple to reduce visible lag.
3958+ . mir_proving_server: Can now resize windows from any edge or corner
3959+ using the existing Alt+middlebuttondrag.
3960+ . mir_proving_server: Added some demo custom shaders (negative and
3961+ high contrast modes: Super+N/C).
3962+ . mir_proving_server: Can now close clients politely via Alt+F4.
3963+ . Added MirPointerInputEvent (part of the new input API, the old
3964+ MirMotionEvent is still supported also for now).
3965+ - ABI summary: Servers need rebuilding, but clients do not;
3966+ . Mirclient ABI unchanged at 8
3967+ . Mircommon ABI unchanged at 3
3968+ . Mirplatform ABI bumped to 6
3969+ . Mirserver ABI bumped to 29
3970+ - Bug fixes:
3971+ . [regression] mir_demo_server exits immediately with boost
3972+ bad_any_cast exception (LP: #1414630)
3973+ . need way to position menus and tooltips (relative positioning to
3974+ parent) (LP: #1324101)
3975+ . GLibMainLoopTest failure seen in CI (LP: #1413748)
3976+ . Clang builds fail in CI (LP: #1416317)
3977+ . segfault in mir::compositor::GLProgramFamily::Shader::init()
3978+ (LP: #1416482)
3979+ . GLRenderer: The default fragment shader is sub-optimal for alpha=1.0
3980+ (LP: #1350674)
3981+ . mesa::DisplayBuffer::post_update is triple buffered - more laggy than
3982+ it needs to be (LP: #1350725)
3983+ . Cannot connect to nested server when started from a differen vt
3984+ (LP: #1379266)
3985+ . [testfail] AsioMainLoopAlarmTest fails in CI (LP: #1392256)
3986+ . Compositor report inconsistently reports frame time during bypass,
3987+ and render time otherwise (LP: #1408906)
3988+ . [regression] mir_demo_client_fingerpaint doesn't paint anything any
3989+ more (with the mouse) (LP: #1413139)
3990+ . Hardware cursor is always slightly ahead of the composited image
3991+ (LP: #1274408)
3992+ . integration tests are outputting (too many) DisplayServer log
3993+ messages (LP: #1408231)
3994+ . [regression] deploy-and-test.sh doesn't work any more (unless you
3995+ have umockdev installed already) (LP: #1413479)
3996+ . Color Inverse on display. Toggle Negative Image (LP: #1400580)
3997+ . mir-ubuntu-vivid-armhf-ci fails consistently (LP: #1407863)
3998+ . Double-buffered surfaces may lag or freeze if event driven and not
3999+ constantly redrawing (LP: #1395581)
4000+ . Pointer motion and crossing events are missing (LP: #1417650)
4001+
4002+ -- Daniel van Vugt <daniel.van.vugt@canonical.com> Wed, 14 Jan 2015 16:10:37 +0800
4003+
4004 mir (0.10.0+15.04.20150107.2-0ubuntu1) vivid; urgency=medium
4005
4006 [ Daniel van Vugt ]
4007
4008=== modified file 'debian/control'
4009--- debian/control 2015-01-07 23:26:23 +0000
4010+++ debian/control 2015-02-09 23:59:09 +0000
4011@@ -59,21 +59,23 @@
4012 Contains the shared library containing the Google Protobuf definitions
4013 required for Mir clients and servers.
4014
4015-Package: libmirserver28
4016+#TODO: Packaging infrastructure for better dependency generation,
4017+# ala pkg-xorg's xviddriver:Provides and ABI detection.
4018+Package: libmirserver29
4019 Section: libs
4020 Architecture: i386 amd64 armhf arm64
4021 Multi-Arch: same
4022 Pre-Depends: ${misc:Pre-Depends}
4023 Depends: ${misc:Depends},
4024 ${shlibs:Depends},
4025- libmir${platform-driver}-mesa | libmir${platform-driver}-android,
4026+ mir-platform-graphics-mesa | mir-platform-graphics-android,
4027 Description: Display server for Ubuntu - server library
4028 Mir is a display server running on linux systems, with a focus on efficiency,
4029 robust operation and a well-defined driver model.
4030 .
4031 Contains the shared library needed by server applications for Mir.
4032
4033-Package: libmirplatform5
4034+Package: libmirplatform6
4035 Section: libs
4036 Architecture: i386 amd64 armhf arm64
4037 Multi-Arch: same
4038@@ -109,7 +111,7 @@
4039 Architecture: i386 amd64 armhf arm64
4040 Multi-Arch: same
4041 Pre-Depends: ${misc:Pre-Depends}
4042-Depends: libmirplatform5 (= ${binary:Version}),
4043+Depends: libmirplatform6 (= ${binary:Version}),
4044 libmircommon-dev,
4045 libboost-program-options-dev,
4046 ${misc:Depends},
4047@@ -126,7 +128,7 @@
4048 Architecture: i386 amd64 armhf arm64
4049 Multi-Arch: same
4050 Pre-Depends: ${misc:Pre-Depends}
4051-Depends: libmirserver28 (= ${binary:Version}),
4052+Depends: libmirserver29 (= ${binary:Version}),
4053 libmirplatform-dev (= ${binary:Version}),
4054 libmircommon-dev (= ${binary:Version}),
4055 libglm-dev,
4056@@ -266,6 +268,34 @@
4057 Contains the shared libraries required for the Mir server and client.
4058
4059 # Longer-term these drivers should move out-of-tree
4060+Package: mir-platform-graphics-mesa
4061+Section: libs
4062+Architecture: i386 amd64 armhf arm64
4063+Multi-Arch: same
4064+Pre-Depends: ${misc:Pre-Depends}
4065+Depends: ${misc:Depends},
4066+ ${shlibs:Depends},
4067+Description: Display server for Ubuntu - platform library for Mesa
4068+ Mir is a display server running on linux systems, with a focus on efficiency,
4069+ robust operation and a well-defined driver model.
4070+ .
4071+ Contains the shared libraries required for the Mir server to interact with
4072+ the hardware platform using the Mesa drivers.
4073+
4074+Package: mir-platform-graphics-android
4075+Section: libs
4076+Architecture: i386 amd64 armhf
4077+Multi-Arch: same
4078+Pre-Depends: ${misc:Pre-Depends}
4079+Depends: ${misc:Depends},
4080+ ${shlibs:Depends},
4081+Description: Display server for Ubuntu - platform library for Android
4082+ Mir is a display server running on linux systems, with a focus on efficiency,
4083+ robust operation and a well-defined driver model.
4084+ .
4085+ Contains the shared libraries required for the Mir server to interact with
4086+ the hardware platform using the Android drivers.
4087+
4088 Package: mir-client-platform-mesa
4089 Section: libs
4090 Architecture: i386 amd64 armhf arm64
4091@@ -280,6 +310,21 @@
4092 Contains the shared libraries required for the Mir clients to interact with
4093 the underlying hardware platform using the Mesa drivers.
4094
4095+Package: mir-client-platform-mesa-dev
4096+Section: libdevel
4097+Architecture: i386 amd64 armhf arm64
4098+Multi-Arch: same
4099+Pre-Depends: ${misc:Pre-Depends}
4100+Depends: mir-client-platform-mesa (= ${binary:Version}),
4101+ libmircommon-dev,
4102+ ${misc:Depends},
4103+Description: Display server for Ubuntu - client platform library for Mesa development files
4104+ Mir is a display server running on linux systems, with a focus on efficiency,
4105+ robust operation and a well-defined driver model.
4106+ .
4107+ Contains header files required to use the platform specific capabilities of
4108+ the Mir Mesa backend.
4109+
4110 Package: mir-client-platform-android
4111 Section: libs
4112 Architecture: i386 amd64 armhf
4113@@ -294,42 +339,14 @@
4114 Contains the shared libraries required for the Mir clients to interact with
4115 the underlying hardware platform using the Android drivers.
4116
4117-Package: libmirplatform5driver-mesa
4118-Section: libs
4119-Architecture: i386 amd64 armhf arm64
4120-Multi-Arch: same
4121-Pre-Depends: ${misc:Pre-Depends}
4122-Depends: ${misc:Depends},
4123- ${shlibs:Depends},
4124-Description: Display server for Ubuntu - platform library for Mesa
4125- Mir is a display server running on linux systems, with a focus on efficiency,
4126- robust operation and a well-defined driver model.
4127- .
4128- Contains the shared libraries required for the Mir server to interact with
4129- the hardware platform using the Mesa drivers.
4130-
4131-Package: libmirplatform5driver-android
4132-Section: libs
4133-Architecture: i386 amd64 armhf
4134-Multi-Arch: same
4135-Pre-Depends: ${misc:Pre-Depends}
4136-Depends: ${misc:Depends},
4137- ${shlibs:Depends},
4138-Description: Display server for Ubuntu - platform library for Android
4139- Mir is a display server running on linux systems, with a focus on efficiency,
4140- robust operation and a well-defined driver model.
4141- .
4142- Contains the shared libraries required for the Mir server to interact with
4143- the hardware platform using the Android drivers.
4144-
4145 Package: mir-graphics-drivers-desktop
4146 Section: libs
4147 Architecture: i386 amd64 armhf arm64
4148 Multi-Arch: same
4149 Pre-Depends: ${misc:Pre-Depends}
4150 Depends: ${misc:Depends},
4151- libmir${platform-driver}-mesa,
4152- mir-client-platform-mesa
4153+ mir-platform-graphics-mesa,
4154+ mir-client-platform-mesa,
4155 Description: Display server for Ubuntu - desktop driver metapackage
4156 Mir is a display server running on linux systems, with a focus on efficiency,
4157 robust operation and a well-defined driver model.
4158@@ -343,8 +360,8 @@
4159 Multi-Arch: same
4160 Pre-Depends: ${misc:Pre-Depends}
4161 Depends: ${misc:Depends},
4162- libmir${platform-driver}-android,
4163- mir-client-platform-android
4164+ mir-platform-graphics-android,
4165+ mir-client-platform-android,
4166 Description: Display server for Ubuntu - android driver metapackage
4167 Mir is a display server running on linux systems, with a focus on efficiency,
4168 robust operation and a well-defined driver model.
4169
4170=== removed file 'debian/libmirplatform5driver-android.install'
4171--- debian/libmirplatform5driver-android.install 2014-12-08 04:03:47 +0000
4172+++ debian/libmirplatform5driver-android.install 1970-01-01 00:00:00 +0000
4173@@ -1,1 +0,0 @@
4174-usr/lib/*/mir/platform*driver/android/*
4175
4176=== removed file 'debian/libmirplatform5driver-mesa.install'
4177--- debian/libmirplatform5driver-mesa.install 2014-12-08 04:03:47 +0000
4178+++ debian/libmirplatform5driver-mesa.install 1970-01-01 00:00:00 +0000
4179@@ -1,1 +0,0 @@
4180-usr/lib/*/mir/platform*driver/mesa/*
4181
4182=== renamed file 'debian/libmirplatform5.install' => 'debian/libmirplatform6.install'
4183--- debian/libmirplatform5.install 2014-12-08 04:03:47 +0000
4184+++ debian/libmirplatform6.install 2015-02-09 23:59:09 +0000
4185@@ -1,1 +1,1 @@
4186-usr/lib/*/libmirplatform.so.5
4187+usr/lib/*/libmirplatform.so.6
4188
4189=== renamed file 'debian/libmirserver28.install' => 'debian/libmirserver29.install'
4190--- debian/libmirserver28.install 2014-12-08 04:03:47 +0000
4191+++ debian/libmirserver29.install 2015-02-09 23:59:09 +0000
4192@@ -1,1 +1,1 @@
4193-usr/lib/*/libmirserver.so.28
4194+usr/lib/*/libmirserver.so.29
4195
4196=== added file 'debian/mir-client-platform-mesa-dev.install'
4197--- debian/mir-client-platform-mesa-dev.install 1970-01-01 00:00:00 +0000
4198+++ debian/mir-client-platform-mesa-dev.install 2015-02-09 23:59:09 +0000
4199@@ -0,0 +1,2 @@
4200+usr/include/mirclient/mir_toolkit/mesa
4201+usr/lib/*/pkgconfig/mir-client-platform-mesa-dev.pc
4202
4203=== added file 'debian/mir-platform-graphics-android.install'
4204--- debian/mir-platform-graphics-android.install 1970-01-01 00:00:00 +0000
4205+++ debian/mir-platform-graphics-android.install 2015-02-09 23:59:09 +0000
4206@@ -0,0 +1,1 @@
4207+usr/lib/*/mir/server-platform/graphics-android.so
4208
4209=== added file 'debian/mir-platform-graphics-mesa.install'
4210--- debian/mir-platform-graphics-mesa.install 1970-01-01 00:00:00 +0000
4211+++ debian/mir-platform-graphics-mesa.install 2015-02-09 23:59:09 +0000
4212@@ -0,0 +1,1 @@
4213+usr/lib/*/mir/server-platform/graphics-mesa.so
4214
4215=== modified file 'debian/mir-test-tools.install'
4216--- debian/mir-test-tools.install 2014-12-11 06:14:56 +0000
4217+++ debian/mir-test-tools.install 2015-02-09 23:59:09 +0000
4218@@ -5,5 +5,5 @@
4219 usr/bin/mir_performance_tests
4220 usr/lib/*/mir/tools/libmirclientlttng.so
4221 usr/lib/*/mir/tools/libmirserverlttng.so
4222-usr/lib/*/libmirplatformstub.so
4223+usr/lib/*/mir/server-platform/graphics-dummy.so
4224 usr/lib/*/mir/client-platform/dummy.so
4225
4226=== modified file 'debian/rules'
4227--- debian/rules 2015-01-06 02:55:13 +0000
4228+++ debian/rules 2015-02-09 23:59:09 +0000
4229@@ -13,8 +13,6 @@
4230 export CC=$(DEB_HOST_GNU_TYPE)-gcc-4.9
4231 export CXX=$(DEB_HOST_GNU_TYPE)-g++-4.9
4232
4233-export PLATFORM_DRIVER = platform5driver
4234-
4235 %:
4236 dh $@ --parallel --fail-missing
4237
4238@@ -57,15 +55,4 @@
4239 # Delete the symlink so that --fail-missing doesn't think we've missed it
4240 # accidentally.
4241 -rm debian/tmp/usr/lib/*/libmirprotobuf.so
4242- dh_install --fail-missing \
4243- -Xusr/lib/$(DEB_HOST_MULTIARCH)/libmir$(PLATFORM_DRIVER).so
4244- sh debian/install_ld_so_conf.sh $(DEB_HOST_ARCH) $(DEB_HOST_MULTIARCH)
4245-
4246-override_dh_installdeb:
4247- sh debian/create_postinst_prerm_scripts.sh \
4248- $(DEB_HOST_ARCH) $(DEB_HOST_MULTIARCH)
4249- dh_installdeb
4250-
4251-override_dh_gencontrol:
4252- dh_gencontrol -- \
4253- -Vplatform-driver=$(PLATFORM_DRIVER)
4254+ dh_install --fail-missing
4255
4256=== modified file 'deploy-and-test.sh'
4257--- deploy-and-test.sh 2014-03-04 05:28:46 +0000
4258+++ deploy-and-test.sh 2015-02-09 23:59:09 +0000
4259@@ -1,4 +1,5 @@
4260 #!/bin/sh
4261+# WARNING: This script is slow. See: doc/avoid_deploy-and-test.md
4262
4263 if [ ! -d build-android-arm ] ; then
4264 echo "Built tree not found in $(pwd)/build-android-arm"
4265@@ -12,10 +13,14 @@
4266 dpkg -x libumockdev0_*armhf*.deb .
4267 )
4268
4269-adb push build-android-arm/bin /home/phablet/mir/bin
4270-adb push build-android-arm/lib /home/phablet/mir/lib
4271-adb push build-android-arm/usr /home/phablet/mir/usr
4272-
4273-adb shell "LD_LIBRARY_PATH=/home/phablet/mir/usr/lib/arm-linux-gnueabihf/:/home/phablet/mir/lib PATH=$PATH:/home/phablet/mir/usr/bin bash -c \"cd /home/phablet/mir/usr/bin ; umockdev-run /home/phablet/mir/bin/mir_unit_tests\""
4274-adb shell "LD_LIBRARY_PATH=/home/phablet/mir/usr/lib/arm-linux-gnueabihf/:/home/phablet/mir/lib PATH=$PATH:/home/phablet/mir/usr/bin bash -c \"cd /home/phablet/mir/usr/bin ; umockdev-run /home/phablet/mir/bin/mir_integration_tests\""
4275-adb shell "LD_LIBRARY_PATH=/home/phablet/mir/usr/lib/arm-linux-gnueabihf/:/home/phablet/mir/lib PATH=$PATH:/home/phablet/mir/usr/bin bash -c \"cd /home/phablet/mir/usr/bin ; umockdev-run /home/phablet/mir/bin/mir_acceptance_tests\""
4276+rundir=/home/phablet/mir/testing
4277+adb push build-android-arm/bin $rundir/bin
4278+adb push build-android-arm/lib $rundir/lib
4279+adb push build-android-arm/usr $rundir/usr
4280+
4281+libpath=$rundir/usr/lib/arm-linux-gnueabihf/:$rundir/lib
4282+run_with_env="LD_LIBRARY_PATH=$libpath $rundir/usr/bin/umockdev-run $rundir/bin/"
4283+
4284+adb shell "${run_with_env}mir_unit_tests"
4285+adb shell "${run_with_env}mir_integration_tests"
4286+adb shell "${run_with_env}mir_acceptance_tests"
4287
4288=== added file 'doc/avoid_deploy-and-test.md'
4289--- doc/avoid_deploy-and-test.md 1970-01-01 00:00:00 +0000
4290+++ doc/avoid_deploy-and-test.md 2015-02-09 23:59:09 +0000
4291@@ -0,0 +1,29 @@
4292+How to avoid deploy-and-test.sh
4293+===============================
4294+
4295+If you're running tests regularly from different branches on a remote
4296+Ubuntu touch device, you should avoid deploy-and-test.sh because it's very
4297+slow to complete. Particularly if you're making code changes and need to
4298+repeat the script each time. Instead, you can set up your device for rapid
4299+iteration like so:
4300+
4301+One-time setup
4302+--------------
4303+ adb push ~/.ssh/id_rsa.pub /home/phablet/.ssh/authorized_keys
4304+ adb shell
4305+ chown phablet ~/.ssh
4306+ chmod -R go-w ~/.ssh
4307+ mkdir ~/testrundir
4308+ sudo start ssh
4309+ sudo mount -o remount,rw /
4310+ sudo apt-get install umockdev
4311+
4312+Now for each branch you want to deploy and test
4313+-----------------------------------------------
4314+ device=<ip-or-hostname-of-your-device>
4315+ cd build-android-arm
4316+ rsync -avH lib bin phablet@$device:testrundir/
4317+ adb shell (or ssh phablet@$device)
4318+ cd testrundir
4319+ umockdev-run bin/mir_unit-tests
4320+ ...
4321
4322=== added file 'doc/demo_server_controls.md'
4323--- doc/demo_server_controls.md 1970-01-01 00:00:00 +0000
4324+++ doc/demo_server_controls.md 2015-02-09 23:59:09 +0000
4325@@ -0,0 +1,60 @@
4326+Demo Server {#demo_server}
4327+===========
4328+
4329+Mir's demo server (`mir_demo_server`) is an example of using the Mir to
4330+build a server. In contrast to mir_proving_server (see \ref demo_shell_controls)
4331+it uses only functionality supported by the public Mir API.
4332+
4333+Running Demo Server
4334+-------------------
4335+
4336+Remember to always run `mir_demo_server` as root on PC (not required on
4337+Android), as this is required for input device support (open bug
4338+https://bugs.launchpad.net/mir/+bug/1286252);
4339+
4340+ sudo mir_demo_server
4341+
4342+And if you're not already on the VT you wish to use, that needs to be
4343+specified:
4344+
4345+ sudo mir_demo_server --vt 1
4346+
4347+There are plenty more options available if you run:
4348+
4349+ mir_demo_server --help
4350+
4351+Tiling Window Manager
4352+---------------------
4353+
4354+One option that needs elaboration is "--window-manager tiling".
4355+
4356+This starts a (rather primitive) tiling window manager. It tracks the available
4357+displays and splits the available workspace into "tiles" (one per client).
4358+
4359+The following operations are supported:
4360+
4361+ - Quit (shut down the Mir server): *Ctrl-Alt-Backspace*
4362+ - Switch back to X: *Ctrl-Alt-F7*
4363+ - Switch virtual terminals (VTs): *Ctrl-Alt-(F1-F12)*
4364+ - Switch apps: tap or click on the corresponding tile
4365+ - Move window: *Alt-leftmousebutton* drag
4366+ - Resize window: *Alt-middle_button* drag
4367+ - Maximize/restore current window (to tile size): Alt-F11
4368+ - Maximize/restore current window (to tile height): Shift-F11
4369+ - Maximize/restore current window (to tile width): Ctrl-F11
4370+
4371+For those writing client code request to set the surface attribute
4372+`mir_surface_attrib_state` are honoured:
4373+ - `mir_surface_state_restored`: restores the window
4374+ - `mir_surface_state_maximized`: maximizes to tile size
4375+ - `mir_surface_state_vertmaximized`: maximizes to tile height
4376+
4377+For a quick demo try:
4378+
4379+ sudo mir_demo_server --vt 1 --display-config sidebyside\
4380+ --window-manager tiling --launch bin/mir_demo_client_egltriangle\
4381+ --test-client bin/mir_demo_client_multiwin --test-timeout 60
4382+
4383+(Remember to unwrap the line)
4384+
4385+Want more? Log your requests at: https://bugs.launchpad.net/mir/+filebug
4386
4387=== modified file 'doc/demo_shell_controls.md'
4388--- doc/demo_shell_controls.md 2014-12-19 02:31:34 +0000
4389+++ doc/demo_shell_controls.md 2015-02-09 23:59:09 +0000
4390@@ -34,8 +34,11 @@
4391 - Switch back to X: *Ctrl-Alt-F7*
4392 - Switch virtual terminals (VTs): *Ctrl-Alt-(F1-F12)*
4393 - Switch apps: *Alt-Tab* or *4-finger swipe left/right*
4394+ - Ask an app to close: *Alt-F4* (it may refuse or not understand)
4395 - Move window: *Alt-leftmousebutton* or *3-finger drag*
4396 - Resize window: *Alt-middlemousebutton* or *3-finger pinch/zoom*
4397+ - Toggle negative rendering: *Super-N*
4398+ - Toggle high-contrast rendering: *Super-C*
4399 - Sleep/wake all displays: *Alt-P* or *Android power button*
4400 - Rotate the focussed monitor: *Ctrl-Alt-(Left/Right/Up/Down)* or
4401 *Volume up/down while touching the screen*
4402
4403=== modified file 'doc/mainpage.md'
4404--- doc/mainpage.md 2014-12-08 04:03:47 +0000
4405+++ doc/mainpage.md 2015-02-09 23:59:09 +0000
4406@@ -42,6 +42,7 @@
4407 - \ref using_mir_on_android
4408 - \ref debug_for_xmir
4409 - \ref demo_shell_controls
4410+ - \ref demo_server
4411
4412 Getting involved
4413 ----------------
4414@@ -81,7 +82,20 @@
4415 Mir server is written as a library which allows the server code to be adapted
4416 for bespoke applications.
4417
4418- - \subpage render_surfaces-example "render_surfaces.cpp: A simple program using the Mir library"
4419+ - \subpage server_example.cpp
4420+ "server_example.cpp: a test executable hosting the following"
4421+ - \subpage server_example_input_event_filter.cpp
4422+ "server_example_input_event_filter.cpp: provide a Quit command"
4423+ - \subpage server_example_display_configuration_policy.cpp
4424+ "server_example_display_configuration_policy.cpp: configuring display layout"
4425+ - \subpage server_example_input_filter.cpp
4426+ "server_example_input_filter.cpp: print input events to stdout"
4427+ - \subpage server_example_log_options.cpp
4428+ "server_example_log_options.cpp: replace Mir logger with glog"
4429+ - \subpage server_example_window_manager.cpp
4430+ "server_example_window_manager.cpp: How to wire up a window manager"
4431+ - \subpage server_example_window_management.cpp
4432+ "server_example_window_management.cpp: simple window management examples"
4433
4434 Working on Mir code
4435 -------------------
4436
4437=== modified file 'examples/CMakeLists.txt'
4438--- examples/CMakeLists.txt 2015-01-06 08:57:38 +0000
4439+++ examples/CMakeLists.txt 2015-02-09 23:59:09 +0000
4440@@ -23,6 +23,7 @@
4441 server_example_fullscreen_placement_strategy.cpp
4442 server_example_host_lifecycle_event.cpp
4443 server_example_window_manager.cpp
4444+ server_example_window_management.cpp
4445 )
4446
4447 target_link_libraries(eglapp
4448@@ -60,6 +61,12 @@
4449 target_link_libraries(mir_demo_client_cursors
4450 eglapp
4451 )
4452+mir_add_wrapped_executable(mir_demo_client_eglstateswitcher
4453+ eglstateswitcher.c
4454+)
4455+target_link_libraries(mir_demo_client_eglstateswitcher
4456+ eglapp
4457+)
4458
4459 mir_add_wrapped_executable(mir_demo_client_basic
4460 basic.c
4461@@ -164,3 +171,20 @@
4462 mirserver
4463 mircommon
4464 )
4465+
4466+# FIXME: Bug not fixed yet.
4467+if (MIR_ENABLE_TESTS AND MIR_TEST_CLIENT_ABI)
4468+ # Regression tests for LP: #1415321
4469+
4470+ # To see reasons for failure: ctest -V -R Clients-only-use-client-symbols
4471+ add_test(NAME Clients-only-use-client-symbols
4472+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
4473+ COMMAND /bin/sh -c "!(nm -u .mir_demo_client_* mir_demo_client* | grep -v @@MIR_CLIENT | grep 'U mir_')"
4474+ )
4475+
4476+ # To see reasons for failure: ctest -V -R Clients-only-use-client-ABI
4477+ add_test(NAME Clients-only-use-client-ABI
4478+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
4479+ COMMAND /bin/sh -c "!(objdump -p .mir_demo_client_* mir_demo_client* | grep NEEDED | grep libmir | grep -v libmirclient)"
4480+ )
4481+endif ()
4482
4483=== modified file 'examples/eglapp.c'
4484--- examples/eglapp.c 2014-12-18 18:24:45 +0000
4485+++ examples/eglapp.c 2015-02-09 23:59:09 +0000
4486@@ -16,6 +16,8 @@
4487 * Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
4488 */
4489
4490+#define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
4491+
4492 #include "eglapp.h"
4493 #include "mir_toolkit/mir_client_library.h"
4494 #include <stdio.h>
4495@@ -144,6 +146,10 @@
4496 */
4497 printf("Resized to %dx%d\n", ev->resize.width, ev->resize.height);
4498 break;
4499+ case mir_event_type_close_surface:
4500+ printf("Received close event from server.\n");
4501+ running = 0;
4502+ break;
4503 default:
4504 break;
4505 }
4506
4507=== added file 'examples/eglstateswitcher.c'
4508--- examples/eglstateswitcher.c 1970-01-01 00:00:00 +0000
4509+++ examples/eglstateswitcher.c 2015-02-09 23:59:09 +0000
4510@@ -0,0 +1,101 @@
4511+/*
4512+ * Trivial GL demo; switches surface states. Showing how simple life is with eglapp.
4513+ *
4514+ * Copyright © 2014 Canonical Ltd.
4515+ *
4516+ * This program is free software: you can redistribute it and/or modify
4517+ * it under the terms of the GNU General Public License version 3 as
4518+ * published by the Free Software Foundation.
4519+ *
4520+ * This program is distributed in the hope that it will be useful,
4521+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4522+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4523+ * GNU General Public License for more details.
4524+ *
4525+ * You should have received a copy of the GNU General Public License
4526+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4527+ *
4528+ * Author: Alan Griffiths <alan@octopull.co.uk>
4529+ */
4530+
4531+#include "eglapp.h"
4532+#include <mir_toolkit/mir_client_library.h>
4533+
4534+#include <stdio.h>
4535+#include <unistd.h>
4536+#include <GLES2/gl2.h>
4537+
4538+static void toggle_surface_state(MirSurface* const surface, MirSurfaceState* state);
4539+
4540+typedef struct Color
4541+{
4542+ GLfloat r, g, b, a;
4543+} Color;
4544+
4545+int main(int argc, char *argv[])
4546+{
4547+ float const opacity = mir_eglapp_background_opacity;
4548+ Color const orange = {0.866666667f, 0.282352941f, 0.141414141f, opacity};
4549+
4550+ unsigned int width = 120, height = 120;
4551+
4552+ if (!mir_eglapp_init(argc, argv, &width, &height))
4553+ return 1;
4554+
4555+ MirSurface* const surface = mir_eglapp_native_surface();
4556+ MirSurfaceState state = mir_surface_get_state(surface);
4557+
4558+ /* This is probably the simplest GL you can do */
4559+ while (mir_eglapp_running())
4560+ {
4561+ glClearColor(orange.r, orange.g, orange.b, orange.a);
4562+ glClear(GL_COLOR_BUFFER_BIT);
4563+ mir_eglapp_swap_buffers();
4564+ sleep(2);
4565+
4566+ toggle_surface_state(surface, &state);
4567+ }
4568+
4569+ mir_eglapp_shutdown();
4570+
4571+ return 0;
4572+}
4573+
4574+#define NEW_STATE(new_state)\
4575+ puts("Requesting state: " #new_state);\
4576+ *state = new_state
4577+
4578+void toggle_surface_state(MirSurface* const surface, MirSurfaceState* state)
4579+{
4580+ switch (*state)
4581+ {
4582+ case mir_surface_state_restored:
4583+ NEW_STATE(mir_surface_state_unknown);
4584+ break;
4585+
4586+ case mir_surface_state_minimized:
4587+ NEW_STATE(mir_surface_state_restored);
4588+ break;
4589+
4590+ case mir_surface_state_fullscreen:
4591+ NEW_STATE(mir_surface_state_vertmaximized);
4592+ break;
4593+
4594+ case mir_surface_state_maximized:
4595+ NEW_STATE(mir_surface_state_fullscreen);
4596+ break;
4597+
4598+ case mir_surface_state_vertmaximized:
4599+ NEW_STATE(mir_surface_state_horizmaximized);
4600+ break;
4601+
4602+ case mir_surface_state_horizmaximized:
4603+ NEW_STATE(mir_surface_state_minimized);
4604+ break;
4605+
4606+ default:
4607+ NEW_STATE(mir_surface_state_maximized);
4608+ break;
4609+ }
4610+ mir_surface_set_state(surface, *state);
4611+}
4612
4613=== modified file 'examples/fingerpaint.c'
4614--- examples/fingerpaint.c 2014-12-17 00:08:22 +0000
4615+++ examples/fingerpaint.c 2015-02-09 23:59:09 +0000
4616@@ -212,18 +212,38 @@
4617 static float max_pressure = 1.0f;
4618
4619 MirInputEvent const* input_event = mir_event_get_input_event(event);
4620- if (mir_input_event_get_type(input_event) != mir_input_event_type_touch)
4621- return;
4622- MirTouchInputEvent const* tev = mir_input_event_get_touch_input_event(input_event);
4623- unsigned touch_count = mir_touch_input_event_get_touch_count(tev);
4624-
4625- if (touch_count == 1 && mir_touch_input_event_get_touch_action(tev, 0) == mir_touch_input_event_action_up)
4626+ MirTouchInputEvent const* tev = NULL;
4627+ MirPointerInputEvent const* pev = NULL;
4628+ unsigned touch_count = 0;
4629+ bool ended = false;
4630+ MirInputEventType type = mir_input_event_get_type(input_event);
4631+
4632+ switch (type)
4633+ {
4634+ case mir_input_event_type_touch:
4635+ tev = mir_input_event_get_touch_input_event(input_event);
4636+ touch_count = mir_touch_input_event_get_touch_count(tev);
4637+ ended = touch_count == 1 &&
4638+ (mir_touch_input_event_get_touch_action(tev, 0) ==
4639+ mir_touch_input_event_action_up);
4640+ break;
4641+ case mir_input_event_type_pointer:
4642+ pev = mir_input_event_get_pointer_input_event(input_event);
4643+ ended = mir_pointer_input_event_get_action(pev) ==
4644+ mir_pointer_input_event_action_button_up;
4645+ touch_count = mir_pointer_input_event_get_button_state(pev,
4646+ mir_pointer_input_button_primary) ? 1 : 0;
4647+ default:
4648+ break;
4649+ }
4650+
4651+ if (ended)
4652 {
4653 base_color = (base_color + max_fingers) %
4654 (sizeof(color)/sizeof(color[0]));
4655 max_fingers = 0;
4656 }
4657- else
4658+ else if (touch_count)
4659 {
4660 size_t p;
4661
4662@@ -232,13 +252,33 @@
4663
4664 for (p = 0; p < touch_count; p++)
4665 {
4666- int x = mir_touch_input_event_get_touch_axis_value(tev, p, mir_touch_input_axis_x);
4667- int y = mir_touch_input_event_get_touch_axis_value(tev, p, mir_touch_input_axis_y);
4668- float size = mir_touch_input_event_get_touch_axis_value(tev, p, mir_touch_input_axis_size);
4669- float pressure = mir_touch_input_event_get_touch_axis_value(tev, p, mir_touch_input_axis_pressure);
4670-
4671- int radius = size * 50.0f
4672- + 1.0f;
4673+ int x = 0;
4674+ int y = 0;
4675+ int radius = 1;
4676+ float pressure = 1.0f;
4677+
4678+ if (tev != NULL)
4679+ {
4680+ x = mir_touch_input_event_get_touch_axis_value(tev, p,
4681+ mir_touch_input_axis_x);
4682+ y = mir_touch_input_event_get_touch_axis_value(tev, p,
4683+ mir_touch_input_axis_y);
4684+ float size = mir_touch_input_event_get_touch_axis_value(
4685+ tev, p, mir_touch_input_axis_size);
4686+ pressure = mir_touch_input_event_get_touch_axis_value(tev,
4687+ p, mir_touch_input_axis_pressure);
4688+ radius = size * 50.0f + 1.0f;
4689+ }
4690+ else if (pev != NULL)
4691+ {
4692+ x = mir_pointer_input_event_get_axis_value(pev,
4693+ mir_pointer_input_axis_x);
4694+ y = mir_pointer_input_event_get_axis_value(pev,
4695+ mir_pointer_input_axis_y);
4696+ pressure = 0.5f;
4697+ radius = 5;
4698+ }
4699+
4700 size_t c = (base_color + p) %
4701 (sizeof(color)/sizeof(color[0]));
4702 Color tone = color[c];
4703@@ -254,6 +294,19 @@
4704 redraw(surface, canvas);
4705 }
4706 }
4707+ else if (event_type == mir_event_type_close_surface)
4708+ {
4709+ static int closing = 0;
4710+
4711+ ++closing;
4712+ if (closing == 1)
4713+ printf("Sure you don't want to save your work?\n");
4714+ else if (closing > 1)
4715+ {
4716+ printf("Oh I forgot you can't save your work. Quitting now...\n");
4717+ running = 0;
4718+ }
4719+ }
4720 else if (event_type == mir_event_type_resize)
4721 {
4722 /* FIXME: https://bugs.launchpad.net/mir/+bug/1194384
4723
4724=== modified file 'examples/render_overlays.cpp'
4725--- examples/render_overlays.cpp 2014-12-19 02:31:34 +0000
4726+++ examples/render_overlays.cpp 2015-02-09 23:59:09 +0000
4727@@ -162,16 +162,6 @@
4728 return false;
4729 }
4730
4731- bool visible() const override
4732- {
4733- return true;
4734- }
4735-
4736- int buffers_ready_for_compositor() const override
4737- {
4738- return 1;
4739- }
4740-
4741 private:
4742 std::shared_ptr<DemoOverlayClient> const client;
4743 geom::Rectangle const position;
4744
4745=== modified file 'examples/server_example.cpp'
4746--- examples/server_example.cpp 2015-01-05 14:20:50 +0000
4747+++ examples/server_example.cpp 2015-02-09 23:59:09 +0000
4748@@ -83,10 +83,6 @@
4749 {
4750 mir::Server server;
4751
4752- // Create some input filters (we need to keep them or they deactivate)
4753- auto const quit_filter = me::make_quit_filter_for(server);
4754- auto const printing_filter = me::make_printing_input_filter_for(server);
4755-
4756 // Add example options for display layout, logging, launching clients and timeout
4757 me::add_display_configuration_options_to(server);
4758 me::add_log_host_lifecycle_option_to(server);
4759@@ -98,6 +94,10 @@
4760 std::atomic<bool> test_failed{false};
4761 me::add_test_client_option_to(server, test_failed);
4762
4763+ // Create some input filters (we need to keep them or they deactivate)
4764+ auto const quit_filter = me::make_quit_filter_for(server);
4765+ auto const printing_filter = me::make_printing_input_filter_for(server);
4766+
4767 // Provide the command line and run the server
4768 server.set_command_line(argc, argv);
4769 server.apply_settings();
4770
4771=== added file 'examples/server_example_window_management.cpp'
4772--- examples/server_example_window_management.cpp 1970-01-01 00:00:00 +0000
4773+++ examples/server_example_window_management.cpp 2015-02-09 23:59:09 +0000
4774@@ -0,0 +1,703 @@
4775+/*
4776+ * Copyright © 2014 Canonical Ltd.
4777+ *
4778+ * This program is free software: you can redistribute it and/or modify it
4779+ * under the terms of the GNU General Public License version 3,
4780+ * as published by the Free Software Foundation.
4781+ *
4782+ * This program is distributed in the hope that it will be useful,
4783+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4784+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4785+ * GNU General Public License for more details.
4786+ *
4787+ * You should have received a copy of the GNU General Public License
4788+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4789+ *
4790+ * Authored By: Alan Griffiths <alan@octopull.co.uk>
4791+ */
4792+
4793+#define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
4794+
4795+#include "server_example_window_management.h"
4796+#include "server_example_fullscreen_placement_strategy.h"
4797+
4798+#include "mir/abnormal_exit.h"
4799+#include "mir/server.h"
4800+#include "mir/geometry/rectangles.h"
4801+#include "mir/geometry/displacement.h"
4802+#include "mir/input/composite_event_filter.h"
4803+#include "mir/options/option.h"
4804+#include "mir/scene/session_listener.h"
4805+#include "mir/shell/focus_controller.h"
4806+
4807+#include <linux/input.h>
4808+
4809+#include <map>
4810+#include <vector>
4811+#include <mutex>
4812+
4813+namespace mc = mir::compositor;
4814+namespace me = mir::examples;
4815+namespace mg = mir::graphics;
4816+namespace mi = mir::input;
4817+namespace ms = mir::scene;
4818+namespace msh = mir::shell;
4819+using namespace mir::geometry;
4820+
4821+///\example server_example_window_management.cpp
4822+/// Demonstrate simple window management strategies
4823+
4824+char const* const me::wm_option = "window-manager";
4825+char const* const me::wm_description = "window management strategy [{tiling|fullscreen}]";
4826+
4827+namespace
4828+{
4829+char const* const wm_tiling = "tiling";
4830+char const* const wm_fullscreen = "fullscreen";
4831+
4832+// Very simple - make every surface fullscreen
4833+class FullscreenWindowManager : public me::WindowManager, me::FullscreenPlacementStrategy
4834+{
4835+public:
4836+ using me::FullscreenPlacementStrategy::FullscreenPlacementStrategy;
4837+
4838+private:
4839+ void add_surface(std::shared_ptr<ms::Surface> const&, ms::Session*) override {}
4840+
4841+ void remove_surface(std::weak_ptr<ms::Surface> const&, ms::Session*) override {}
4842+
4843+ void add_session(std::shared_ptr<ms::Session> const&) override {}
4844+
4845+ void remove_session(std::shared_ptr<ms::Session> const&) override {}
4846+
4847+ void add_display(Rectangle const&) override {}
4848+
4849+ void remove_display(Rectangle const&) override {}
4850+
4851+ void click(Point) override {}
4852+
4853+ void drag(Point) override {}
4854+
4855+ void resize(Point) override {}
4856+
4857+ void toggle(MirSurfaceState) override {}
4858+
4859+ int select_attribute_value(ms::Surface const&, MirSurfaceAttrib, int requested_value) override
4860+ { return requested_value; }
4861+
4862+ void attribute_set(ms::Surface const&, MirSurfaceAttrib, int) override {}
4863+};
4864+
4865+// simple tiling algorithm:
4866+// o Switch apps: tap or click on the corresponding tile
4867+// o Move window: Alt-leftmousebutton drag
4868+// o Resize window: Alt-middle_button drag
4869+// o Maximize/restore current window (to tile size): Alt-F11
4870+// o Maximize/restore current window (to tile height): Shift-F11
4871+// o Maximize/restore current window (to tile width): Ctrl-F11
4872+// o client requests to maximize, vertically maximize & restore
4873+class TilingWindowManager : public me::WindowManager
4874+{
4875+public:
4876+ // We can't take the msh::FocusController directly as we create a WindowManager
4877+ // in the_session_listener() and that is called when creating the focus controller
4878+ using FocusControllerFactory = std::function<std::shared_ptr<msh::FocusController>()>;
4879+
4880+ explicit TilingWindowManager(FocusControllerFactory const& focus_controller) :
4881+ focus_controller{focus_controller}
4882+ {
4883+ }
4884+
4885+ auto place(ms::Session const& session, ms::SurfaceCreationParameters const& request_parameters)
4886+ -> ms::SurfaceCreationParameters override
4887+ {
4888+ auto parameters = request_parameters;
4889+
4890+ std::lock_guard<decltype(mutex)> lock(mutex);
4891+ auto const ptile = session_info.find(&session);
4892+ if (ptile != end(session_info))
4893+ {
4894+ Rectangle const& tile = ptile->second.tile;
4895+ parameters.top_left = parameters.top_left + (tile.top_left - Point{0, 0});
4896+
4897+ clip_to_tile(parameters, tile);
4898+ }
4899+
4900+ return parameters;
4901+ }
4902+
4903+ void add_surface(
4904+ std::shared_ptr<ms::Surface> const& surface,
4905+ ms::Session* session) override
4906+ {
4907+ std::lock_guard<decltype(mutex)> lock(mutex);
4908+ session_info[session].surfaces.push_back(surface);
4909+ surface_info[surface].session = session_info[session].session;
4910+ surface_info[surface].state = mir_surface_state_restored;
4911+ }
4912+
4913+ void remove_surface(
4914+ std::weak_ptr<ms::Surface> const& surface,
4915+ ms::Session* session) override
4916+ {
4917+ std::lock_guard<decltype(mutex)> lock(mutex);
4918+ auto& surfaces = session_info[session].surfaces;
4919+
4920+ for (auto i = begin(surfaces); i != end(surfaces); ++i)
4921+ {
4922+ if (surface.lock() == i->lock())
4923+ {
4924+ surfaces.erase(i);
4925+ break;
4926+ }
4927+ }
4928+
4929+ surface_info.erase(surface);
4930+ }
4931+
4932+ void add_session(std::shared_ptr<ms::Session> const& session) override
4933+ {
4934+ std::lock_guard<decltype(mutex)> lock(mutex);
4935+ session_info[session.get()] = session;
4936+ update_tiles();
4937+ }
4938+
4939+ void remove_session(std::shared_ptr<ms::Session> const& session) override
4940+ {
4941+ std::lock_guard<decltype(mutex)> lock(mutex);
4942+ session_info.erase(session.get());
4943+ update_tiles();
4944+ }
4945+
4946+ void add_display(Rectangle const& area) override
4947+ {
4948+ std::lock_guard<decltype(mutex)> lock(mutex);
4949+ displays.add(area);
4950+ update_tiles();
4951+ }
4952+
4953+ void remove_display(Rectangle const& area) override
4954+ {
4955+ std::lock_guard<decltype(mutex)> lock(mutex);
4956+ displays.remove(area);
4957+ update_tiles();
4958+ }
4959+
4960+ void click(Point cursor) override
4961+ {
4962+ std::lock_guard<decltype(mutex)> lock(mutex);
4963+
4964+ if (auto const session = session_under(cursor))
4965+ focus_controller()->set_focus_to(session);
4966+
4967+ old_cursor = cursor;
4968+ }
4969+
4970+ void drag(Point cursor) override
4971+ {
4972+ std::lock_guard<decltype(mutex)> lock(mutex);
4973+
4974+ if (auto const session = session_under(cursor))
4975+ {
4976+ if (session == session_under(old_cursor))
4977+ {
4978+ auto const& info = session_info[session.get()];
4979+
4980+ if (drag(old_surface.lock(), cursor, old_cursor, info.tile))
4981+ {
4982+ // Still dragging the same old_surface
4983+ }
4984+ else if (drag(session->default_surface(), cursor, old_cursor, info.tile))
4985+ {
4986+ old_surface = session->default_surface();
4987+ }
4988+ else
4989+ {
4990+ for (auto const& ps : info.surfaces)
4991+ {
4992+ auto const new_surface = ps.lock();
4993+
4994+ if (drag(new_surface, cursor, old_cursor, info.tile))
4995+ {
4996+ old_surface = new_surface;
4997+ break;
4998+ }
4999+ }
5000+ }
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: