[Merge] lp:~ricmm/platform-api/v2-dynamic-refactor into lp:platform-api

Ricardo Salveti rsalveti at rsalveti.net
Wed May 28 22:29:40 UTC 2014


Review: Needs Fixing



Diff comments:

> === modified file 'CMakeLists.txt'
> --- CMakeLists.txt	2014-05-22 15:12:16 +0000
> +++ CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -2,8 +2,8 @@
>  
>  project(ubuntu-platform-api)
>  
> -set(UBUNTU_PLATFORM_API_VERSION_MAJOR 1)
> -set(UBUNTU_PLATFORM_API_VERSION_MINOR 2)
> +set(UBUNTU_PLATFORM_API_VERSION_MAJOR 2)
> +set(UBUNTU_PLATFORM_API_VERSION_MINOR 0)
>  set(UBUNTU_PLATFORM_API_VERSION_PATCH 0)
>  
>  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
> @@ -57,37 +57,17 @@
>    ON
>  )
>  
> -option(
> -  ENABLE_MIRSERVER_IMPLEMENTATION
> -  "Enable mirserver based platorm API implementation"
> -  OFF
> -)
> -
> -if(ENABLE_MIRSERVER_IMPLEMENTATION)
> -  find_package(PkgConfig)
> -  pkg_check_modules(MIRSERVER REQUIRED mirserver)
> -endif(ENABLE_MIRSERVER_IMPLEMENTATION)
> -
> -option(
> -  ENABLE_MIRCLIENT_IMPLEMENTATION
> -  "Enable mirclient based platform API implementation"
> -  OFF
> -)
> -
> -if(ENABLE_MIRCLIENT_IMPLEMENTATION)
> -  find_package(PkgConfig)
> -  pkg_check_modules(MIRCLIENT REQUIRED mirclient)
> -
> -  find_package(Protobuf REQUIRED)
> -  if(PROTOBUF_PROTOC_EXECUTABLE STREQUAL "PROTOBUF_PROTOC_EXECUTABLE-NOTFOUND")
> -    message(SEND_ERROR "protoc executable not found! Missing protobuf-compiler package?")
> -  endif()
> -endif(ENABLE_MIRCLIENT_IMPLEMENTATION)
> -
> -if(ENABLE_MIRCLIENT_IMPLEMENTATION OR ENABLE_MIRSERVER_IMPLEMENTATION)
> -  pkg_check_modules(MIRCOMMON REQUIRED mircommon)
> +find_package(PkgConfig)
> +pkg_check_modules(MIRSERVER REQUIRED mirserver)
> +pkg_check_modules(MIRCLIENT REQUIRED mirclient)
> +
> +find_package(Protobuf REQUIRED)
> +if(PROTOBUF_PROTOC_EXECUTABLE STREQUAL "PROTOBUF_PROTOC_EXECUTABLE-NOTFOUND")
> +  message(SEND_ERROR "protoc executable not found! Missing protobuf-compiler package?")
>  endif()
>  
> +pkg_check_modules(MIRCOMMON REQUIRED mircommon)
> +
>  # Try to find hybris, and disable hybris from build if not found
>  find_library(Hybris
>    NAMES hybris-common
> @@ -105,6 +85,7 @@
>  add_subdirectory(doc/)
>  add_subdirectory(include/)
>  add_subdirectory(src/)
> +add_subdirectory(examples/)
>  
>  #### Enable tests
>  include(CTest)
> 
> === modified file 'debian/changelog'
> --- debian/changelog	2014-05-22 15:29:47 +0000
> +++ debian/changelog	2014-05-28 14:34:51 +0000
> @@ -1,3 +1,13 @@
> +platform-api (2.0.0-0ubuntu1) UNRELEASED; urgency=medium
> +
> +  * Bump API version to 2.0
> +  * Introduce support for dynamic backend loading
> +  * Package naming changes
> +  * Further support for test backend
> +  * Unified bridge
> +
> + -- Ricardo Mendoza <ricardo.mendoza at canonical.com>  Mon, 19 May 2014 16:53:45 +0200
> +
>  platform-api (1.2.0+14.10.20140522.1-0ubuntu1) utopic; urgency=medium
>  
>    [ Manuel de la Pena ]
> 
> === modified file 'debian/control'
> --- debian/control	2014-05-21 07:15:34 +0000
> +++ debian/control	2014-05-28 14:34:51 +0000
> @@ -27,9 +27,11 @@
>  # just go ahead.  ~phablet-team will notice and sync up the code again.
>  Vcs-Browser: https://code.launchpad.net/platform-api
>  
> -Package: libplatform-api-headers
> +Package: libubuntu-application-api-headers
>  Section: libdevel
>  Architecture: any
> +Replaces: libplatform-api-headers (<< 2.0.0)
> +Breaks: libplatform-api-headers (<< 2.0.0)
>  Pre-Depends: ${misc:Pre-Depends},
>  Multi-Arch: same
>  Depends: ${misc:Depends},
> @@ -40,9 +42,11 @@
>   should build depend on the libplatform-api-dev package instead, which
>   will pull this package as well.
>  
> -Package: libplatform-hardware-api-headers
> +Package: libubuntu-platform-hardware-api-headers
>  Section: libdevel
>  Architecture: any
> +Replaces: libplatform-hardware-api-headers (<< 2.0.0)
> +Breaks: libplatform-hardware-api-headers (<< 2.0.0)
>  Pre-Depends: ${misc:Pre-Depends},
>  Multi-Arch: same
>  Depends: ${misc:Depends},
> @@ -51,75 +55,79 @@
>   This package provides the library headers for the hw-access parts of the Platform API.
>   .
>   Unless a new backend for the Platform API is developed, packages
> - should build depend on the libplatform-hardware-api-dev package instead, which
> + should build depend on the libubuntu-platform-hardware-api-dev package instead, which
>   will pull this package as well.
>  
> -Package: libplatform-api1-dev
> +Package: libubuntu-application-api-dev
>  Section: libdevel
>  Architecture: any
> +Replaces: libplatform-api1-dev (<< 2.0.0)
> +Breaks: libplatform-api1-dev (<< 2.0.0)
>  Pre-Depends: ${misc:Pre-Depends},
>  Multi-Arch: same
>  Depends: ${misc:Depends},
>           libgles2-mesa-dev,
> -         libplatform-api-headers (= ${binary:Version}),
> -         libubuntu-application-api1 | libplatform-api1,
> -         libubuntu-application-api-mirserver1 (= ${binary:Version}),
> -         libubuntu-application-api-mirclient1 (= ${binary:Version}),
> +         libubuntu-application-api-headers (= ${binary:Version}),
> +         libubuntu-application-api2,
> +         ubuntu-application-api2-touch (= ${binary:Version}),
> +         ubuntu-application-api2-desktop (= ${binary:Version}),
>           ${misc:Depends},
> -Suggests: libplatform-api1-doc,
> -Description: Platform API for system level capabilities (development)
> +Suggests: libubuntu-application-api-doc,
> +Description: Ubuntu Application API for system level capabilities (development)

Missing breaks.

>   This package provides the development library and headers (via
> - dependency) for the Platform API.
> -
> -Package: libubuntu-application-api-mirserver1
> -Section: libs
> -Pre-Depends: ${misc:Pre-Depends},
> -Multi-Arch: same
> -Architecture: any
> -Depends: ${misc:Depends},
> -         ${shlibs:Depends},
> -Description: Implementation of the Platform API for a Mir server
> - This package provides the implementation of the Platform API to
> - provide a server instance of Mir.
> -
> -Package: libubuntu-application-api-mirclient1
> -Section: libs
> -Pre-Depends: ${misc:Pre-Depends},
> -Multi-Arch: same
> -Architecture: any
> -Depends: ${misc:Depends},
> -         ${shlibs:Depends},
> -Description: Implementation of the Platform API for a Mir client
> - This package provides the implementation of the Platform API to
> - allow a client to connect to a Mir server.
> -
> -Package: libplatform-hardware-api1-dev
> + dependency) for the Ubuntu Application API.
> +
> +Package: ubuntu-application-api2-touch
> +Section: libs
> +Pre-Depends: ${misc:Pre-Depends},
> +Multi-Arch: same
> +Architecture: any
> +Depends: ${misc:Depends},
> +         ${shlibs:Depends},
> +         libubuntu-application-api2 (= ${binary:Version}),
> +Description: Implementation of the Platform API for Ubuntu Touch
> + This package provides the implementation of the Platform API to
> + bring up an Ubuntu Touch system.
> +
> +Package: ubuntu-application-api2-desktop
> +Section: libs
> +Pre-Depends: ${misc:Pre-Depends},
> +Multi-Arch: same
> +Architecture: any
> +Depends: ${misc:Depends},
> +         ${shlibs:Depends},
> +         libubuntu-application-api2 (= ${binary:Version}),
> +Description: Implementation of the Platform API for Ubuntu Desktop
> + This package provides the implementation of the Platform API to
> + bring up an Ubuntu Desktop system.
> +
> +Package: libubuntu-platform-hardware-api-dev
>  Section: libdevel
>  Architecture: any
> +Replaces: libplatform-hardware-api1-dev

Missing breaks and transitional package (if you get any conflicting files).

>  Pre-Depends: ${misc:Pre-Depends},
>  Multi-Arch: same
>  Depends: ${misc:Depends},
>           libgles2-mesa-dev,
> -         libplatform-hardware-api-headers (= ${binary:Version}),
> -         libubuntu-platform-hardware-api1 | libplatform-hardware-api1,
> -Suggests: libplatform-api1-doc,
> +         libubuntu-platform-hardware-api-headers (= ${binary:Version}),
> +         libubuntu-platform-hardware-api2
> +Suggests: libubuntu-application-api-doc,
>  Description: Platform API for system level capabilities (development)
>   This package provides the development library and headers (via
>   dependency) for the hw-access portions of the Platform API.
>  
> -Package: libplatform-api1-doc
> +Package: libubuntu-application-api-doc
>  Section: doc
>  Architecture: all
> +Replaces: libplatform-api1-doc

Missing breaks.

>  Depends: ${misc:Depends},
> -         libplatform-api1-dev,
> +         libubuntu-application-api-dev,
>  Description: Platform API for system level capabilities (development)
>   This package provides the developer documentation for the Platform API.
>  
> -Package: libubuntu-platform-hardware-api1
> +Package: libubuntu-platform-hardware-api2
>  Section: libs
>  Architecture: any
> -Replaces: libplatform-hardware-api1-hybris (<< 0.18.3)
> -Breaks: libplatform-hardware-api1-hybris (<< 0.18.3)
>  Pre-Depends: ${misc:Pre-Depends},
>  Multi-Arch: same
>  Depends: ${misc:Depends},
> @@ -130,11 +138,9 @@
>   The produced library should be used via libhybris, to communicate with the
>   Android userspace, which is where the device drivers live.
>  
> -Package: libubuntu-application-api1
> +Package: libubuntu-application-api2
>  Section: libs
>  Architecture: any
> -Replaces: libplatform-api1-hybris (<< 0.18.3)
> -Breaks: libplatform-api1-hybris (<< 0.18.3)
>  Pre-Depends: ${misc:Pre-Depends},
>  Multi-Arch: same
>  Depends: ${misc:Depends},
> @@ -145,13 +151,14 @@
>   The produced library should be used via libhybris, to communicate with the
>   Android userspace, which is where the Ubuntu Application Manager lives.
>  
> -Package: libubuntu-application-api-test1
> +Package: ubuntu-application-api2-test

Package renaming, make sure to break and provides if the files are conflicting with each other (plus transitional package).

>  Section: libs
>  Architecture: any
>  Pre-Depends: ${misc:Pre-Depends},
>  Multi-Arch: same
>  Depends: ${misc:Depends},
>           ${shlibs:Depends},
> +         libubuntu-application-api2 (= ${binary:Version}),
>  Description: test implementation of the Platform API
>   This package provides an implementation of the Platform API for testing. It
>   does not communicate with actual hardware, but reads input from a text file.
> @@ -161,40 +168,57 @@
>   .
>   For now this provides simulated sensors.
>  
> +Package: ubuntu-application-api2-examples
> +Architecture: any
> +Replaces: libplatform-api1-hybris-tests
> +Breaks: libplatform-api1-hybris-tests
> +Depends: ${misc:Depends},
> +         ${shlibs:Depends},
> +         ubuntu-application-api2-test,
> +         ubuntu-application-api2-touch | ubuntu-application-api2-desktop,
> +Description: Binary examples for Ubuntu Application API
> + This package provides a set of example programs that excercise most the
> + set of APIs provided by the Application API.
> +
> +Package: libplatform-api-headers
> +Section: oldlibs
> +Architecture: all
> +Depends: libubuntu-application-api-headers,
> +         ${misc:Depends},
> +Description: dummy transitional package for libplatform-api-headers
> + This is a dummy transitional package, please use libubuntu-application-api-headers
> + instead.
> +
> +Package: libplatform-hardware-api-headers
> +Section: oldlibs
> +Architecture: all
> +Depends: libubuntu-platform-hardware-api-headers,
> +         ${misc:Depends},
> +Description: dummy transitional package for libplatform-hardware-api-headers
> + This is a dummy transitional package, please use libubuntu-platform-hardware-api-headers
> + instead.
> +
> +Package: libplatform-api1-dev
> +Section: oldlibs
> +Architecture: all
> +Depends: libubuntu-application-api-dev,
> +         ${misc:Depends},
> +Description: dummy transitional package for libplatform-api1-dev
> + This is a dummy transitional package, please use libubuntu-application-api-dev
> +
>  Package: libplatform-api1-hybris-tests
> -Architecture: any
> -Depends: ${misc:Depends},
> -         ${shlibs:Depends},
> -         libubuntu-application-api1 (= ${binary:Version}),
> -Description: Hybris implementation of the Platform API (tests)
> - This package provides the test cases for the hybris implementation
> - of the Platform API.
> -
> -Package: libubuntu-platform-api1-dev
> -Section: oldlibs
> -Architecture: all
> -Depends: ${misc:Depends},
> -         libplatform-api1-dev (= ${binary:Version}),
> -Description: dummy transitional package for libplatform-api1-dev
> - This is dummy transitional package, please use libplatform-api1-dev instead.
> - .
> - This package can be safely removed.
> -
> -Package: libplatform-api1-hybris
> -Section: oldlibs
> -Architecture: all
> -Depends: libubuntu-application-api1,
> -         ${misc:Depends},
> -Description: dummy transitional package for libplatform-api1-hybris
> - This is a dummy transitional package, please use libubuntu-application-api1
> - instead.
> -
> -Package: libplatform-hardware-api1-hybris
> -Section: oldlibs
> -Architecture: all
> -Depends: libubuntu-platform-hardware-api1,
> -         ${misc:Depends},
> -Description: dummy transitional package for libplatform-hardware-api1-hybris
> - This is a dummy transitional package, please use libubuntu-platform-hardware-api1
> - instead.
> +Section: oldlibs
> +Architecture: all
> +Depends: ubuntu-application-api2-examples,
> +         ${misc:Depends},
> +Description: dummy transitional package for libplatform-api1-hybris-tests
> + This is a dummy transitional package, please use ubuntu-application-api2-examples
> +
> +Package: libplatform-api1-doc
> +Section: oldlibs
> +Architecture: all
> +Depends: libubuntu-application-api-doc,
> +         ${misc:Depends},
> +Description: dummy transitional package for libplatform-api1-doc
> + This is a dummy transitional package, please use libubuntu-application-api-doc
>  
> 
> === removed file 'debian/libplatform-api1-hybris-tests.install'
> --- debian/libplatform-api1-hybris-tests.install	2014-04-04 15:27:22 +0000
> +++ debian/libplatform-api1-hybris-tests.install	1970-01-01 00:00:00 +0000
> @@ -1,7 +0,0 @@
> -usr/bin/test_android_gps_api
> -usr/bin/test_android_sensors_api
> -usr/bin/test_android_ubuntu_app_api
> -usr/bin/test_android_ubuntu_app_api_multiple_surfaces
> -usr/bin/test_android_ubuntu_session_api
> -usr/bin/test_ubuntu_app_api_location_service
> -usr/bin/test_hardware_alarms_api
> 
> === renamed file 'debian/libplatform-api1-dev.install' => 'debian/libubuntu-application-api-dev.install'
> --- debian/libplatform-api1-dev.install	2013-08-23 13:53:42 +0000
> +++ debian/libubuntu-application-api-dev.install	2014-05-28 14:34:51 +0000
> @@ -1,4 +1,2 @@
>  usr/lib/*/libubuntu_application_api.so
> -usr/lib/*/libubuntu_application_api_mirclient.so
> -usr/lib/*/libubuntu_application_api_mirserver.so
>  usr/lib/*/pkgconfig/ubuntu-platform-api.pc
> 
> === renamed file 'debian/libplatform-api1-doc.doc-base' => 'debian/libubuntu-application-api-doc.doc-base'
> === renamed file 'debian/libplatform-api1-doc.install' => 'debian/libubuntu-application-api-doc.install'
> --- debian/libplatform-api1-doc.install	2013-07-05 13:50:50 +0000
> +++ debian/libubuntu-application-api-doc.install	2014-05-28 14:34:51 +0000
> @@ -1,1 +1,1 @@
> -usr/share/doc/ubuntu-platform-api
> \ No newline at end of file
> +usr/share/doc/ubuntu-platform-api
> 
> === renamed file 'debian/libplatform-api-headers.install' => 'debian/libubuntu-application-api-headers.install'
> --- debian/libplatform-api-headers.install	2014-01-09 18:47:45 +0000
> +++ debian/libubuntu-application-api-headers.install	2014-05-28 14:34:51 +0000
> @@ -2,6 +2,7 @@
>  usr/include/ubuntu/unit.h
>  usr/include/ubuntu/visibility.h
>  usr/include/ubuntu/application
> +usr/include/ubuntu/application/init.h
>  usr/include/ubuntu/ui
>  usr/include/ubuntu/application/location
>  usr/include/ubuntu/application/url_dispatcher
> 
> === removed file 'debian/libubuntu-application-api-mirclient1.install'
> --- debian/libubuntu-application-api-mirclient1.install	2013-08-08 17:41:19 +0000
> +++ debian/libubuntu-application-api-mirclient1.install	1970-01-01 00:00:00 +0000
> @@ -1,1 +0,0 @@
> -usr/lib/*/libubuntu_application_api_mirclient.so.*
> 
> === removed file 'debian/libubuntu-application-api-mirclient1.symbols'
> --- debian/libubuntu-application-api-mirclient1.symbols	2013-09-23 05:39:42 +0000
> +++ debian/libubuntu-application-api-mirclient1.symbols	1970-01-01 00:00:00 +0000
> @@ -1,126 +0,0 @@
> -libubuntu_application_api_mirclient.so.1 libubuntu-application-api-mirclient1 #MINVER#
> - u_application_description_destroy at Base 0.18.3+13.10.20130813
> - u_application_description_get_application_id at Base 0.18.3+13.10.20130813
> - u_application_description_get_application_lifecycle_delegate at Base 0.18.3+13.10.20130813
> - u_application_description_new at Base 0.18.3+13.10.20130813
> - u_application_description_set_application_id at Base 0.18.3+13.10.20130813
> - u_application_description_set_application_lifecycle_delegate at Base 0.18.3+13.10.20130813
> - u_application_id_compare at Base 0.18.3+13.10.20130813
> - u_application_id_destroy at Base 0.18.3+13.10.20130813
> - u_application_id_new_from_stringn at Base 0.18.3+13.10.20130813
> - u_application_instance_destroy at Base 0.18.3+13.10.20130813
> - u_application_instance_new_from_description_with_options at Base 0.18.3+13.10.20130813
> - u_application_instance_ref at Base 0.18.3+13.10.20130813
> - u_application_instance_run at Base 0.18.3+13.10.20130813
> - u_application_instance_unref at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_destroy at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_get_application_about_to_stop_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_get_application_resumed_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_get_context at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_new at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_ref at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_set_application_about_to_stop_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_set_application_resumed_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_set_context at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_unref at Base 0.18.3+13.10.20130813
> - u_application_options_destroy at Base 0.18.3+13.10.20130813
> - u_application_options_get_form_factor at Base 0.18.3+13.10.20130813
> - u_application_options_get_operation_mode at Base 0.18.3+13.10.20130813
> - u_application_options_get_stage at Base 0.18.3+13.10.20130813
> - u_application_options_new_from_cmd_line at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_disable at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_enable at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_max_value at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_min_delay at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_min_value at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_resolution at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_new at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_set_reading_cb at Base 0.18.3+13.10.20130813
> - ua_sensors_light_disable at Base 0.18.3+13.10.20130813
> - ua_sensors_light_enable at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_max_value at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_min_delay at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_min_value at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_resolution at Base 0.18.3+13.10.20130813
> - ua_sensors_light_new at Base 0.18.3+13.10.20130813
> - ua_sensors_light_set_reading_cb at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_disable at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_enable at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_max_value at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_min_delay at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_min_value at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_resolution at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_new at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_set_reading_cb at Base 0.18.3+13.10.20130813
> - ua_ui_display_destroy at Base 0.18.3+13.10.20130813
> - ua_ui_display_get_native_type at Base 0.18.3+13.10.20130813
> - ua_ui_display_new_with_index at Base 0.18.3+13.10.20130813
> - ua_ui_display_query_horizontal_res at Base 0.18.3+13.10.20130813
> - ua_ui_display_query_vertical_res at Base 0.18.3+13.10.20130813
> - ua_ui_get_clipboard_content at Base 0.18.3+13.10.20130813
> - ua_ui_session_new_with_properties at Base 0.18.3+13.10.20130813
> - ua_ui_session_properties_new at Base 0.18.3+13.10.20130813
> - ua_ui_session_properties_set_remote_pid at Base 0.18.3+13.10.20130813
> - ua_ui_session_properties_set_type at Base 0.18.3+13.10.20130813
> - ua_ui_set_clipboard_content at Base 0.18.3+13.10.20130813
> - ua_ui_window_destroy at Base 0.18.3+13.10.20130813
> - ua_ui_window_get_native_type at Base 0.18.3+13.10.20130813
> - ua_ui_window_hide at Base 0.18.3+13.10.20130813
> - ua_ui_window_move at Base 0.18.3+13.10.20130813
> - ua_ui_window_new_for_application_with_properties at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_destroy at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_get_title at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_new_for_normal_window at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_set_input_cb_and_ctx at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_set_role at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_set_titlen at Base 0.18.3+13.10.20130813
> - ua_ui_window_request_fullscreen at Base 0.18.3+13.10.20130813
> - ua_ui_window_resize at Base 0.18.3+13.10.20130813
> - ua_ui_window_show at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_acceleration_x at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_acceleration_y at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_acceleration_z at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_timestamp at Base 0.18.3+13.10.20130813
> - uas_light_event_get_light at Base 0.18.3+13.10.20130813
> - uas_light_event_get_timestamp at Base 0.18.3+13.10.20130813
> - uas_proximity_event_get_distance at Base 0.18.3+13.10.20130813
> - uas_proximity_event_get_timestamp at Base 0.18.3+13.10.20130813
> - ua_location_heading_update_get_heading_in_degree at Base 0.19+13.10.20130919.3
> - ua_location_heading_update_get_timestamp at Base 0.19+13.10.20130919.3
> - ua_location_heading_update_ref at Base 0.19+13.10.20130919.3
> - ua_location_heading_update_unref at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_altitude_in_meter at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_latitude_in_degree at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_longitude_in_degree at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_timestamp at Base 0.19+13.10.20130919.3
> - ua_location_position_update_has_altitude at Base 0.19+13.10.20130919.3
> - ua_location_position_update_ref at Base 0.19+13.10.20130919.3
> - ua_location_position_update_unref at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_disable_gps at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_disable_service at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_enable_gps at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_enable_service at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_query_status at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_ref at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_set_status_changed_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_unref at Base 0.19+13.10.20130919.3
> - ua_location_service_create_controller at Base 0.19+13.10.20130919.3
> - ua_location_service_create_session_for_high_accuracy at Base 0.19+13.10.20130919.3
> - ua_location_service_create_session_for_low_accuracy at Base 0.19+13.10.20130919.3
> - ua_location_service_session_ref at Base 0.19+13.10.20130919.3
> - ua_location_service_session_set_heading_updates_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_session_set_position_updates_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_session_set_velocity_updates_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_session_start_heading_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_start_position_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_start_velocity_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_stop_heading_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_stop_position_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_stop_velocity_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_unref at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_get_timestamp at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_get_velocity_in_meters_per_second at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_ref at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_unref at Base 0.19+13.10.20130919.3
> - ua_url_dispatcher_session at Base 0.19+13.10.20130919.3
> - ua_url_dispatcher_session_open at Base 0.19+13.10.20130919.3
> \ No newline at end of file
> 
> === removed file 'debian/libubuntu-application-api-mirserver1.install'
> --- debian/libubuntu-application-api-mirserver1.install	2013-08-08 17:41:19 +0000
> +++ debian/libubuntu-application-api-mirserver1.install	1970-01-01 00:00:00 +0000
> @@ -1,1 +0,0 @@
> -usr/lib/*/libubuntu_application_api_mirserver.so.*
> 
> === removed file 'debian/libubuntu-application-api-mirserver1.symbols'
> --- debian/libubuntu-application-api-mirserver1.symbols	2013-09-23 05:39:42 +0000
> +++ debian/libubuntu-application-api-mirserver1.symbols	1970-01-01 00:00:00 +0000
> @@ -1,128 +0,0 @@
> -libubuntu_application_api_mirserver.so.1 libubuntu-application-api-mirserver1 #MINVER#
> - u_application_description_destroy at Base 0.18.3+13.10.20130813
> - u_application_description_get_application_id at Base 0.18.3+13.10.20130813
> - u_application_description_get_application_lifecycle_delegate at Base 0.18.3+13.10.20130813
> - u_application_description_new at Base 0.18.3+13.10.20130813
> - u_application_description_set_application_id at Base 0.18.3+13.10.20130813
> - u_application_description_set_application_lifecycle_delegate at Base 0.18.3+13.10.20130813
> - u_application_id_compare at Base 0.18.3+13.10.20130813
> - u_application_id_destroy at Base 0.18.3+13.10.20130813
> - u_application_id_new_from_stringn at Base 0.18.3+13.10.20130813
> - u_application_instance_destroy at Base 0.18.3+13.10.20130813
> - u_application_instance_new_from_description_with_options at Base 0.18.3+13.10.20130813
> - u_application_instance_ref at Base 0.18.3+13.10.20130813
> - u_application_instance_run at Base 0.18.3+13.10.20130813
> - u_application_instance_unref at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_destroy at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_get_application_about_to_stop_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_get_application_resumed_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_get_context at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_new at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_ref at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_set_application_about_to_stop_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_set_application_resumed_cb at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_set_context at Base 0.18.3+13.10.20130813
> - u_application_lifecycle_delegate_unref at Base 0.18.3+13.10.20130813
> - u_application_options_destroy at Base 0.18.3+13.10.20130813
> - u_application_options_get_form_factor at Base 0.18.3+13.10.20130813
> - u_application_options_get_operation_mode at Base 0.18.3+13.10.20130813
> - u_application_options_get_stage at Base 0.18.3+13.10.20130813
> - u_application_options_new_from_cmd_line at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_disable at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_enable at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_max_value at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_min_delay at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_min_value at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_get_resolution at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_new at Base 0.18.3+13.10.20130813
> - ua_sensors_accelerometer_set_reading_cb at Base 0.18.3+13.10.20130813
> - ua_sensors_light_disable at Base 0.18.3+13.10.20130813
> - ua_sensors_light_enable at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_max_value at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_min_delay at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_min_value at Base 0.18.3+13.10.20130813
> - ua_sensors_light_get_resolution at Base 0.18.3+13.10.20130813
> - ua_sensors_light_new at Base 0.18.3+13.10.20130813
> - ua_sensors_light_set_reading_cb at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_disable at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_enable at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_max_value at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_min_delay at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_min_value at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_get_resolution at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_new at Base 0.18.3+13.10.20130813
> - ua_sensors_proximity_set_reading_cb at Base 0.18.3+13.10.20130813
> - ua_ui_display_destroy at Base 0.18.3+13.10.20130813
> - ua_ui_display_get_native_type at Base 0.18.3+13.10.20130813
> - ua_ui_display_new_with_index at Base 0.18.3+13.10.20130813
> - ua_ui_display_query_horizontal_res at Base 0.18.3+13.10.20130813
> - ua_ui_display_query_vertical_res at Base 0.18.3+13.10.20130813
> - ua_ui_get_clipboard_content at Base 0.18.3+13.10.20130813
> - ua_ui_mirserver_finish at Base 0.18.3+13.10.20130823
> - ua_ui_mirserver_init at Base 0.18.3+13.10.20130823
> - ua_ui_session_new_with_properties at Base 0.18.3+13.10.20130813
> - ua_ui_session_properties_new at Base 0.18.3+13.10.20130813
> - ua_ui_session_properties_set_remote_pid at Base 0.18.3+13.10.20130813
> - ua_ui_session_properties_set_type at Base 0.18.3+13.10.20130813
> - ua_ui_set_clipboard_content at Base 0.18.3+13.10.20130813
> - ua_ui_window_destroy at Base 0.18.3+13.10.20130813
> - ua_ui_window_get_native_type at Base 0.18.3+13.10.20130813
> - ua_ui_window_hide at Base 0.18.3+13.10.20130813
> - ua_ui_window_move at Base 0.18.3+13.10.20130813
> - ua_ui_window_new_for_application_with_properties at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_destroy at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_get_title at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_new_for_normal_window at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_set_input_cb_and_ctx at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_set_role at Base 0.18.3+13.10.20130813
> - ua_ui_window_properties_set_titlen at Base 0.18.3+13.10.20130813
> - ua_ui_window_request_fullscreen at Base 0.18.3+13.10.20130813
> - ua_ui_window_resize at Base 0.18.3+13.10.20130813
> - ua_ui_window_show at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_acceleration_x at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_acceleration_y at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_acceleration_z at Base 0.18.3+13.10.20130813
> - uas_accelerometer_event_get_timestamp at Base 0.18.3+13.10.20130813
> - uas_light_event_get_light at Base 0.18.3+13.10.20130813
> - uas_light_event_get_timestamp at Base 0.18.3+13.10.20130813
> - uas_proximity_event_get_distance at Base 0.18.3+13.10.20130813
> - uas_proximity_event_get_timestamp at Base 0.18.3+13.10.20130813
> - ua_location_heading_update_get_heading_in_degree at Base 0.19+13.10.20130919.3
> - ua_location_heading_update_get_timestamp at Base 0.19+13.10.20130919.3
> - ua_location_heading_update_ref at Base 0.19+13.10.20130919.3
> - ua_location_heading_update_unref at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_altitude_in_meter at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_latitude_in_degree at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_longitude_in_degree at Base 0.19+13.10.20130919.3
> - ua_location_position_update_get_timestamp at Base 0.19+13.10.20130919.3
> - ua_location_position_update_has_altitude at Base 0.19+13.10.20130919.3
> - ua_location_position_update_ref at Base 0.19+13.10.20130919.3
> - ua_location_position_update_unref at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_disable_gps at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_disable_service at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_enable_gps at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_enable_service at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_query_status at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_ref at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_set_status_changed_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_controller_unref at Base 0.19+13.10.20130919.3
> - ua_location_service_create_controller at Base 0.19+13.10.20130919.3
> - ua_location_service_create_session_for_high_accuracy at Base 0.19+13.10.20130919.3
> - ua_location_service_create_session_for_low_accuracy at Base 0.19+13.10.20130919.3
> - ua_location_service_session_ref at Base 0.19+13.10.20130919.3
> - ua_location_service_session_set_heading_updates_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_session_set_position_updates_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_session_set_velocity_updates_handler at Base 0.19+13.10.20130919.3
> - ua_location_service_session_start_heading_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_start_position_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_start_velocity_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_stop_heading_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_stop_position_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_stop_velocity_updates at Base 0.19+13.10.20130919.3
> - ua_location_service_session_unref at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_get_timestamp at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_get_velocity_in_meters_per_second at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_ref at Base 0.19+13.10.20130919.3
> - ua_location_velocity_update_unref at Base 0.19+13.10.20130919.3
> - ua_url_dispatcher_session at Base 0.19+13.10.20130919.3
> - ua_url_dispatcher_session_open at Base 0.19+13.10.20130919.3
> \ No newline at end of file
> 
> === renamed file 'debian/libubuntu-application-api1.install' => 'debian/libubuntu-application-api2.install'
> === renamed file 'debian/libubuntu-application-api1.symbols' => 'debian/libubuntu-application-api2.symbols'
> --- debian/libubuntu-application-api1.symbols	2013-08-26 18:07:34 +0000
> +++ debian/libubuntu-application-api2.symbols	2014-05-28 14:34:51 +0000
> @@ -1,11 +1,13 @@
> -libubuntu_application_api.so.1 libubuntu-application-api1 #MINVER#
> +libubuntu_application_api.so.2 libubuntu-application-api2 #MINVER#
>   u_application_description_destroy at Base 0.18.1daily13.06.21
>   u_application_description_new at Base 0.18.1daily13.06.21
>   u_application_description_set_application_id at Base 0.18.1daily13.06.21
>   u_application_description_set_application_lifecycle_delegate at Base 0.18.1daily13.06.21
> + u_application_finish at Base 0replaceme
>   u_application_id_compare at Base 0.18.1daily13.06.21
>   u_application_id_destroy at Base 0.18.1daily13.06.21
>   u_application_id_new_from_stringn at Base 0.18.1daily13.06.21
> + u_application_init at Base 0replaceme
>   u_application_instance_new_from_description_with_options at Base 0.18.1daily13.06.21
>   u_application_lifecycle_delegate_new at Base 0.18.1daily13.06.21
>   u_application_lifecycle_delegate_ref at Base 0.18.1daily13.06.21
> @@ -13,14 +15,15 @@
>   u_application_lifecycle_delegate_set_application_resumed_cb at Base 0.18.1daily13.06.21
>   u_application_lifecycle_delegate_set_context at Base 0.18.1daily13.06.21
>   u_application_lifecycle_delegate_unref at Base 0.18.1daily13.06.21
> + u_application_module_version at Base 0replaceme
>   u_application_options_destroy at Base 0.18.1daily13.06.21
>   u_application_options_get_form_factor at Base 0.18.1daily13.06.21
>   u_application_options_get_stage at Base 0.18.1daily13.06.21
>   u_application_options_new_from_cmd_line at Base 0.18.1daily13.06.21
> + ua_location_heading_update_get_heading_in_degree at Base 0.18.3+13.10.20130815.1
>   ua_location_heading_update_get_timestamp at Base 0.18.3+13.10.20130807
>   ua_location_heading_update_ref at Base 0.18.3+13.10.20130807
>   ua_location_heading_update_unref at Base 0.18.3+13.10.20130807
> - ua_location_heading_update_get_heading_in_degree at Base 0.18.3+13.10.20130815.1
>   ua_location_position_update_get_altitude_in_meter at Base 0.18.3+13.10.20130807
>   ua_location_position_update_get_latitude_in_degree at Base 0.18.3+13.10.20130807
>   ua_location_position_update_get_longitude_in_degree at Base 0.18.3+13.10.20130807
> @@ -28,9 +31,17 @@
>   ua_location_position_update_has_altitude at Base 0.18.3+13.10.20130807
>   ua_location_position_update_ref at Base 0.18.3+13.10.20130807
>   ua_location_position_update_unref at Base 0.18.3+13.10.20130807
> + ua_location_service_controller_disable_gps at Base 0.18.3+13.10.20130826
> + ua_location_service_controller_disable_service at Base 0.18.3+13.10.20130826
> + ua_location_service_controller_enable_gps at Base 0.18.3+13.10.20130826
> + ua_location_service_controller_enable_service at Base 0.18.3+13.10.20130826
> + ua_location_service_controller_query_status at Base 0.18.3+13.10.20130826
> + ua_location_service_controller_ref at Base 0.18.3+13.10.20130826
> + ua_location_service_controller_set_status_changed_handler at Base 0.18.3+13.10.20130826
> + ua_location_service_controller_unref at Base 0.18.3+13.10.20130826
> + ua_location_service_create_controller at Base 0.18.3+13.10.20130826.3
>   ua_location_service_create_session_for_high_accuracy at Base 0.18.3+13.10.20130807
>   ua_location_service_create_session_for_low_accuracy at Base 0.18.3+13.10.20130807
> - ua_location_service_create_controller at Base 0.18.3+13.10.20130826.3
>   ua_location_service_session_ref at Base 0.18.3+13.10.20130807
>   ua_location_service_session_set_heading_updates_handler at Base 0.18.3+13.10.20130807
>   ua_location_service_session_set_position_updates_handler at Base 0.18.3+13.10.20130807
> @@ -54,8 +65,13 @@
>   ua_sensors_accelerometer_get_resolution at Base 0.18.1daily13.06.21
>   ua_sensors_accelerometer_new at Base 0.18.1daily13.06.21
>   ua_sensors_accelerometer_set_reading_cb at Base 0.18.1daily13.06.21
> + ua_sensors_haptic_disable at Base 0replaceme
> + ua_sensors_haptic_enable at Base 0replaceme
> + ua_sensors_haptic_new at Base 0replaceme
> + ua_sensors_haptic_vibrate_once at Base 0replaceme
> + ua_sensors_haptic_vibrate_with_pattern at Base 0replaceme
> + ua_sensors_light_disable at Base 0.18.2+13.10.20130708
>   ua_sensors_light_enable at Base 0.18.1daily13.06.21
> - ua_sensors_light_disable at Base 0.18.2+13.10.20130708
>   ua_sensors_light_get_max_value at Base 0.18.1daily13.06.21
>   ua_sensors_light_get_min_delay at Base 0.18.1daily13.06.21
>   ua_sensors_light_get_min_value at Base 0.18.1daily13.06.21
> @@ -83,12 +99,14 @@
>   ua_ui_set_clipboard_content at Base 0.18.1daily13.06.21
>   ua_ui_window_destroy at Base 0.18.1daily13.06.21
>   ua_ui_window_get_native_type at Base 0.18.1daily13.06.21
> + ua_ui_window_get_size at Base 2.0.0-0ubuntu1
>   ua_ui_window_hide at Base 0.18.1daily13.06.21
>   ua_ui_window_move at Base 0.18.1daily13.06.21
>   ua_ui_window_new_for_application_with_properties at Base 0.18.1daily13.06.21
>   ua_ui_window_properties_destroy at Base 0.18.1daily13.06.21
>   ua_ui_window_properties_get_title at Base 0.18.1daily13.06.21
>   ua_ui_window_properties_new_for_normal_window at Base 0.18.1daily13.06.21
> + ua_ui_window_properties_set_dimensions at Base 2.0.0-0ubuntu1
>   ua_ui_window_properties_set_input_cb_and_ctx at Base 0.18.1daily13.06.21
>   ua_ui_window_properties_set_role at Base 0.18.1daily13.06.21
>   ua_ui_window_properties_set_titlen at Base 0.18.1daily13.06.21
> @@ -105,26 +123,3 @@
>   uas_light_event_get_timestamp at Base 0.18.1daily13.06.21
>   uas_proximity_event_get_distance at Base 0.18.1daily13.06.21
>   uas_proximity_event_get_timestamp at Base 0.18.1daily13.06.21
> - ubuntu_ui_install_task_controller at Base 0.18.1daily13.06.21
> - ubuntu_ui_report_notification_invisible at Base 0.18.1daily13.06.21
> - ubuntu_ui_report_notification_visible at Base 0.18.1daily13.06.21
> - ubuntu_ui_report_osk_invisible at Base 0.18.1daily13.06.21
> - ubuntu_ui_report_osk_visible at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_focus_running_session_with_id at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_install_session_lifecycle_observer at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_properties_get_application_instance_id at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_properties_get_application_stage_hint at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_properties_get_desktop_file_hint at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_snapshot_running_session_with_id at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_trigger_switch_to_well_known_application at Base 0.18.1daily13.06.21
> - ubuntu_ui_session_unfocus_running_sessions at Base 0.18.1daily13.06.21
> - ubuntu_ui_set_surface_trap at Base 0.18.1daily13.06.21
> - ubuntu_ui_unset_surface_trap at Base 0.18.1daily13.06.21
> - ua_location_service_controller_disable_gps at Base 0.18.3+13.10.20130826
> - ua_location_service_controller_disable_service at Base 0.18.3+13.10.20130826
> - ua_location_service_controller_enable_gps at Base 0.18.3+13.10.20130826
> - ua_location_service_controller_enable_service at Base 0.18.3+13.10.20130826
> - ua_location_service_controller_query_status at Base 0.18.3+13.10.20130826
> - ua_location_service_controller_ref at Base 0.18.3+13.10.20130826
> - ua_location_service_controller_set_status_changed_handler at Base 0.18.3+13.10.20130826
> - ua_location_service_controller_unref at Base 0.18.3+13.10.20130826
> 
> === renamed file 'debian/libplatform-hardware-api1-dev.install' => 'debian/libubuntu-platform-hardware-api-dev.install'
> === renamed file 'debian/libplatform-hardware-api-headers.install' => 'debian/libubuntu-platform-hardware-api-headers.install'
> === renamed file 'debian/libubuntu-platform-hardware-api1.install' => 'debian/libubuntu-platform-hardware-api2.install'
> === renamed file 'debian/libubuntu-platform-hardware-api1.symbols' => 'debian/libubuntu-platform-hardware-api2.symbols'
> --- debian/libubuntu-platform-hardware-api1.symbols	2014-05-22 15:29:45 +0000
> +++ debian/libubuntu-platform-hardware-api2.symbols	2014-05-28 14:34:51 +0000
> @@ -1,4 +1,4 @@
> -libubuntu_platform_hardware_api.so.1 libubuntu-platform-hardware-api1 #MINVER#
> +libubuntu_platform_hardware_api.so.2 libubuntu-platform-hardware-api2 #MINVER#
>   u_hardware_alarm_create at Base 1.2.0+14.10.20140522.1
>   u_hardware_alarm_get_elapsed_real_time at Base 1.2.0+14.10.20140522.1
>   u_hardware_alarm_ref at Base 1.2.0+14.10.20140522.1
> 
> === modified file 'debian/rules'
> --- debian/rules	2014-02-13 14:12:28 +0000
> +++ debian/rules	2014-05-28 14:34:51 +0000
> @@ -5,9 +5,6 @@
>  %:
>  	dh $@
>  
> -override_dh_auto_configure:
> -	dh_auto_configure -- -DENABLE_MIRCLIENT_IMPLEMENTATION=true -DENABLE_MIRSERVER_IMPLEMENTATION=true
> -
>  override_dh_install:
>  	dh_install --fail-missing
>  
> 
> === added file 'debian/ubuntu-application-api2-desktop.install'
> --- debian/ubuntu-application-api2-desktop.install	1970-01-01 00:00:00 +0000
> +++ debian/ubuntu-application-api2-desktop.install	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,2 @@
> +usr/lib/*/libubuntu_application_api_desktop_mirclient.so.*
> +usr/lib/*/libubuntu_application_api_desktop_mirserver.so.*
> 
> === added file 'debian/ubuntu-application-api2-examples.install'
> --- debian/ubuntu-application-api2-examples.install	1970-01-01 00:00:00 +0000
> +++ debian/ubuntu-application-api2-examples.install	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,7 @@
> +usr/bin/test_android_gps_api
> +usr/bin/test_android_sensors_api
> +usr/bin/test_android_ubuntu_app_api
> +usr/bin/test_android_ubuntu_app_api_multiple_surfaces
> +usr/bin/test_ubuntu_app_api_location_service
> +usr/bin/test_hardware_alarms_api
> +usr/bin/test_ubuntu_haptic_device
> 
> === renamed file 'debian/libubuntu-application-api-test1.docs' => 'debian/ubuntu-application-api2-test.docs'
> --- debian/libubuntu-application-api-test1.docs	2014-01-08 15:17:41 +0000
> +++ debian/ubuntu-application-api2-test.docs	2014-05-28 14:34:51 +0000
> @@ -1,1 +1,1 @@
> -src/ubuntu/testbackend/README.md
> +src/ubuntu/application/testbackend/README.md
> 
> === renamed file 'debian/libubuntu-application-api-test1.install' => 'debian/ubuntu-application-api2-test.install'
> === added file 'debian/ubuntu-application-api2-touch.install'
> --- debian/ubuntu-application-api2-touch.install	1970-01-01 00:00:00 +0000
> +++ debian/ubuntu-application-api2-touch.install	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,2 @@
> +usr/lib/*/libubuntu_application_api_touch_mirserver.so.*
> +usr/lib/*/libubuntu_application_api_touch_mirclient.so.*
> 
> === added directory 'examples'
> === added file 'examples/CMakeLists.txt'
> --- examples/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ examples/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,29 @@
> +include_directories(
> +    ${CMAKE_BINARY_DIR}/include
> +)
> +
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
> +
> +add_executable(test_android_ubuntu_app_api test_c_api.cpp)
> +target_link_libraries(test_android_ubuntu_app_api ubuntu_application_api EGL GLESv2)
> +
> +add_executable(test_android_ubuntu_app_api_multiple_surfaces test_multiple_surfaces_event_delivery.cpp)
> +target_link_libraries(test_android_ubuntu_app_api_multiple_surfaces ubuntu_application_api EGL GLESv2)
> +
> +add_executable(test_android_sensors_api test_sensors_api.cpp)
> +target_link_libraries(test_android_sensors_api ubuntu_application_api)
> +
> +add_executable(test_ubuntu_app_api_location_service test_location_api.cpp)
> +target_link_libraries(test_ubuntu_app_api_location_service ubuntu_application_api)
> +
> +add_executable(test_ubuntu_haptic_device test_haptic_device.cpp)
> +target_link_libraries(test_ubuntu_haptic_device ubuntu_application_api)
> +
> +install(TARGETS
> +    test_android_ubuntu_app_api
> +    test_android_ubuntu_app_api_multiple_surfaces
> +    test_android_sensors_api
> +    test_ubuntu_app_api_location_service
> +    test_ubuntu_haptic_device
> +    DESTINATION bin
> +)
> 
> === renamed file 'src/ubuntu/hybris/tests/test_c_api.cpp' => 'examples/test_c_api.cpp'
> === added file 'examples/test_haptic_device.cpp'
> --- examples/test_haptic_device.cpp	1970-01-01 00:00:00 +0000
> +++ examples/test_haptic_device.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright © 2014 Canonical Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +
> +#include <ubuntu/application/sensors/haptic.h>
> +
> +int main(int argc, char *argv[])
> +{
> +    UASensorsHaptic *sensor = ua_sensors_haptic_new();
> +
> +    if (!sensor) {
> +        printf("Haptic device unavailable\n");
> +        return 1;
> +    }
> +
> +    printf("Vibrating once for 1500ms\n");
> +    ua_sensors_haptic_vibrate_once(sensor, 1500);
> +
> +    sleep(3);
> +
> +    printf("Vibrating with pattern 6*1500, repeat twice.\n");
> +    uint32_t pattern[MAX_PATTERN_SIZE] = {1500, 1500, 1500, 1500, 1500, 1500};
> +    ua_sensors_haptic_vibrate_with_pattern(sensor, pattern, 2);
> +
> +    return 0;
> +}
> 
> === renamed file 'src/ubuntu/hybris/tests/test_location_api.cpp' => 'examples/test_location_api.cpp'
> === renamed file 'src/ubuntu/hybris/tests/test_multiple_surfaces_event_delivery.cpp' => 'examples/test_multiple_surfaces_event_delivery.cpp'
> === renamed file 'src/ubuntu/hybris/tests/test_sensors_api.cpp' => 'examples/test_sensors_api.cpp'
> === renamed file 'src/ubuntu/hybris/tests/test_session_c_api.cpp' => 'examples/test_session_c_api.cpp'
> === modified file 'include/ubuntu/application/CMakeLists.txt'
> --- include/ubuntu/application/CMakeLists.txt	2013-08-22 10:54:28 +0000
> +++ include/ubuntu/application/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -7,6 +7,7 @@
>    lifecycle_delegate.h
>    operation_mode.h
>    options.h
> +  init.h
>  )
>  
>  install(
> 
> === added file 'include/ubuntu/application/init.h'
> --- include/ubuntu/application/init.h	1970-01-01 00:00:00 +0000
> +++ include/ubuntu/application/init.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,63 @@
> +/*
> + * Copyright © 2013 Canonical Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#ifndef UBUNTU_APPLICATION_INIT_H_
> +#define UBUNTU_APPLICATION_INIT_H_
> +
> +#include <ubuntu/visibility.h>
> +
> +#include <stdint.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif 
> +
> +    /**
> +     * \brief Queries the Module Version that is currently loaded.
> +     * \ingroup application_support
> +     * \param[out] major Major version.
> +     * \param[out] minor Minor version.
> +     * \param[out] patch Patch version.
> +     */
> +     UBUNTU_DLL_PUBLIC void
> +     u_application_module_version(
> +        uint32_t *major,
> +        uint32_t *minor,
> +        uint32_t *patch);
> +
> +    /**
> +     * \brief Initializes the Ubuntu Application API backend with args.
> +     * \ingroup application_support
> +     * \param[in] args Opaque initialization arguments.
> +     */
> +    UBUNTU_DLL_PUBLIC void
> +    u_application_init(
> +        void *args);
> +
> +    /**
> +     * \brief Signal termination to the Application backend instance.
> +     * \ingroup application_support
> +     */
> +    UBUNTU_DLL_PUBLIC void
> +    u_application_finish();
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* UBUNTU_APPLICATION_INIT_H_ */
> 
> === modified file 'include/ubuntu/application/sensors/CMakeLists.txt'
> --- include/ubuntu/application/sensors/CMakeLists.txt	2013-07-18 09:08:17 +0000
> +++ include/ubuntu/application/sensors/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -3,6 +3,7 @@
>    accelerometer.h
>    light.h
>    proximity.h
> +  haptic.h
>    ubuntu_application_sensors.h
>  )
>  
> @@ -11,4 +12,4 @@
>    DESTINATION include/ubuntu/application/sensors
>  )
>  
> -add_subdirectory(event)
> \ No newline at end of file
> +add_subdirectory(event)
> 
> === added file 'include/ubuntu/application/sensors/haptic.h'
> --- include/ubuntu/application/sensors/haptic.h	1970-01-01 00:00:00 +0000
> +++ include/ubuntu/application/sensors/haptic.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,98 @@
> +/*
> + * Copyright © 2014 Canonical Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#ifndef UBUNTU_APPLICATION_SENSORS_HAPTIC_H_
> +#define UBUNTU_APPLICATION_SENSORS_HAPTIC_H_
> +
> +#include <ubuntu/status.h>
> +#include <ubuntu/visibility.h>
> +
> +#include <stdint.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +    /**
> +     * \brief Opaque type that models the haptics device.
> +     * \ingroup sensor_access
> +     */
> +    typedef void UASensorsHaptic;
> +
> +    /**
> +     * \brief Create a new object for accessing the haptics device.
> +     * \ingroup sensor_access
> +     * \returns A new instance or NULL in case of errors.
> +     */
> +    UBUNTU_DLL_PUBLIC UASensorsHaptic*
> +    ua_sensors_haptic_new();
> +
> +    /**
> +     * \brief Enables the supplied haptics device.
> +     * \ingroup sensor_access
> +     * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
> +     * \param[in] sensor The sensor instance to be enabled.
> +     */
> +    UBUNTU_DLL_PUBLIC UStatus
> +    ua_sensors_haptic_enable(
> +        UASensorsHaptic* sensor);
> +
> +    /**
> +     * \brief Disables the supplied haptics device.
> +     * \ingroup sensor_access
> +     * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
> +     * \param[in] sensor The sensor instance to be disabled.
> +     */
> +    UBUNTU_DLL_PUBLIC UStatus
> +    ua_sensors_haptic_disable(
> +        UASensorsHaptic* sensor);
> +
> +    /**
> +     * \brief Run the vibrator for a fixed duration.
> +     * \ingroup sensor_access
> +     * \returns U_STATUS_SUCCESS if pushed correctly, U_STATUS_ERROR if the pattern limit is invalid or the actuator cannot be activated.
> +     * \param[in] sensor Haptic device to activate.
> +     * \param[in] duration How long should the vibrator stay on.
> +     */
> +     UBUNTU_DLL_PUBLIC UStatus
> +     ua_sensors_haptic_vibrate_once(
> +        UASensorsHaptic* sensor,
> +        uint32_t duration);
> +        
> +    #define MAX_PATTERN_SIZE 6
> +
> +    /**
> +     * \brief Run the vibrator with a pattern and repeat a precise number of times.
> +     * \ingroup sensor_access
> +     * \returns U_STATUS_SUCCESS if pushed correctly, U_STATUS_ERROR if the pattern limit is invalid or the actuator cannot be activated.
> +     * \param[in] sensor Haptic device to activate.
> +     * \param[in] pattern An array of uint32_t durations for which to keep the vibrator on or off. The first value indicates how long to keep the vibrator on for, the second value how long to keep it off for, and so on until the end of the array.
> +     * \param[in] repeat How many times to repeat the whole pattern for.
> +     */
> +    
> +     UBUNTU_DLL_PUBLIC UStatus
> +     ua_sensors_haptic_vibrate_with_pattern(
> +        UASensorsHaptic* sensor,
> +        uint32_t pattern[MAX_PATTERN_SIZE],
> +        uint32_t repeat);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* UBUNTU_APPLICATION_SENSORS_HAPTIC_H_ */
> 
> === added directory 'src/bridge'
> === added file 'src/bridge/bridge.h'
> --- src/bridge/bridge.h	1970-01-01 00:00:00 +0000
> +++ src/bridge/bridge.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,63 @@
> +/*
> + * Copyright (C) 2012 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Thomas Voss <thomas.voss at canonical.com>
> + *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +#ifndef BASE_BRIDGE_H_
> +#define BASE_BRIDGE_H_
> +
> +#include <assert.h>
> +#include <dlfcn.h>
> +#include <stddef.h>
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <string.h>
> +
> +#define MAX_MODULE_NAME 32
> +
> +#define HIDDEN_SYMBOL __attribute__ ((visibility ("hidden")))
> +
> +namespace internal
> +{
> +template<typename Scope>
> +class HIDDEN_SYMBOL Bridge
> +{
> +  public:
> +    static Bridge<Scope>& instance()
> +    { 
> +        static Bridge<Scope> bridge; 
> +        return bridge; 
> +    }
> +
> +    void* resolve_symbol(const char* symbol) const
> +    {
> +        return Scope::dlsym_fn(lib_handle, symbol);
> +    }
> +
> +  protected:
> +    Bridge() : lib_handle(Scope::dlopen_fn(Scope::path(), RTLD_LAZY))
> +    {
> +    }
> +
> +    ~Bridge()
> +    {
> +    }
> +
> +    void* lib_handle;
> +};
> +}
> +
> +#endif // BRIDGE_H_
> 
> === added file 'src/bridge/bridge_defs.h'
> --- src/bridge/bridge_defs.h	1970-01-01 00:00:00 +0000
> +++ src/bridge/bridge_defs.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,136 @@
> +/*
> + * Copyright (C) 2012 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Thomas Voss <thomas.voss at canonical.com>
> + *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +#ifndef BRIDGE_DEFS_H_
> +#define BRIDGE_DEFS_H_
> +
> +// Must be included afterthe Bridge class is defined
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/**********************************************************/
> +/*********** Implementation starts here *******************/
> +/**********************************************************/
> +
> +// this allows DLSYM to return NULL (happens if the backend is not available),
> +// and returns NULL in that case; return_type must be a pointer!
> +#define IMPLEMENT_CTOR0(return_type, symbol)  \
> +    return_type symbol()                          \
> +    {                                             \
> +        static return_type (*f)() = NULL;         \
> +        DLSYM(&f, #symbol);                       \
> +        return f ? f() : NULL;}
> +
> +#define IMPLEMENT_FUNCTION0(return_type, symbol)  \
> +    return_type symbol()                          \
> +    {                                             \
> +        static return_type (*f)() = NULL;         \
> +        DLSYM(&f, #symbol);                       \
> +        return f();}
> +
> +#define IMPLEMENT_VOID_FUNCTION0(symbol)          \
> +    void symbol()                                 \
> +    {                                             \
> +        static void (*f)() = NULL;                \
> +        DLSYM(&f, #symbol);                       \
> +        f();}
> +
> +#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
> +    return_type symbol(arg1 _1)                        \
> +    {                                                  \
> +        static return_type (*f)(arg1) = NULL;          \
> +        DLSYM(&f, #symbol);                     \
> +        return f(_1); }
> +
> +#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1)               \
> +    void symbol(arg1 _1)                                     \
> +    {                                                        \
> +        static void (*f)(arg1) = NULL;                       \
> +        DLSYM(&f, #symbol);                           \
> +        f(_1); }
> +
> +#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2)    \
> +    return_type symbol(arg1 _1, arg2 _2)                        \
> +    {                                                           \
> +        static return_type (*f)(arg1, arg2) = NULL;             \
> +        DLSYM(&f, #symbol);                              \
> +        return f(_1, _2); }
> +
> +#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2)            \
> +    void symbol(arg1 _1, arg2 _2)                               \
> +    {                                                           \
> +        static void (*f)(arg1, arg2) = NULL;                    \
> +        DLSYM(&f, #symbol);                              \
> +        f(_1, _2); }
> +
> +#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3)    \
> +    return_type symbol(arg1 _1, arg2 _2, arg3 _3)                     \
> +    {                                                                 \
> +        static return_type (*f)(arg1, arg2, arg3) = NULL;             \
> +        DLSYM(&f, #symbol);                                           \
> +        return f(_1, _2, _3); } 
> +
> +#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3)      \
> +    void symbol(arg1 _1, arg2 _2, arg3 _3)                      \
> +    {                                                           \
> +        static void (*f)(arg1, arg2, arg3) = NULL;              \
> +        DLSYM(&f, #symbol);                                     \
> +        f(_1, _2, _3); }
> +
> +#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
> +    void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4)              \
> +    {                                                            \
> +        static void (*f)(arg1, arg2, arg3, arg4) = NULL;         \
> +        DLSYM(&f, #symbol);                                      \
> +        f(_1, _2, _3, _4); }
> +
> +#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
> +    return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4)               \
> +    {                                                                    \
> +        static return_type (*f)(arg1, arg2, arg3, arg4) = NULL;          \
> +        DLSYM(&f, #symbol);                                              \
> +        return f(_1, _2, _3, _4); }
> +
> +#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
> +    return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6)         \
> +    {                                                                                \
> +        static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL;          \
> +        DLSYM(&f, #symbol);                                                          \
> +        return f(_1, _2, _3, _4, _5, _6); }
> +
> +#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
> +    void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
> +    {                                                                   \
> +        static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
> +        DLSYM(&f, #symbol);                                             \
> +        f(_1, _2, _3, _4, _5, _6, _7); }
> +
> +#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
> +    void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
> +    {                                                                   \
> +        static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
> +        DLSYM(&f, #symbol);                                             \
> +        f(_1, _2, _3, _4, _5, _6, _7, _8); }
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif // BRIDGE_DEFS_H_
> 
> === added file 'src/ubuntu/CMakeLists.txt'
> --- src/ubuntu/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,2 @@
> +add_subdirectory(application)
> +add_subdirectory(hardware)
> 
> === added directory 'src/ubuntu/application'
> === renamed file 'src/ubuntu/CMakeLists.txt' => 'src/ubuntu/application/CMakeLists.txt'
> --- src/ubuntu/CMakeLists.txt	2014-05-21 07:15:34 +0000
> +++ src/ubuntu/application/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -1,36 +1,44 @@
> -include_directories(
> -  ${CMAKE_CURRENT_SOURCE_DIR}
> -)
> -
> -add_subdirectory(application)
> -add_subdirectory(hardware)
> -add_subdirectory(testbackend)
> -
>  set(
>    UBUNTU_APPLICATION_API_LINK_LIBRARIES
> -  
> +
> +  ubuntu_application_sensors_haptic
>    ubuntu_application_location
>    ubuntu_application_url_dispatcher
>  )
>  
> -set(
> -  UBUNTU_HARDWARE_API_LINK_LIBRARIES
> +include_directories(
> +  ${CMAKE_BINARY_DIR}/include
> +)
> +
> +include_directories(../../bridge)
> +
> +add_subdirectory(common)
> +add_subdirectory(desktop)
> +add_subdirectory(touch)
> +add_subdirectory(testbackend)
> +
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
> +
> +add_library(
> +  ubuntu_application_api SHARED
>    
> -  ubuntu_hardware_alarm
> -)
> -
> -if(ENABLE_HYBRIS_IMPLEMENTATION)
> -  add_subdirectory(hybris/)
> -endif()
> -
> -if(ENABLE_MIRSERVER_IMPLEMENTATION OR ENABLE_MIRCLIENT_IMPLEMENTATION)
> -  add_subdirectory(mircommon/)
> -endif()
> -
> -if(ENABLE_MIRSERVER_IMPLEMENTATION)
> -  add_subdirectory(mirserver/)
> -endif()
> -
> -if(ENABLE_MIRCLIENT_IMPLEMENTATION)
> -  add_subdirectory(mirclient/)
> -endif()
> +  ubuntu_application_api.cpp
> +)
> +
> +target_link_libraries(
> +  ubuntu_application_api
> +
> +  dl  
> +)
> +
> +set_target_properties(
> +  ubuntu_application_api
> +  PROPERTIES
> +  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> +  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> +)
> +
> +install(
> +  TARGETS ubuntu_application_api
> +  ${INSTALL_TARGETS_DEFAULT_ARGS}
> +)
> 
> === added file 'src/ubuntu/application/base_module.h'
> --- src/ubuntu/application/base_module.h	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/base_module.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,82 @@
> +/*
> + * Copyright (C) 2012 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Thomas Voss <thomas.voss at canonical.com>
> + *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +#ifndef BASE_MODULE_H_
> +#define BASE_MODULE_H_
> +
> +#include <bridge.h>
> +
> +/*
> + * This is the base backend loader for the Platform API
> + */
> +
> +#define API_VERSION_MAJOR   "2"
> +#define API_VERSION_MINOR   "0"
> +#define API_VERSION_PATCH   "0"
> +#define SO_SUFFIX ".so." API_VERSION_MAJOR "." API_VERSION_MINOR "." API_VERSION_PATCH
> +
> +namespace internal
> +{
> +/* Programs can select a backend with $UBUNTU_PLATFORM_API_BACKEND,
> + * which either needs to be a full path or just the file name (then it will be
> + * looked up in the usual library search path, see dlopen(3)).
> + */
> +struct HIDDEN_SYMBOL ToBackend
> +{
> +    static const char* path()
> +    {
> +        static const char* cache = NULL;
> +        static char path[64];
> +
> +        if (cache == NULL) {
> +            cache = secure_getenv("UBUNTU_PLATFORM_API_BACKEND");
> +            if (cache == NULL) {
> +                printf("UBUNTU PLATFORM API BACKEND NOT SELECTED -- Aborting\n");
> +                abort();
> +            } else {
> +                strcpy(path, "libubuntu_application_api_");
> +                if (strlen(cache) > MAX_MODULE_NAME) {
> +                    printf("Invalid Ubuntu Application API backend\n");
> +                    abort();
> +                }
> +                strcat(path, cache);
> +                strcat(path, SO_SUFFIX);
> +            }
> +
> +        }
> +
> +        return path;
> +    }
> +
> +    static void* dlopen_fn(const char* path, int flags)
> +    {
> +        return dlopen(path, flags);
> +    }
> +
> +    static void* dlsym_fn(void* handle, const char* symbol)
> +    {
> +        return dlsym(handle, symbol);
> +    }
> +};
> +}
> +
> +#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) internal::Bridge<internal::ToBackend>::instance().resolve_symbol(sym); }
> +
> +#include <bridge_defs.h>
> +
> +#endif // BASE_MODULE_H_
> 
> === added directory 'src/ubuntu/application/common'
> === added file 'src/ubuntu/application/common/CMakeLists.txt'
> --- src/ubuntu/application/common/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/common/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,8 @@
> +include_directories(
> +  ${CMAKE_CURRENT_SOURCE_DIR}
> +)
> +
> +add_subdirectory(application)
> +add_subdirectory(mircommon)
> +add_subdirectory(mirclient)
> +add_subdirectory(mirserver)
> 
> === renamed directory 'src/ubuntu/application' => 'src/ubuntu/application/common/application'
> === modified file 'src/ubuntu/application/common/application/CMakeLists.txt'
> --- src/ubuntu/application/CMakeLists.txt	2013-08-22 10:54:28 +0000
> +++ src/ubuntu/application/common/application/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -1,2 +1,3 @@
> +add_subdirectory(sensors)
>  add_subdirectory(location)
>  add_subdirectory(url_dispatcher)
> 
> === added directory 'src/ubuntu/application/common/application/sensors'
> === added file 'src/ubuntu/application/common/application/sensors/CMakeLists.txt'
> --- src/ubuntu/application/common/application/sensors/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/common/application/sensors/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,21 @@
> +find_package(PkgConfig)
> +find_package(Threads)
> +pkg_check_modules(DBUS_CPP REQUIRED dbus-cpp)
> +
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
> +
> +include_directories(
> +    ${DBUS_CPP_INCLUDE_DIRS}
> +    )
> +
> +add_library(
> +  ubuntu_application_sensors_haptic
> +
> +  service.cpp
> +)
> +
> +target_link_libraries(
> +  ubuntu_application_sensors_haptic
> +
> +  ${DBUS_CPP_LIBRARIES}
> +)
> 
> === added file 'src/ubuntu/application/common/application/sensors/sensors_p.h'
> --- src/ubuntu/application/common/application/sensors/sensors_p.h	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/common/application/sensors/sensors_p.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,43 @@
> +/*
> + * Copyright (C) 2014 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + *      Author: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#include <core/dbus/dbus.h>
> +#include <core/dbus/fixture.h>
> +#include <core/dbus/object.h>
> +#include <core/dbus/property.h>
> +#include <core/dbus/service.h>
> +#include <core/dbus/interfaces/properties.h>
> +#include <core/dbus/types/stl/tuple.h>
> +#include <core/dbus/types/stl/vector.h>
> +
> +#include <core/dbus/asio/executor.h>
> +
> +#include <vector>
> +#include <memory>
> +
> +namespace dbus = core::dbus;
> +
> +struct UbuntuApplicationSensorsHaptic
> +{
> +    UbuntuApplicationSensorsHaptic(std::shared_ptr<dbus::Object> session)
> +        : session(session)
> +    {
> +    }
> +
> +    std::shared_ptr<dbus::Object> session;
> +};
> 
> === added file 'src/ubuntu/application/common/application/sensors/service.cpp'
> --- src/ubuntu/application/common/application/sensors/service.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/common/application/sensors/service.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,103 @@
> +/*
> + * Copyright (C) 2013 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + *      Author: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#include "ubuntu/application/sensors/haptic.h"
> +#include "usensord_service.h"
> +#include "sensors_p.h"
> +
> +#include <stdlib.h>
> +
> +template<typename T>
> +struct Holder
> +{
> +    Holder(const T&value = T()) : value(value)
> +    {
> +    }
> +
> +    T value;
> +};
> +
> +template<typename T>
> +Holder<T>* make_holder(const T& value)
> +{
> +    return new Holder<T>(value);
> +}
> +
> +namespace dbus = core::dbus;
> +namespace uas = ubuntu::application::sensors;
> +
> +UASensorsHaptic*
> +ua_sensors_haptic_new()
> +{
> +    auto bus = std::shared_ptr<dbus::Bus>(new dbus::Bus(core::dbus::WellKnownBus::session));
> +    bus->install_executor(dbus::asio::make_executor(bus));
> +
> +    auto stub_service = dbus::Service::use_service(bus, dbus::traits::Service<uas::USensorD>::interface_name());
> +    auto stub = stub_service->object_for_path(dbus::types::ObjectPath("/com/canonical/usensord/haptic"));
> +
> +    return make_holder(new UbuntuApplicationSensorsHaptic(stub));
> +}
> +
> +UStatus
> +ua_sensors_haptic_vibrate_once(
> +    UASensorsHaptic* sensor,
> +    uint32_t duration)
> +{
> +    if (sensor == nullptr)
> +        return U_STATUS_ERROR;
> +
> +    auto s = static_cast<Holder<UbuntuApplicationSensorsHaptic*>*>(sensor);
> +
> +    try
> +    {
> +        s->value->session->invoke_method_synchronously<uas::USensorD::Haptic::Vibrate, void>(duration);
> +    }
> +    catch (const std::runtime_error& e)
> +    {
> +        std::cout << e.what() << std::endl;
> +        return U_STATUS_ERROR;
> +    }
> +
> +    return U_STATUS_SUCCESS;
> +}
> +
> +UStatus
> +ua_sensors_haptic_vibrate_with_pattern(
> +    UASensorsHaptic* sensor,
> +    uint32_t pattern[MAX_PATTERN_SIZE],
> +    uint32_t repeat)
> +{
> +    if (sensor == nullptr)
> +        return U_STATUS_ERROR;
> +
> +    auto s = static_cast<Holder<UbuntuApplicationSensorsHaptic*>*>(sensor);
> +
> +    std::vector<uint32_t> p_arg (pattern, pattern + MAX_PATTERN_SIZE);
> +
> +    try
> +    {
> +        s->value->session->invoke_method_synchronously<uas::USensorD::Haptic::VibratePattern, void>(p_arg, repeat);
> +    }
> +    catch (const std::runtime_error& e)
> +    {
> +        std::cout << e.what() << std::endl;
> +        return U_STATUS_ERROR;
> +    }
> +    
> +    return U_STATUS_SUCCESS;
> +}
> 
> === added file 'src/ubuntu/application/common/application/sensors/usensord_service.h'
> --- src/ubuntu/application/common/application/sensors/usensord_service.h	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/common/application/sensors/usensord_service.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,80 @@
> +/*
> + * Copyright (C) 2013 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + *      Author: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#include <string>
> +#include <vector>
> +#include <chrono>
> +
> +namespace ubuntu
> +{
> +namespace application
> +{
> +namespace sensors
> +{
> +
> +struct USensorD
> +{
> +    static std::string& name()
> +    {
> +        static std::string s = "com.canonical.usensord";
> +        return s;
> +    }
> +
> +    struct Haptic
> +    {
> +        static std::string name()
> +        {
> +            static std::string s = "com.canonical.usensord.haptic";
> +            return s;
> +        }
> +    
> +        struct Vibrate
> +        {
> +            static std::string name()
> +            {
> +                static std::string s = "Vibrate";
> +                return s;
> +            }
> +    
> +            static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
> +    
> +            typedef Haptic Interface;
> +            typedef void ResultType;
> +            typedef std::uint32_t ArgumentType;
> +        };
> +    
> +        struct VibratePattern
> +        {
> +            static std::string name()
> +            {
> +                static std::string s = "VibratePattern";
> +                return s;
> +            }
> +     
> +            static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
> +    
> +            typedef Haptic Interface;
> +            typedef void ResultType;
> +            typedef std::tuple<std::vector<std::uint32_t>, std::uint32_t> ArgumentType;
> +        };
> +    };
> +};
> +
> +}
> +}
> +}
> 
> === renamed directory 'src/ubuntu/mirclient' => 'src/ubuntu/application/common/mirclient'
> === modified file 'src/ubuntu/application/common/mirclient/CMakeLists.txt'
> --- src/ubuntu/mirclient/CMakeLists.txt	2014-02-07 14:32:44 +0000
> +++ src/ubuntu/application/common/mirclient/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -13,11 +13,6 @@
>  
>  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
>  
> -add_library(
> -	ubuntu_application_api_mirclient SHARED
> -	${SOURCES}
> -)
> -
>  include_directories(
>      ${CMAKE_BINARY_DIR}/include
>      ${MIRCLIENT_INCLUDE_DIRS}
> @@ -25,18 +20,16 @@
>      ${CMAKE_CURRENT_BINARY_DIR}
>  )
>  
> +add_library(
> +	ubuntu_application_api_mirclient STATIC
> +	${SOURCES}
> +)
> +
> +SET(MIRCOMMON_LINK -Wl,--whole-archive ubuntu_application_api_mircommon -Wl,--no-whole-archive)
> +
>  target_link_libraries(
>    ubuntu_application_api_mirclient
> +
>    ${MIRCLIENT_LDFLAGS} ${MIRCLIENT_LIBRARIES}
> -  -Wl,--whole-archive ubuntu_application_api_mircommon ${UBUNTU_APPLICATION_API_LINK_LIBRARIES} -Wl,--no-whole-archive
>    ${PROTOBUF_LIBRARIES}
>  )
> -
> -set_target_properties(
> -	ubuntu_application_api_mirclient
> -	PROPERTIES
> -	VERSION 1.0
> -	SOVERSION 1
> -)
> -
> -install(TARGETS ubuntu_application_api_mirclient ${INSTALL_TARGETS_DEFAULT_ARGS})
> 
> === modified file 'src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp'
> --- src/ubuntu/mirclient/ubuntu_application_api_mirclient.cpp	2014-05-07 12:21:22 +0000
> +++ src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp	2014-05-28 14:34:51 +0000
> @@ -86,6 +86,15 @@
>  extern "C"
>  {
>  
> +void u_application_init(void *args)
> +{
> +    (void) args;
> +}
> +
> +void u_application_finish()
> +{
> +}
> +
>  // TODO<papi>: Eliminate global instance by adding Instance to some functions (i.e. display queries)
>  // TODO: We can't take ownership of description and options until we get rid of the global instance
>  // so we leak them.
> @@ -311,11 +320,7 @@
>      delete window;
>  }
>  
> -void
> -ua_ui_window_get_size(
> -    UAUiWindow *u_window,
> -    uint32_t *width,
> -    uint32_t *height)
> +void ua_ui_window_get_size(UAUiWindow* u_window, uint32_t *width, uint32_t *height)
>  {
>      auto window = uamc::Window::from_u_window(u_window);
>      window->get_size(width, height);
> 
> === renamed directory 'src/ubuntu/mircommon' => 'src/ubuntu/application/common/mircommon'
> === modified file 'src/ubuntu/application/common/mircommon/CMakeLists.txt'
> --- src/ubuntu/mircommon/CMakeLists.txt	2014-02-17 22:40:09 +0000
> +++ src/ubuntu/application/common/mircommon/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -7,19 +7,6 @@
>    lifecycle_delegate_mir.cpp
>    )
>  
> -if(ENABLE_HYBRIS_IMPLEMENTATION)
> -  list(APPEND SOURCES
> -    ../hybris/ubuntu_application_sensors_hybris.cpp
> -    )
> -  list(APPEND LINK_LIBRARIES
> -    ${Hybris}
> -    )
> -else()
> -  list(APPEND SOURCES
> -    ubuntu_application_sensors_desktop.cpp
> -    )
> -endif()
> -
>  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC --std=c++11")
>  
>  include_directories(
> @@ -34,6 +21,5 @@
>  target_link_libraries(
>    ubuntu_application_api_mircommon
>  
> -  ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
>    ${LINK_LIBRARIES}
>    )
> 
> === renamed directory 'src/ubuntu/mirserver' => 'src/ubuntu/application/common/mirserver'
> === modified file 'src/ubuntu/application/common/mirserver/CMakeLists.txt'
> --- src/ubuntu/mirserver/CMakeLists.txt	2014-01-09 18:47:45 +0000
> +++ src/ubuntu/application/common/mirserver/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -7,30 +7,20 @@
>  
>  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
>  
> -add_library(
> -	ubuntu_application_api_mirserver SHARED
> -	${SOURCES}
> -)
> -
>  include_directories(
>      ${CMAKE_BINARY_DIR}/include
>      ${MIRSERVER_INCLUDE_DIRS}
>  )
>  
> +add_library(
> +	ubuntu_application_api_mirserver STATIC
> +	${SOURCES}
> +)
> +
>  target_link_libraries(
>  	ubuntu_application_api_mirserver
> -        ${MIRSERVER_LDFLAGS} ${MIRSERVER_LIBRARIES}
> -        -Wl,--whole-archive ubuntu_application_api_mircommon ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
> -        -Wl,--no-whole-archive
> -)
> -
> -
> -set_target_properties(
> -	ubuntu_application_api_mirserver
> -	PROPERTIES
> -	VERSION 1.0
> -	SOVERSION 1
> -)
> -
> -install(TARGETS ubuntu_application_api_mirserver ${INSTALL_TARGETS_DEFAULT_ARGS})
> +
> +    ${MIRSERVER_LDFLAGS} ${MIRSERVER_LIBRARIES}
> +)
> +
>  install(FILES ubuntu_application_api_mirserver_priv.h DESTINATION include/ubuntu/application)
> 
> === modified file 'src/ubuntu/application/common/mirserver/ubuntu_application_api_mirserver.cpp'
> --- src/ubuntu/mirserver/ubuntu_application_api_mirserver.cpp	2014-04-15 20:23:07 +0000
> +++ src/ubuntu/application/common/mirserver/ubuntu_application_api_mirserver.cpp	2014-05-28 14:34:51 +0000
> @@ -16,7 +16,6 @@
>   * Authored by: Robert Carr <robert.carr at canonical.com>
>   */
>  
> -#include "ubuntu_application_api_mirserver_priv.h"
>  #include "application_instance_mirserver_priv.h"
>  #include "window_properties_mirserver_priv.h"
>  #include "window_mirserver_priv.h"
> @@ -27,6 +26,7 @@
>  #include "mircommon/mir/geometry/rectangles.h"
>  
>  // C APIs
> +#include <ubuntu/application/init.h>
>  #include <ubuntu/application/lifecycle_delegate.h>
>  #include <ubuntu/application/ui/window.h>
>  #include <ubuntu/application/ui/options.h>
> @@ -77,19 +77,20 @@
>  
>  extern "C"
>  {
> -void ua_ui_mirserver_init(mir::DefaultServerConfiguration& config)
> +void u_application_init(void *args)
>  {
>      auto context = global_mirserver_context();
> +    mir::DefaultServerConfiguration* config = reinterpret_cast<mir::DefaultServerConfiguration*>(args);
>  
> -    context->display = config.the_display();
> -    context->buffer_allocator = config.the_buffer_allocator();
> -    context->surface_coordinator = config.the_surface_coordinator();
> -    context->session_listener = config.the_session_listener();
> +    context->surface_coordinator = config->the_surface_coordinator();
> +    context->buffer_allocator = config->the_buffer_allocator();
> +    context->display = config->the_display();
> +    context->session_listener = config->the_session_listener();
>      context->input_platform = mir::input::receiver::InputPlatform::create();
> -    context->egl_client = config.the_graphics_platform()->create_internal_client();
> +    context->egl_client = config->the_graphics_platform()->create_internal_client();
>  }
>  
> -void ua_ui_mirserver_finish()
> +void u_application_finish()
>  {
>      auto context = global_mirserver_context();
>  
> @@ -290,6 +291,13 @@
>      delete window;
>  }
>  
> +void ua_ui_window_get_size(UAUiWindow* u_window, uint32_t *width, uint32_t *height)
> +{
> +    (void) u_window;
> +    (void) width;
> +    (void) height;
> +}
> +
>  UStatus ua_ui_window_move(UAUiWindow* window, uint32_t x, uint32_t y)
>  {
>      // TODO<mir,papi>: Implement. But should this exist?
> 
> === added directory 'src/ubuntu/application/desktop'
> === added file 'src/ubuntu/application/desktop/CMakeLists.txt'
> --- src/ubuntu/application/desktop/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/desktop/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,66 @@
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
> +
> +add_library(
> +  ubuntu_application_api_desktop_mirclient MODULE
> +
> +  module.cpp
> +  module_version.h
> +)
> +
> +add_library(
> +  ubuntu_application_api_desktop_mirserver MODULE
> +
> +  module.cpp
> +  module_version.h
> +)
> +
> +target_link_libraries(
> +  ubuntu_application_api_desktop_mirclient
> +
> +  "-Wl,--whole-archive"
> +  ubuntu_application_api_mirclient
> +  ubuntu_application_api_mircommon
> +  #TODO: ubuntu_application_api_d_sensors
> +  ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
> +  "-Wl,--no-whole-archive"
> +  #TODO: Alarms
> +)
> +
> +target_link_libraries(
> +  ubuntu_application_api_desktop_mirserver
> +
> +  "-Wl,--whole-archive"
> +  ubuntu_application_api_mirserver
> +  ubuntu_application_api_mircommon
> +  #TODO: ubuntu_application_api_d_sensors
> +  ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
> +  "-Wl,--no-whole-archive"
> +  #TODO: Alarms
> +)
> +
> +set_target_properties(
> +  ubuntu_application_api_desktop_mirclient
> +  PROPERTIES
> +  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> +  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> +)
> +
> +set_target_properties(
> +  ubuntu_application_api_desktop_mirserver
> +  PROPERTIES
> +  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> +  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> +)
> +install(
> +  TARGETS ubuntu_application_api_desktop_mirclient
> +  # this is not a development library to compile against, users should always
> +  # specify the SONAME; so don't build a *.so
> +  LIBRARY DESTINATION "${LIB_INSTALL_DIR}" NAMELINK_SKIP
> +)
> +
> +install(
> +  TARGETS ubuntu_application_api_desktop_mirserver
> +  # this is not a development library to compile against, users should always
> +  # specify the SONAME; so don't build a *.so
> +  LIBRARY DESTINATION "${LIB_INSTALL_DIR}" NAMELINK_SKIP
> +)
> 
> === added file 'src/ubuntu/application/desktop/module.cpp'
> --- src/ubuntu/application/desktop/module.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/desktop/module.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,28 @@
> +/*
> + * Copyright (C) 2014 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#include <ubuntu/application/init.h>
> +
> +#include "module_version.h"
> +
> +void u_application_module_version(uint32_t *major, uint32_t *minor, uint32_t *patch)
> +{
> +    *major = (uint32_t) MODULE_VERSION_MAJOR;
> +    *minor = (uint32_t) MODULE_VERSION_MINOR;
> +    *patch = (uint32_t) MODULE_VERSION_PATCH;
> +}
> 
> === added file 'src/ubuntu/application/desktop/module_version.h'
> --- src/ubuntu/application/desktop/module_version.h	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/desktop/module_version.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,3 @@
> +#define MODULE_VERSION_MAJOR  2
> +#define MODULE_VERSION_MINOR  0
> +#define MODULE_VERSION_PATCH  0
> 
> === renamed directory 'src/ubuntu/testbackend' => 'src/ubuntu/application/testbackend'
> === modified file 'src/ubuntu/application/testbackend/CMakeLists.txt'
> --- src/ubuntu/testbackend/CMakeLists.txt	2014-01-08 15:17:41 +0000
> +++ src/ubuntu/application/testbackend/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -3,6 +3,15 @@
>  add_library(
>    ubuntu_application_api_test SHARED
>    ubuntu_application_sensors.cpp
> +  
> +  module.cpp
> +  module_version.h
> +)
> +
> +target_link_libraries(
> +  ubuntu_application_api_test
> +
> +  rt
>  )
>  
>  set_target_properties(
> 
> === added file 'src/ubuntu/application/testbackend/module.cpp'
> --- src/ubuntu/application/testbackend/module.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/testbackend/module.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,28 @@
> +/*
> + * Copyright (C) 2014 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#include <ubuntu/application/init.h>
> +
> +#include "module_version.h"
> +
> +void u_application_module_version(uint32_t *major, uint32_t *minor, uint32_t *patch)
> +{
> +    *major = (uint32_t) MODULE_VERSION_MAJOR;
> +    *minor = (uint32_t) MODULE_VERSION_MINOR;
> +    *patch = (uint32_t) MODULE_VERSION_PATCH;
> +}
> 
> === added file 'src/ubuntu/application/testbackend/module_version.h'
> --- src/ubuntu/application/testbackend/module_version.h	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/testbackend/module_version.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,3 @@
> +#define MODULE_VERSION_MAJOR  2
> +#define MODULE_VERSION_MINOR  0
> +#define MODULE_VERSION_PATCH  0
> 
> === added directory 'src/ubuntu/application/touch'
> === added file 'src/ubuntu/application/touch/CMakeLists.txt'
> --- src/ubuntu/application/touch/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/touch/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,68 @@
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
> +
> +add_subdirectory(hybris)
> +
> +add_library(
> +  ubuntu_application_api_touch_mirclient MODULE
> +
> +  module.cpp
> +  module_version.h
> +)
> +
> +add_library(
> +  ubuntu_application_api_touch_mirserver MODULE
> +
> +  module.cpp
> +  module_version.h
> +)
> +
> +target_link_libraries(
> +  ubuntu_application_api_touch_mirclient
> +
> +  "-Wl,--whole-archive"
> +  ubuntu_application_api_mirclient
> +  ubuntu_application_api_mircommon
> +  ubuntu_application_api_hybris
> +  ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
> +  "-Wl,--no-whole-archive"
> +  #TODO: Alarms
> +)
> +
> +target_link_libraries(
> +  ubuntu_application_api_touch_mirserver
> +
> +  "-Wl,--whole-archive"
> +  ubuntu_application_api_mirserver
> +  ubuntu_application_api_mircommon
> +  ubuntu_application_api_hybris
> +  ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
> +  "-Wl,--no-whole-archive"
> +  #TODO: Alarms
> +)
> +
> +set_target_properties(
> +  ubuntu_application_api_touch_mirclient
> +  PROPERTIES
> +  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> +  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> +)
> +
> +set_target_properties(
> +  ubuntu_application_api_touch_mirserver
> +  PROPERTIES
> +  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> +  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> +)
> +install(
> +  TARGETS ubuntu_application_api_touch_mirclient
> +  # this is not a development library to compile against, users should always
> +  # specify the SONAME; so don't build a *.so
> +  LIBRARY DESTINATION "${LIB_INSTALL_DIR}" NAMELINK_SKIP
> +)
> +
> +install(
> +  TARGETS ubuntu_application_api_touch_mirserver
> +  # this is not a development library to compile against, users should always
> +  # specify the SONAME; so don't build a *.so
> +  LIBRARY DESTINATION "${LIB_INSTALL_DIR}" NAMELINK_SKIP
> +)
> 
> === renamed directory 'src/ubuntu/hybris' => 'src/ubuntu/application/touch/hybris'
> === modified file 'src/ubuntu/application/touch/hybris/CMakeLists.txt'
> --- src/ubuntu/hybris/CMakeLists.txt	2014-05-21 07:15:34 +0000
> +++ src/ubuntu/application/touch/hybris/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -1,63 +1,17 @@
> -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
>  
>  add_library(
> -  ubuntu_application_api SHARED
> -
> -  ubuntu_application_api_hybris.cpp
> +  ubuntu_application_api_hybris STATIC
> +  
>    ubuntu_application_sensors_hybris.cpp
>  )
>  
> -add_library(
> -  ubuntu_platform_hardware_api SHARED
> -  ubuntu_platform_hardware_api.cpp
> -)
> -
>  include_directories(
>    ${CMAKE_BINARY_DIR}/include
>  )
>  
>  target_link_libraries(
> -  ubuntu_application_api
> -
> -  "-Wl,--whole-archive"
> -  ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
> -  "-Wl,--no-whole-archive"
> -  ${Hybris}
> -)
> -
> -target_link_libraries(
> -  ubuntu_platform_hardware_api
> -
> -  "-Wl,--whole-archive"
> -  ${UBUNTU_HARDWARE_API_LINK_LIBRARIES}
> -  "-Wl,--no-whole-archive"
> -
> -  dl
> -  ${Hybris}
> -)
> -
> -set_target_properties(
> -  ubuntu_application_api
> -  PROPERTIES
> -  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> -  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> -)
> -
> -set_target_properties(
> -  ubuntu_platform_hardware_api
> -  PROPERTIES
> -  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> -  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> -)
> -
> -install(
> -  TARGETS ubuntu_application_api
> -  ${INSTALL_TARGETS_DEFAULT_ARGS}
> -)
> -
> -install(
> -  TARGETS ubuntu_platform_hardware_api
> -  ${INSTALL_TARGETS_DEFAULT_ARGS}
> -)
> -
> -add_subdirectory(tests/)
> +  ubuntu_application_api_hybris
> +  
> +  ${Hybris}
> +)
> 
> === renamed file 'src/ubuntu/hybris/bridge.h' => 'src/ubuntu/application/touch/hybris/hybris_module.h'
> --- src/ubuntu/hybris/bridge.h	2014-05-08 10:20:53 +0000
> +++ src/ubuntu/application/touch/hybris/hybris_module.h	2014-05-28 14:34:51 +0000
> @@ -16,16 +16,10 @@
>   * Authored by: Thomas Voss <thomas.voss at canonical.com>
>   *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
>   */
> -#ifndef BRIDGE_H_
> -#define BRIDGE_H_
> -
> -#include <assert.h>
> -#include <dlfcn.h>
> -#include <stddef.h>
> -#include <stdlib.h>
> -#include <string.h>
> -
> -#define HIDDEN_SYMBOL __attribute__ ((visibility ("hidden")))
> +#ifndef HYBRIS_MODULE_H_
> +#define HYBRIS_MODULE_H_
> +
> +#include <bridge.h>
>  
>  #ifdef __cplusplus
>  extern "C" {
> @@ -40,188 +34,28 @@
>  
>  namespace internal
>  {
> -
> -/* By default we load the backend from /system/lib/libubuntu_application_api.so
> - * Programs can select a different backend with $UBUNTU_PLATFORM_API_BACKEND,
> - * which either needs to be a full path or just the file name (then it will be
> - * looked up in the usual library search path, see dlopen(3)).
> - */
> -struct HIDDEN_SYMBOL ToApplication
> +struct HIDDEN_SYMBOL ToHybris
>  {
>      static const char* path()
>      {
> -        static const char* cache = NULL;
> -
> -        if (cache == NULL) {
> -            cache = secure_getenv("UBUNTU_PLATFORM_API_BACKEND");
> -            if (cache == NULL)
> -                cache = "/system/lib/libubuntu_application_api.so";
> -        }
> -
> +        static const char* cache = "/system/lib/libubuntu_application_api.so";
>          return cache;
>      }
> -};
> -
> -template<typename Scope = ToApplication>
> -class HIDDEN_SYMBOL Bridge
> -{
> -  public:
> -    static Bridge<Scope>& instance()
> -    { 
> -        static Bridge<Scope> bridge; 
> -        return bridge; 
> -    }
> -
> -    void* resolve_symbol(const char* symbol) const
> -    {
> -        return dlsym_fn(lib_handle, symbol);
> -    }
> -
> -  protected:
> -    Bridge() : lib_handle(android_dlopen(Scope::path(), RTLD_LAZY))
> -    {
> -        const char* path = Scope::path();
> -        /* use Android dl functions for Android libs in /system/, glibc dl
> -         * functions for others */
> -        if (strncmp(path, "/system/", 8) == 0) {
> -            lib_handle = android_dlopen(path, RTLD_LAZY);
> -            dlsym_fn = android_dlsym;
> -        } else {
> -            lib_handle = dlopen(path, RTLD_LAZY);
> -            dlsym_fn = dlsym;
> -        }
> -    }
> -
> -    ~Bridge()
> -    {
> -        // TODO android_dlclose(libcamera_handle);
> -    }
> -
> -    void* lib_handle;
> -    void* (*dlsym_fn) (void*, const char*);
> -};
> -
> -}
> -
> -#ifdef __cplusplus
> -extern "C" {
> -#endif
> -
> -/**********************************************************/
> -/*********** Implementation starts here *******************/
> -/**********************************************************/
> -
> -#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) internal::Bridge<>::instance().resolve_symbol(sym); }
> -
> -// this allows DLSYM to return NULL (happens if the backend is not available),
> -// and returns NULL in that case; return_type must be a pointer!
> -#define IMPLEMENT_CTOR0(return_type, symbol)  \
> -    return_type symbol()                          \
> -    {                                             \
> -        static return_type (*f)() = NULL;         \
> -        DLSYM(&f, #symbol);                       \
> -        return f ? f() : NULL;}
> -
> -#define IMPLEMENT_FUNCTION0(return_type, symbol)  \
> -    return_type symbol()                          \
> -    {                                             \
> -        static return_type (*f)() = NULL;         \
> -        DLSYM(&f, #symbol);                       \
> -        return f();}
> -
> -#define IMPLEMENT_VOID_FUNCTION0(symbol)          \
> -    void symbol()                                 \
> -    {                                             \
> -        static void (*f)() = NULL;                \
> -        DLSYM(&f, #symbol);                       \
> -        f();}
> -
> -#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
> -    return_type symbol(arg1 _1)                        \
> -    {                                                  \
> -        static return_type (*f)(arg1) = NULL;          \
> -        DLSYM(&f, #symbol);                     \
> -        return f(_1); }
> -
> -#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1)               \
> -    void symbol(arg1 _1)                                     \
> -    {                                                        \
> -        static void (*f)(arg1) = NULL;                       \
> -        DLSYM(&f, #symbol);                           \
> -        f(_1); }
> -
> -#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2)    \
> -    return_type symbol(arg1 _1, arg2 _2)                        \
> -    {                                                           \
> -        static return_type (*f)(arg1, arg2) = NULL;             \
> -        DLSYM(&f, #symbol);                              \
> -        return f(_1, _2); }
> -
> -#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2)            \
> -    void symbol(arg1 _1, arg2 _2)                               \
> -    {                                                           \
> -        static void (*f)(arg1, arg2) = NULL;                    \
> -        DLSYM(&f, #symbol);                              \
> -        f(_1, _2); }
> -
> -#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3)    \
> -    return_type symbol(arg1 _1, arg2 _2, arg3 _3)                     \
> -    {                                                                 \
> -        static return_type (*f)(arg1, arg2, arg3) = NULL;             \
> -        DLSYM(&f, #symbol);                                           \
> -        return f(_1, _2, _3); } 
> -
> -#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3)      \
> -    void symbol(arg1 _1, arg2 _2, arg3 _3)                      \
> -    {                                                           \
> -        static void (*f)(arg1, arg2, arg3) = NULL;              \
> -        DLSYM(&f, #symbol);                                     \
> -        f(_1, _2, _3); }
> -
> -#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
> -    void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4)              \
> -    {                                                            \
> -        static void (*f)(arg1, arg2, arg3, arg4) = NULL;         \
> -        DLSYM(&f, #symbol);                                      \
> -        f(_1, _2, _3, _4); }
> -
> -#define IMPLEMENT_VOID_SF_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
> -    void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4)              \
> -    {                                                            \
> -        static void (*f)(arg1, arg2, arg3, arg4) = NULL;         \
> -        DLSYM(&f, #symbol);                                      \
> -        f(_1, _2, _3, _4); }
> -
> -#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
> -    return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4)               \
> -    {                                                                    \
> -        static return_type (*f)(arg1, arg2, arg3, arg4) = NULL;          \
> -        DLSYM(&f, #symbol);                                              \
> -        return f(_1, _2, _3, _4); }
> -
> -#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
> -    return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6)         \
> -    {                                                                                \
> -        static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL;          \
> -        DLSYM(&f, #symbol);                                                          \
> -        return f(_1, _2, _3, _4, _5, _6); }
> -
> -#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
> -    void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
> -    {                                                                   \
> -        static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
> -        DLSYM(&f, #symbol);                                             \
> -        f(_1, _2, _3, _4, _5, _6, _7); }
> -
> -#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
> -    void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
> -    {                                                                   \
> -        static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
> -        DLSYM(&f, #symbol);                                             \
> -        f(_1, _2, _3, _4, _5, _6, _7, _8); }
> -
> -#ifdef __cplusplus
> -}
> -#endif
> -
> -#endif // BRIDGE_H_
> +
> +    static void* dlopen_fn(const char* path, int flags)
> +    {
> +        return android_dlopen(path, flags);
> +    }
> +
> +    static void* dlsym_fn(void* handle, const char* symbol)
> +    {
> +        return android_dlsym(handle, symbol);
> +    }
> +};
> +}
> +
> +#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) internal::Bridge<internal::ToHybris>::instance().resolve_symbol(sym); }
> +
> +#include <bridge_defs.h>
> +
> +#endif // HYBRIS_MODULE_H_
> 
> === modified file 'src/ubuntu/application/touch/hybris/ubuntu_application_api_hybris.cpp'
> --- src/ubuntu/hybris/ubuntu_application_api_hybris.cpp	2013-12-11 02:20:26 +0000
> +++ src/ubuntu/application/touch/hybris/ubuntu_application_api_hybris.cpp	2014-05-28 14:34:51 +0000
> @@ -29,7 +29,7 @@
>  #include <ubuntu/application/ui/clipboard.h>
>  #include <ubuntu/application/ui/display.h>
>  
> -#include "bridge.h"
> +#include "hybris_module.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> 
> === modified file 'src/ubuntu/application/touch/hybris/ubuntu_application_sensors_hybris.cpp'
> --- src/ubuntu/hybris/ubuntu_application_sensors_hybris.cpp	2014-02-13 13:12:41 +0000
> +++ src/ubuntu/application/touch/hybris/ubuntu_application_sensors_hybris.cpp	2014-05-28 14:34:51 +0000
> @@ -21,7 +21,7 @@
>  #include <ubuntu/application/sensors/proximity.h>
>  #include <ubuntu/application/sensors/light.h>
>  
> -#include "bridge.h"
> +#include "hybris_module.h"
>  
>  // Ubuntu Application Sensors
>  
> 
> === added file 'src/ubuntu/application/touch/module.cpp'
> --- src/ubuntu/application/touch/module.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/touch/module.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,28 @@
> +/*
> + * Copyright (C) 2014 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +#include <ubuntu/application/init.h>
> +
> +#include "module_version.h"
> +
> +void u_application_module_version(uint32_t *major, uint32_t *minor, uint32_t *patch)
> +{
> +    *major = (uint32_t) MODULE_VERSION_MAJOR;
> +    *minor = (uint32_t) MODULE_VERSION_MINOR;
> +    *patch = (uint32_t) MODULE_VERSION_PATCH;
> +}
> 
> === added file 'src/ubuntu/application/touch/module_version.h'
> --- src/ubuntu/application/touch/module_version.h	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/touch/module_version.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,3 @@
> +#define MODULE_VERSION_MAJOR  2
> +#define MODULE_VERSION_MINOR  0
> +#define MODULE_VERSION_PATCH  0
> 
> === added file 'src/ubuntu/application/ubuntu_application_api.cpp'
> --- src/ubuntu/application/ubuntu_application_api.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/application/ubuntu_application_api.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,222 @@
> +/*
> + * Copyright (C) 2012 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Thomas Voss <thomas.voss at canonical.com>
> + *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +// C APIs
> +#include <ubuntu/application/lifecycle_delegate.h>
> +#include <ubuntu/application/ui/window.h>
> +#include <ubuntu/application/ui/options.h>
> +#include <ubuntu/application/ui/session.h>
> +#include <ubuntu/application/ui/clipboard.h>
> +#include <ubuntu/application/ui/display.h>
> +#include <ubuntu/application/sensors/accelerometer.h>
> +#include <ubuntu/application/sensors/proximity.h>
> +#include <ubuntu/application/sensors/light.h>
> +#include <ubuntu/application/sensors/haptic.h>
> +
> +#include <ubuntu/application/location/service.h>
> +#include <ubuntu/application/location/heading_update.h>
> +#include <ubuntu/application/location/position_update.h>
> +#include <ubuntu/application/location/velocity_update.h>
> +
> +#include <ubuntu/application/url_dispatcher/service.h>
> +
> +#include <ubuntu/application/init.h>
> +
> +#include "base_module.h"
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +// Application Module Config
> +IMPLEMENT_VOID_FUNCTION3(u_application_module_version, uint32_t*, uint32_t*, uint32_t*);
> +IMPLEMENT_VOID_FUNCTION1(u_application_init, void*);
> +IMPLEMENT_VOID_FUNCTION0(u_application_finish);
> +
> +// Session helpers
> +IMPLEMENT_FUNCTION0(UAUiSessionProperties*, ua_ui_session_properties_new);
> +IMPLEMENT_VOID_FUNCTION2(ua_ui_session_properties_set_type, UAUiSessionProperties*, UAUiSessionType);
> +IMPLEMENT_VOID_FUNCTION2(ua_ui_session_properties_set_remote_pid, UAUiSessionProperties*, uint32_t);
> +IMPLEMENT_FUNCTION1(UAUiSession*, ua_ui_session_new_with_properties, UAUiSessionProperties*);
> +
> +// Lifecycle helpers
> +IMPLEMENT_FUNCTION0(UApplicationLifecycleDelegate*, u_application_lifecycle_delegate_new);
> +IMPLEMENT_VOID_FUNCTION2(u_application_lifecycle_delegate_set_context, UApplicationLifecycleDelegate*, void*);
> +IMPLEMENT_VOID_FUNCTION1(u_application_lifecycle_delegate_ref, UApplicationLifecycleDelegate*);
> +IMPLEMENT_VOID_FUNCTION1(u_application_lifecycle_delegate_unref, UApplicationLifecycleDelegate*);
> +IMPLEMENT_VOID_FUNCTION2(u_application_lifecycle_delegate_set_application_resumed_cb, UApplicationLifecycleDelegate*, u_on_application_resumed);
> +IMPLEMENT_VOID_FUNCTION2(u_application_lifecycle_delegate_set_application_about_to_stop_cb, UApplicationLifecycleDelegate*, u_on_application_about_to_stop);
> +
> +// Application Helpers
> +
> +// UApplicationId
> +IMPLEMENT_FUNCTION2(UApplicationId*, u_application_id_new_from_stringn, const char*, size_t);
> +IMPLEMENT_VOID_FUNCTION1(u_application_id_destroy, UApplicationId*);
> +IMPLEMENT_FUNCTION2(int, u_application_id_compare, UApplicationId*, UApplicationId*);
> +
> +// UApplicationDescription
> +IMPLEMENT_FUNCTION0(UApplicationDescription*, u_application_description_new);
> +IMPLEMENT_VOID_FUNCTION1(u_application_description_destroy, UApplicationDescription*);
> +IMPLEMENT_VOID_FUNCTION2(u_application_description_set_application_id, UApplicationDescription*, UApplicationId*);
> +IMPLEMENT_VOID_FUNCTION2(u_application_description_set_application_lifecycle_delegate, UApplicationDescription*, UApplicationLifecycleDelegate*);
> +
> +// UApplicationOptions
> +IMPLEMENT_FUNCTION2(UApplicationOptions*, u_application_options_new_from_cmd_line, int, char**);
> +IMPLEMENT_VOID_FUNCTION1(u_application_options_destroy, UApplicationOptions*);
> +IMPLEMENT_FUNCTION1(UAUiFormFactor, u_application_options_get_form_factor, UApplicationOptions*);
> +IMPLEMENT_FUNCTION1(UAUiStage, u_application_options_get_stage, UApplicationOptions*);
> +
> +// UApplicationInstance
> +IMPLEMENT_FUNCTION2(UApplicationInstance*, u_application_instance_new_from_description_with_options, UApplicationDescription*, UApplicationOptions*);
> +
> +// Application Ui Helpers
> +
> +// Clipboard
> +IMPLEMENT_VOID_FUNCTION2(ua_ui_set_clipboard_content, void*, size_t);
> +IMPLEMENT_VOID_FUNCTION2(ua_ui_get_clipboard_content, void**, size_t*);
> +
> +// UAUiDisplay
> +IMPLEMENT_FUNCTION1(UAUiDisplay*, ua_ui_display_new_with_index, size_t);
> +IMPLEMENT_VOID_FUNCTION1(ua_ui_display_destroy, UAUiDisplay*);
> +IMPLEMENT_FUNCTION1(uint32_t, ua_ui_display_query_horizontal_res, UAUiDisplay*);
> +IMPLEMENT_FUNCTION1(uint32_t, ua_ui_display_query_vertical_res, UAUiDisplay*);
> +IMPLEMENT_FUNCTION1(EGLNativeDisplayType, ua_ui_display_get_native_type, UAUiDisplay*);
> +
> +
> +// UAUiWindowProperties
> +IMPLEMENT_FUNCTION0(UAUiWindowProperties*, ua_ui_window_properties_new_for_normal_window);
> +IMPLEMENT_VOID_FUNCTION1(ua_ui_window_properties_destroy, UAUiWindowProperties*);
> +IMPLEMENT_VOID_FUNCTION3(ua_ui_window_properties_set_titlen, UAUiWindowProperties*, const char*, size_t);
> +IMPLEMENT_FUNCTION1(const char*, ua_ui_window_properties_get_title, UAUiWindowProperties*);
> +IMPLEMENT_VOID_FUNCTION2(ua_ui_window_properties_set_role, UAUiWindowProperties*, UAUiWindowRole);
> +IMPLEMENT_VOID_FUNCTION3(ua_ui_window_properties_set_input_cb_and_ctx, UAUiWindowProperties*, UAUiWindowInputEventCb, void*);
> +IMPLEMENT_VOID_FUNCTION3(ua_ui_window_properties_set_dimensions, UAUiWindowProperties*, uint32_t, uint32_t);
> +
> +// UAUiWindow
> +IMPLEMENT_FUNCTION2(UAUiWindow*, ua_ui_window_new_for_application_with_properties, UApplicationInstance*, UAUiWindowProperties*);
> +IMPLEMENT_VOID_FUNCTION1(ua_ui_window_destroy, UAUiWindow*);
> +IMPLEMENT_VOID_FUNCTION3(ua_ui_window_get_size, UAUiWindow*, uint32_t*, uint32_t*);
> +IMPLEMENT_FUNCTION3(UStatus, ua_ui_window_move, UAUiWindow*, uint32_t, uint32_t);
> +IMPLEMENT_FUNCTION3(UStatus, ua_ui_window_resize, UAUiWindow*, uint32_t, uint32_t);
> +IMPLEMENT_FUNCTION1(UStatus, ua_ui_window_hide, UAUiWindow*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_ui_window_show, UAUiWindow*);
> +IMPLEMENT_VOID_FUNCTION1(ua_ui_window_request_fullscreen, UAUiWindow*);
> +IMPLEMENT_FUNCTION1(EGLNativeWindowType, ua_ui_window_get_native_type, UAUiWindow*);
> +
> +// Ubuntu Application Sensors
> +
> +// Acceleration Sensor
> +IMPLEMENT_CTOR0(UASensorsAccelerometer*, ua_sensors_accelerometer_new);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_accelerometer_enable, UASensorsAccelerometer*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_accelerometer_disable, UASensorsAccelerometer*);
> +IMPLEMENT_FUNCTION1(uint32_t, ua_sensors_accelerometer_get_min_delay, UASensorsAccelerometer*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_accelerometer_get_min_value, UASensorsAccelerometer*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_accelerometer_get_max_value, UASensorsAccelerometer*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_accelerometer_get_resolution, UASensorsAccelerometer*, float*);
> +IMPLEMENT_VOID_FUNCTION3(ua_sensors_accelerometer_set_reading_cb, UASensorsAccelerometer*, on_accelerometer_event_cb, void*);
> +
> +// Acceleration Sensor Event
> +IMPLEMENT_FUNCTION1(uint64_t, uas_accelerometer_event_get_timestamp, UASAccelerometerEvent*);
> +IMPLEMENT_FUNCTION2(UStatus, uas_accelerometer_event_get_acceleration_x, UASAccelerometerEvent*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, uas_accelerometer_event_get_acceleration_y, UASAccelerometerEvent*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, uas_accelerometer_event_get_acceleration_z, UASAccelerometerEvent*, float*);
> +
> +// Proximity Sensor
> +IMPLEMENT_CTOR0(UASensorsProximity*, ua_sensors_proximity_new);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_proximity_enable, UASensorsProximity*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_proximity_disable, UASensorsProximity*);
> +IMPLEMENT_FUNCTION1(uint32_t, ua_sensors_proximity_get_min_delay, UASensorsProximity*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_proximity_get_min_value, UASensorsProximity*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_proximity_get_max_value, UASensorsProximity*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_proximity_get_resolution, UASensorsProximity*, float*);
> +IMPLEMENT_VOID_FUNCTION3(ua_sensors_proximity_set_reading_cb, UASensorsProximity*, on_proximity_event_cb, void*);
> +
> +// Proximity Sensor Event
> +IMPLEMENT_FUNCTION1(uint64_t, uas_proximity_event_get_timestamp, UASProximityEvent*);
> +IMPLEMENT_FUNCTION1(UASProximityDistance, uas_proximity_event_get_distance, UASProximityEvent*);
> +
> +// Ambient Light Sensor
> +IMPLEMENT_CTOR0(UASensorsLight*, ua_sensors_light_new);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_light_enable, UASensorsLight*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_light_disable, UASensorsLight*);
> +IMPLEMENT_FUNCTION1(uint32_t, ua_sensors_light_get_min_delay, UASensorsLight*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_light_get_min_value, UASensorsLight*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_light_get_max_value, UASensorsLight*, float*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_light_get_resolution, UASensorsLight*, float*);
> +IMPLEMENT_VOID_FUNCTION3(ua_sensors_light_set_reading_cb, UASensorsLight*, on_light_event_cb, void*);
> +
> +// Ambient Light Sensor Event
> +IMPLEMENT_FUNCTION1(uint64_t, uas_light_event_get_timestamp, UASLightEvent*);
> +IMPLEMENT_FUNCTION2(UStatus, uas_light_event_get_light, UASLightEvent*, float*);
> +
> +// Haptic Sensor
> +IMPLEMENT_CTOR0(UASensorsHaptic*, ua_sensors_haptic_new);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_haptic_enable, UASensorsHaptic*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_sensors_haptic_disable, UASensorsHaptic*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_sensors_haptic_vibrate_once, UASensorsHaptic*, uint32_t);
> +IMPLEMENT_FUNCTION3(UStatus, ua_sensors_haptic_vibrate_with_pattern, UASensorsHaptic*, uint32_t*, uint32_t);
> +
> +// Location
> +
> +IMPLEMENT_VOID_FUNCTION1(ua_location_service_controller_ref, UALocationServiceController*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_service_controller_unref, UALocationServiceController*);
> +IMPLEMENT_VOID_FUNCTION3(ua_location_service_controller_set_status_changed_handler, UALocationServiceController*, UALocationServiceStatusChangedHandler, void*);
> +IMPLEMENT_FUNCTION2(UStatus, ua_location_service_controller_query_status, UALocationServiceController*, UALocationServiceStatusFlags*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_location_service_controller_enable_service, UALocationServiceController*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_location_service_controller_disable_service, UALocationServiceController*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_location_service_controller_enable_gps, UALocationServiceController*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_location_service_controller_disable_gps, UALocationServiceController*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_heading_update_ref, UALocationHeadingUpdate*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_heading_update_unref, UALocationHeadingUpdate*);
> +IMPLEMENT_FUNCTION1(uint64_t, ua_location_heading_update_get_timestamp, UALocationHeadingUpdate*);
> +IMPLEMENT_FUNCTION1(double, ua_location_heading_update_get_heading_in_degree, UALocationHeadingUpdate*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_position_update_ref, UALocationPositionUpdate*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_position_update_unref, UALocationPositionUpdate*);
> +IMPLEMENT_FUNCTION1(uint64_t, ua_location_position_update_get_timestamp, UALocationPositionUpdate*);
> +IMPLEMENT_FUNCTION1(double, ua_location_position_update_get_latitude_in_degree, UALocationPositionUpdate*);
> +IMPLEMENT_FUNCTION1(double, ua_location_position_update_get_longitude_in_degree, UALocationPositionUpdate*);
> +IMPLEMENT_FUNCTION1(bool, ua_location_position_update_has_altitude, UALocationPositionUpdate*);
> +IMPLEMENT_FUNCTION1(double, ua_location_position_update_get_altitude_in_meter, UALocationPositionUpdate*);
> +IMPLEMENT_FUNCTION1(UALocationServiceSession*, ua_location_service_create_session_for_low_accuracy, UALocationServiceRequirementsFlags);
> +IMPLEMENT_FUNCTION1(UALocationServiceSession*, ua_location_service_create_session_for_high_accuracy, UALocationServiceRequirementsFlags);
> +IMPLEMENT_CTOR0(UALocationServiceController*, ua_location_service_create_controller);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_service_session_ref, UALocationServiceSession*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_service_session_unref, UALocationServiceSession*);
> +IMPLEMENT_VOID_FUNCTION3(ua_location_service_session_set_position_updates_handler, UALocationServiceSession*, UALocationServiceSessionPositionUpdatesHandler, void*);
> +IMPLEMENT_VOID_FUNCTION3(ua_location_service_session_set_heading_updates_handler, UALocationServiceSession*, UALocationServiceSessionHeadingUpdatesHandler, void*);
> +IMPLEMENT_VOID_FUNCTION3(ua_location_service_session_set_velocity_updates_handler, UALocationServiceSession*, UALocationServiceSessionVelocityUpdatesHandler, void*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_location_service_session_start_position_updates, UALocationServiceSession*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_service_session_stop_position_updates, UALocationServiceSession*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_location_service_session_start_heading_updates, UALocationServiceSession*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_service_session_stop_heading_updates, UALocationServiceSession*);
> +IMPLEMENT_FUNCTION1(UStatus, ua_location_service_session_start_velocity_updates, UALocationServiceSession*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_service_session_stop_velocity_updates, UALocationServiceSession*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_velocity_update_ref, UALocationVelocityUpdate*);
> +IMPLEMENT_VOID_FUNCTION1(ua_location_velocity_update_unref, UALocationVelocityUpdate*);
> +IMPLEMENT_FUNCTION1(uint64_t, ua_location_velocity_update_get_timestamp, UALocationVelocityUpdate*);
> +IMPLEMENT_FUNCTION1(double, ua_location_velocity_update_get_velocity_in_meters_per_second, UALocationVelocityUpdate*);
> +
> +// URL Dispatcher
> +
> +IMPLEMENT_CTOR0(UAUrlDispatcherSession*, ua_url_dispatcher_session);
> +IMPLEMENT_VOID_FUNCTION4(ua_url_dispatcher_session_open, UAUrlDispatcherSession*, const char*, UAUrlDispatcherSessionDispatchHandler, void*);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> 
> === added file 'src/ubuntu/hardware/CMakeLists.txt'
> --- src/ubuntu/hardware/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/hardware/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,45 @@
> +set(
> +  UBUNTU_HARDWARE_API_LINK_LIBRARIES
> +    
> +  ubuntu_hardware_alarm
> +)
> +
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
> +
> +include_directories(
> +  ${CMAKE_BINARY_DIR}/include
> +)
> +
> +include_directories(../../bridge)
> +
> +add_subdirectory(alarms/)
> +
> +add_library(
> +  ubuntu_platform_hardware_api SHARED
> +  ubuntu_platform_hardware_api.cpp
> +)
> +
> +target_link_libraries(
> +  ubuntu_platform_hardware_api
> +
> +  "-Wl,--whole-archive"
> +  ${UBUNTU_HARDWARE_API_LINK_LIBRARIES}
> +  "-Wl,--no-whole-archive"
> +
> +  dl
> +  ${Hybris}
> +)
> +
> +set_target_properties(
> +  ubuntu_platform_hardware_api
> +  PROPERTIES
> +  VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
> +  SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
> +)
> +
> +install(
> +  TARGETS ubuntu_platform_hardware_api
> +  ${INSTALL_TARGETS_DEFAULT_ARGS}
> +)
> +
> +add_subdirectory(tests/)
> 
> === added directory 'src/ubuntu/hardware/alarms'
> === renamed file 'src/ubuntu/hardware/CMakeLists.txt' => 'src/ubuntu/hardware/alarms/CMakeLists.txt'
> === renamed file 'src/ubuntu/hardware/alarm.cpp' => 'src/ubuntu/hardware/alarms/alarm.cpp'
> === added file 'src/ubuntu/hardware/android_hw_module.h'
> --- src/ubuntu/hardware/android_hw_module.h	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/hardware/android_hw_module.h	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,61 @@
> +/*
> + * Copyright (C) 2012 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Thomas Voss <thomas.voss at canonical.com>
> + *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +#ifndef ANDROID_HW_MODULE_H_
> +#define ANDROID_HW_MODULE_H_
> +
> +#include <bridge.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +extern void *android_dlopen(const char *filename, int flag);
> +extern void *android_dlsym(void *handle, const char *symbol);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +namespace internal
> +{
> +struct HIDDEN_SYMBOL ToHybris
> +{
> +    static const char* path()
> +    {
> +        static const char* cache = "/system/lib/libubuntu_application_api.so";
> +        return cache;
> +    }
> +
> +    static void* dlopen_fn(const char* path, int flags)
> +    {
> +        return android_dlopen(path, flags);
> +    }
> +
> +    static void* dlsym_fn(void* handle, const char* symbol)
> +    {
> +        return android_dlsym(handle, symbol);
> +    }
> +};
> +}
> +
> +#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) internal::Bridge<internal::ToHybris>::instance().resolve_symbol(sym); }
> +
> +#include <bridge_defs.h>
> +
> +#endif // ANDROID_HW_MODULE_H_
> 
> === added directory 'src/ubuntu/hardware/tests'
> === added file 'src/ubuntu/hardware/tests/CMakeLists.txt'
> --- src/ubuntu/hardware/tests/CMakeLists.txt	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/hardware/tests/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,17 @@
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
> +
> +include_directories(
> +  ${CMAKE_BINARY_DIR}/include
> +)
> +
> +add_executable(test_android_gps_api test_gps_api.cpp)
> +target_link_libraries(test_android_gps_api ubuntu_platform_hardware_api)
> +
> +add_executable(test_hardware_alarms_api test_alarms_api.cpp)
> +target_link_libraries(test_hardware_alarms_api ubuntu_platform_hardware_api)
> +
> +install(TARGETS
> +	test_android_gps_api
> +    test_hardware_alarms_api
> +	DESTINATION bin
> +)
> 
> === added file 'src/ubuntu/hardware/tests/test_alarms_api.cpp'
> --- src/ubuntu/hardware/tests/test_alarms_api.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/hardware/tests/test_alarms_api.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,62 @@
> +/*
> + * Copyright © 2013 Canonical Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Thomas Voß <thomas.voss at canonicalcom>
> + */
> +
> +#include <ubuntu/hardware/alarm.h>
> +
> +#include <cstdio>
> +#include <ctime>
> +
> +int main(int argc, char** argv)
> +{
> +    UHardwareAlarm alarm = u_hardware_alarm_create();
> +
> +    if (!alarm)
> +    {
> +        printf("Error creating handle to hardware alarms.\n");
> +        return 1;
> +    }
> +
> +    // Alarm in two seconds.
> +    timespec ts { 2, 0 };
> +
> +
> +    UStatus rc = u_hardware_alarm_set_relative_to_with_behavior(
> +        alarm,
> +        U_HARDWARE_ALARM_TIME_REFERENCE_RTC,
> +        U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE,
> +        &ts);
> +
> +    if (rc != U_STATUS_SUCCESS)
> +    {
> +        printf("Problem setting hardware alarm.\n");
> +        return 1;
> +    }
> +
> +    UHardwareAlarmWaitResult wait_result;
> +    rc = u_hardware_alarm_wait_for_next_alarm(alarm, &wait_result);
> +
> +    if (rc != U_STATUS_SUCCESS)
> +    {
> +        printf("Problem waiting for hardware alarm to go off.\n");
> +        return 1;
> +    }
> +
> +    printf("Successfully created and waited for a hw alarm.\n");
> +
> +    return 0;
> +}
> 
> === added file 'src/ubuntu/hardware/tests/test_gps_api.cpp'
> --- src/ubuntu/hardware/tests/test_gps_api.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/hardware/tests/test_gps_api.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,286 @@
> +/*
> + * Copyright © 2013 Canonical Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Daniel d'Andrada <daniel.dandrada at canonical.com>
> + */
> +#include <ubuntu/hardware/gps.h>
> +
> +#include <ctime>
> +#include <signal.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +#include <unistd.h>
> +
> +namespace ubuntu
> +{
> +class GPSTest
> +{
> +  public:
> +    GPSTest();
> +    ~GPSTest();
> +    bool init_and_start(const char* server, uint16_t port);
> +    bool stop();
> +    void inject_time();
> +    void inject_reference_location(float lat, float lon, float accuracy);
> +    UHardwareGps u_hardware_gps;
> +};
> +
> +void gps_location_cb(UHardwareGpsLocation* location, void* context)
> +{
> +    printf("gps_location_cb() called.\n");
> +}
> +
> +void gps_status_cb(uint16_t status, void* context)
> +{
> +    switch(status)
> +    {
> +    case U_HARDWARE_GPS_STATUS_NONE:
> +        printf("status: None\n");
> +        break;
> +    case U_HARDWARE_GPS_STATUS_SESSION_BEGIN:
> +        printf("status: Session Begin\n");
> +        break;
> +    case U_HARDWARE_GPS_STATUS_SESSION_END:
> +        printf("status: Session End\n");
> +        break;
> +    case U_HARDWARE_GPS_STATUS_ENGINE_ON:
> +        printf("status: Engine On\n");
> +        break;
> +    case U_HARDWARE_GPS_STATUS_ENGINE_OFF:
> +        printf("status: Engine Off\n");
> +    default:
> +        break;
> +    };
> +}
> +
> +void gps_sb_status_cb(UHardwareGpsSvStatus* sv_info, void* context)
> +{
> +    printf("gps_sb_status_cb() called, listing %d space vehicles\n", sv_info->num_svs);
> +}
> +
> +void gps_nmea_cb(int64_t timestamp, const char* nmea, int length, void* context)
> +{
> +    char str[length+1];
> +    memcpy(str, nmea, length);
> +    str[length] = 0;
> +    printf("gps_nmea_cb() - %s\n", str);
> +}
> +
> +void gps_set_cabapilities_cb(uint32_t capabilities, void* context)
> +{
> +    printf("gps_set_cabapilities_cb() -");
> +
> +    if (capabilities & U_HARDWARE_GPS_CAPABILITY_SCHEDULING)
> +        printf(" scheduling");
> +    if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSB)
> +        printf(" MSB");
> +    if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSA)
> +        printf(" MSA");
> +    if (capabilities & U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT)
> +        printf(" 'single shot'");
> +    if (capabilities & U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME)
> +        printf(" 'on demand time'");
> +
> +    printf("\n");
> +}
> +
> +void gps_request_utc_time_cb(void* context)
> +{
> +    printf("gps_request_utc_time_cb() called.\n");
> +    ((GPSTest*)context)->inject_time();
> +}
> +
> +void gps_xtra_download_request_cb(void* context)
> +{
> +    printf("gps_xtra_download_request_cb() called.\n");
> +}
> +
> +void agps_status_cb(UHardwareGpsAGpsStatus* status, void* context)
> +{
> +    printf("agps status -");
> +
> +    if (status->type == U_HARDWARE_GPS_AGPS_TYPE_SUPL)
> +        printf(" SUPL");
> +    else
> +        printf(" C2K");
> +
> +    switch (status->status)
> +    {
> +    case U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN:
> +        printf(", request AGPS data connection");
> +        break;
> +    case U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN:
> +        printf(", release AGPS data connection");
> +        break;
> +    case U_HARDWARE_GPS_AGPS_DATA_CONNECTED:
> +        printf(", request AGPS data connected");
> +        break;
> +    case U_HARDWARE_GPS_AGPS_DATA_CONN_DONE:
> +        printf(", AGPS data connection done");
> +        break;
> +    default:
> +    case U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED:
> +        printf(", AGPS data connection failed");
> +        break;
> +    }
> +
> +    printf(" ipaddr=%u\n", status->ipaddr);
> +}
> +
> +void gps_notify_cb(UHardwareGpsNiNotification *notification, void* context)
> +{
> +    printf("gps_notify_cb() called.\n");
> +}
> +
> +void agps_ril_request_set_id_cb(uint32_t flags, void* context)
> +{
> +    printf("agps_ril_request_set_id_cb() called.\n");
> +}
> +
> +void agps_ril_request_refloc_cb(uint32_t flags, void* context)
> +{
> +    printf("agps_ril_request_refloc_cb() called.\n");
> +}
> +
> +GPSTest::GPSTest()
> +    : u_hardware_gps(NULL)
> +{
> +}
> +
> +GPSTest::~GPSTest()
> +{
> +    if (u_hardware_gps)
> +        u_hardware_gps_delete(u_hardware_gps);
> +}
> +
> +void GPSTest::inject_time()
> +{
> +    // A real implementation would inject time from some NTP server.
> +    time_t t = time(0);
> +    int64_t time_millis = (int64_t)t * (int64_t)1000;
> +    u_hardware_gps_inject_time(u_hardware_gps,
> +                           time_millis /*NTP time would go here*/,
> +                           time_millis /*internal time when that NTP time was taken*/,
> +                           10 /* possible deviation, in milliseconds*/);
> +}
> +
> +void GPSTest::inject_reference_location(float lat, float lon, float accuracy)
> +{
> +    UHardwareGpsLocation location;
> +    location.latitude = lat;
> +    location.longitude = lon;
> +    location.accuracy = accuracy;
> +    u_hardware_gps_inject_location(u_hardware_gps, location);
> +}
> +
> +bool GPSTest::init_and_start(const char* supl_server, uint16_t port)
> +{
> +    UHardwareGpsParams gps_params;
> +    
> +    gps_params.location_cb = gps_location_cb;
> +    gps_params.status_cb = gps_status_cb;
> +    gps_params.sv_status_cb = gps_sb_status_cb;
> +    gps_params.nmea_cb = gps_nmea_cb;
> +    gps_params.set_capabilities_cb = gps_set_cabapilities_cb;
> +    gps_params.request_utc_time_cb = gps_request_utc_time_cb;
> +    gps_params.xtra_download_request_cb = gps_xtra_download_request_cb;
> +    gps_params.agps_status_cb = agps_status_cb;
> +    gps_params.gps_ni_notify_cb = gps_notify_cb;
> +    gps_params.request_setid_cb = agps_ril_request_set_id_cb;
> +    gps_params.request_refloc_cb = agps_ril_request_refloc_cb;
> +    gps_params.context = this;
> +
> +    UHardwareGps u_hardware_gps = u_hardware_gps_new(&gps_params);
> +    if (!u_hardware_gps)
> +    {
> +        printf("GPS creation failed!\n");
> +        return false;
> +    }
> +
> +    bool ok = u_hardware_gps_start(u_hardware_gps);
> +    if (!ok)
> +    {
> +        printf("GPS start up failed!\n");
> +        return false;
> +    }
> +
> +    u_hardware_gps_delete_aiding_data(u_hardware_gps,
> +                                      U_HARDWARE_GPS_DELETE_ALL);
> +
> +    u_hardware_gps_agps_set_server_for_type(
> +        u_hardware_gps,
> +        U_HARDWARE_GPS_AGPS_TYPE_SUPL,
> +        supl_server,
> +        port);
> +    
> +    return true;
> +}
> +
> +bool GPSTest::stop()
> +{
> +    bool ok = u_hardware_gps_stop(u_hardware_gps);
> +    if (!ok)
> +        printf("failed when stopping GPS!\n");
> +
> +    return ok;
> +}
> +}
> +
> +void wait_for_sigint()
> +{
> +    sigset_t signals;
> +    sigemptyset(&signals);
> +    sigaddset(&signals, SIGINT);
> +
> +    int sig;
> +    int result = sigwait(&signals, &sig);
> +    if (result != 0)
> +        printf("sigwait failed!\n");
> +}
> +
> +int main(int argc, char** argv)
> +{
> +    if (argc != 6)
> +    {
> +        printf("Usage: test_gps supl_server supl_server_port lat lon accuracy\n");
> +        return 1;
> +    }
> +
> +    const char* supl_server = argv[1];
> +    uint16_t port = atoi(argv[2]);
> +    
> +    double lat = atof(argv[3]);
> +    double lon = atof(argv[4]);
> +    float accuracy = atof(argv[5]);
> +
> +    int return_value = 0;
> +    ubuntu::GPSTest test;
> +
> +    if (!test.init_and_start(supl_server, port))
> +        return 1;    
> +
> +    printf("GPS initialized and started. Injecting reference location: %f %f %f.\n", lat, lon, accuracy);
> +    test.inject_reference_location(lat, lon, accuracy);
> +    printf("Now waiting for callbacks or SIGINT (to quit).\n");
> +    wait_for_sigint();
> +    printf("Exiting...\n");
> +
> +    if (!test.stop())
> +        return 1;
> +
> +    printf("GPS stopped.\n");
> +    return 0;
> +}
> 
> === added file 'src/ubuntu/hardware/ubuntu_platform_hardware_api.cpp'
> --- src/ubuntu/hardware/ubuntu_platform_hardware_api.cpp	1970-01-01 00:00:00 +0000
> +++ src/ubuntu/hardware/ubuntu_platform_hardware_api.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,103 @@
> +/*
> + * Copyright (C) 2012 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Thomas Voss <thomas.voss at canonical.com>
> + *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
> + */
> +
> +// C APIs
> +#include <ubuntu/hardware/alarm.h>
> +#include <ubuntu/hardware/gps.h>
> +
> +#include "android_hw_module.h"
> +
> +// Hardware - GPS
> +IMPLEMENT_FUNCTION1(
> +UHardwareGps, 
> +u_hardware_gps_new, 
> +UHardwareGpsParams*);
> +
> +IMPLEMENT_VOID_FUNCTION1(
> +u_hardware_gps_delete, 
> +UHardwareGps);
> +
> +IMPLEMENT_FUNCTION1(
> +bool, 
> +u_hardware_gps_start, 
> +UHardwareGps);
> +
> +IMPLEMENT_FUNCTION1(
> +bool, 
> +u_hardware_gps_stop, 
> +UHardwareGps);
> +
> +IMPLEMENT_VOID_FUNCTION4(
> +u_hardware_gps_inject_time, 
> +UHardwareGps, 
> +int64_t, 
> +int64_t, 
> +int);
> +
> +IMPLEMENT_VOID_FUNCTION2(
> +u_hardware_gps_inject_location, 
> +UHardwareGps, 
> +UHardwareGpsLocation);
> +
> +IMPLEMENT_VOID_FUNCTION2(
> +u_hardware_gps_delete_aiding_data, 
> +UHardwareGps, 
> +UHardwareGpsAidingData);
> +
> +IMPLEMENT_VOID_FUNCTION3(
> +u_hardware_gps_agps_set_reference_location,
> +UHardwareGps,
> +UHardwareGpsAGpsRefLocation*,
> +size_t);
> +
> +IMPLEMENT_VOID_FUNCTION2(
> +u_hardware_gps_agps_notify_connection_is_open,
> +UHardwareGps,
> +const char *);
> +
> +IMPLEMENT_VOID_FUNCTION1(
> +u_hardware_gps_agps_notify_connection_is_closed,
> +UHardwareGps);
> +
> +IMPLEMENT_VOID_FUNCTION1(
> +u_hardware_gps_agps_notify_connection_not_available,
> +UHardwareGps);
> +
> +IMPLEMENT_VOID_FUNCTION4(
> +u_hardware_gps_agps_set_server_for_type,
> +UHardwareGps,
> +UHardwareGpsAGpsType,
> +const char*,
> +uint16_t);
> +
> +IMPLEMENT_FUNCTION6(
> +bool, 
> +u_hardware_gps_set_position_mode, 
> +UHardwareGps, 
> +uint32_t, 
> +uint32_t,
> +uint32_t, 
> +uint32_t, 
> +uint32_t);
> +
> +IMPLEMENT_VOID_FUNCTION3(
> +u_hardware_gps_inject_xtra_data, 
> +UHardwareGps, 
> +char*, 
> +int);
> 
> === removed directory 'src/ubuntu/hybris/tests'
> === removed file 'src/ubuntu/hybris/tests/CMakeLists.txt'
> --- src/ubuntu/hybris/tests/CMakeLists.txt	2014-04-03 16:06:54 +0000
> +++ src/ubuntu/hybris/tests/CMakeLists.txt	1970-01-01 00:00:00 +0000
> @@ -1,33 +0,0 @@
> -set(SOURCES ubuntu_application_api_hybris.cpp)
> -
> -add_executable(test_android_ubuntu_app_api test_c_api.cpp)
> -target_link_libraries(test_android_ubuntu_app_api ubuntu_application_api EGL GLESv2)
> -
> -add_executable(test_android_gps_api test_gps_api.cpp)
> -target_link_libraries(test_android_gps_api ubuntu_platform_hardware_api)
> -
> -add_executable(test_android_ubuntu_app_api_multiple_surfaces test_multiple_surfaces_event_delivery.cpp)
> -target_link_libraries(test_android_ubuntu_app_api_multiple_surfaces ubuntu_application_api EGL GLESv2)
> -
> -add_executable(test_android_sensors_api test_sensors_api.cpp)
> -target_link_libraries(test_android_sensors_api ubuntu_application_api)
> -
> -add_executable(test_android_ubuntu_session_api test_session_c_api.cpp)
> -target_link_libraries(test_android_ubuntu_session_api ubuntu_application_api)
> -
> -add_executable(test_ubuntu_app_api_location_service test_location_api.cpp)
> -target_link_libraries(test_ubuntu_app_api_location_service ubuntu_application_api)
> -
> -add_executable(test_hardware_alarms_api test_alarms_api.cpp)
> -target_link_libraries(test_hardware_alarms_api ubuntu_platform_hardware_api)
> -
> -install(TARGETS
> -	test_android_ubuntu_app_api
> -	test_android_gps_api
> -	test_android_ubuntu_app_api_multiple_surfaces
> -	test_android_sensors_api
> -	test_android_ubuntu_session_api
> -	test_ubuntu_app_api_location_service
> -	test_hardware_alarms_api
> -	DESTINATION bin
> -)
> 
> === removed file 'src/ubuntu/hybris/tests/test_alarms_api.cpp'
> --- src/ubuntu/hybris/tests/test_alarms_api.cpp	2014-05-16 08:49:10 +0000
> +++ src/ubuntu/hybris/tests/test_alarms_api.cpp	1970-01-01 00:00:00 +0000
> @@ -1,74 +0,0 @@
> -/*
> - * Copyright © 2013 Canonical Ltd.
> - *
> - * This program is free software: you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 3 as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> - *
> - * Authored by: Thomas Voß <thomas.voss at canonicalcom>
> - */
> -
> -#include <ubuntu/hardware/alarm.h>
> -
> -#include <cstdio>
> -#include <cstdlib>
> -#include <ctime>
> -
> -int main(int argc, char** argv)
> -{
> -    UHardwareAlarm alarm = u_hardware_alarm_create();
> -
> -    if (!alarm)
> -    {
> -        printf("Error creating handle to hardware alarms.\n");
> -        return 1;
> -    }
> -
> -    // Alarm in two seconds.
> -    timespec ts { 0, 0 };
> -    clock_gettime(CLOCK_REALTIME, &ts);
> -
> -    int timeout_in_seconds = 5;
> -
> -    // Let's see if a timeout has been specified on the command line
> -    if (argc > 1)
> -    {
> -        timeout_in_seconds = atoi(argv[1]);
> -    }
> -
> -    // Alarm in two seconds.
> -    ts.tv_sec += timeout_in_seconds;
> -
> -    UStatus rc = u_hardware_alarm_set_relative_to_with_behavior(
> -        alarm,
> -        U_HARDWARE_ALARM_TIME_REFERENCE_RTC,
> -        U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE,
> -        &ts);
> -
> -    if (rc != U_STATUS_SUCCESS)
> -    {
> -        printf("Problem setting hardware alarm.\n");
> -        return 1;
> -    }
> -
> -    UHardwareAlarmWaitResult wait_result;
> -    rc = u_hardware_alarm_wait_for_next_alarm(alarm, &wait_result);
> -
> -    if (rc != U_STATUS_SUCCESS)
> -    {
> -        printf("Problem waiting for hardware alarm to go off.\n");
> -        return 1;
> -    }
> -
> -    printf("Successfully created and waited for a hw alarm.\n");
> -
> -    return 0;
> -}
> 
> === removed file 'src/ubuntu/hybris/tests/test_gps_api.cpp'
> --- src/ubuntu/hybris/tests/test_gps_api.cpp	2014-05-13 10:00:55 +0000
> +++ src/ubuntu/hybris/tests/test_gps_api.cpp	1970-01-01 00:00:00 +0000
> @@ -1,286 +0,0 @@
> -/*
> - * Copyright © 2013 Canonical Ltd.
> - *
> - * This program is free software: you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 3 as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> - *
> - * Authored by: Daniel d'Andrada <daniel.dandrada at canonical.com>
> - */
> -#include <ubuntu/hardware/gps.h>
> -
> -#include <ctime>
> -#include <signal.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <unistd.h>
> -
> -namespace ubuntu
> -{
> -class GPSTest
> -{
> -  public:
> -    GPSTest();
> -    ~GPSTest();
> -    bool init_and_start(const char* server, uint16_t port);
> -    bool stop();
> -    void inject_time();
> -    void inject_reference_location(float lat, float lon, float accuracy);
> -    UHardwareGps u_hardware_gps;
> -};
> -
> -void gps_location_cb(UHardwareGpsLocation* location, void* context)
> -{
> -    printf("gps_location_cb() called.\n");
> -}
> -
> -void gps_status_cb(uint16_t status, void* context)
> -{
> -    switch(status)
> -    {
> -    case U_HARDWARE_GPS_STATUS_NONE:
> -        printf("status: None\n");
> -        break;
> -    case U_HARDWARE_GPS_STATUS_SESSION_BEGIN:
> -        printf("status: Session Begin\n");
> -        break;
> -    case U_HARDWARE_GPS_STATUS_SESSION_END:
> -        printf("status: Session End\n");
> -        break;
> -    case U_HARDWARE_GPS_STATUS_ENGINE_ON:
> -        printf("status: Engine On\n");
> -        break;
> -    case U_HARDWARE_GPS_STATUS_ENGINE_OFF:
> -        printf("status: Engine Off\n");
> -    default:
> -        break;
> -    };
> -}
> -
> -void gps_sb_status_cb(UHardwareGpsSvStatus* sv_info, void* context)
> -{
> -    printf("gps_sb_status_cb() called, listing %d space vehicles\n", sv_info->num_svs);
> -}
> -
> -void gps_nmea_cb(int64_t timestamp, const char* nmea, int length, void* context)
> -{
> -    char str[length+1];
> -    memcpy(str, nmea, length);
> -    str[length] = 0;
> -    printf("gps_nmea_cb() - %s\n", str);
> -}
> -
> -void gps_set_cabapilities_cb(uint32_t capabilities, void* context)
> -{
> -    printf("gps_set_cabapilities_cb() -");
> -
> -    if (capabilities & U_HARDWARE_GPS_CAPABILITY_SCHEDULING)
> -        printf(" scheduling");
> -    if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSB)
> -        printf(" MSB");
> -    if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSA)
> -        printf(" MSA");
> -    if (capabilities & U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT)
> -        printf(" 'single shot'");
> -    if (capabilities & U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME)
> -        printf(" 'on demand time'");
> -
> -    printf("\n");
> -}
> -
> -void gps_request_utc_time_cb(void* context)
> -{
> -    printf("gps_request_utc_time_cb() called.\n");
> -    ((GPSTest*)context)->inject_time();
> -}
> -
> -void gps_xtra_download_request_cb(void* context)
> -{
> -    printf("gps_xtra_download_request_cb() called.\n");
> -}
> -
> -void agps_status_cb(UHardwareGpsAGpsStatus* status, void* context)
> -{
> -    printf("agps status -");
> -
> -    if (status->type == U_HARDWARE_GPS_AGPS_TYPE_SUPL)
> -        printf(" SUPL");
> -    else
> -        printf(" C2K");
> -
> -    switch (status->status)
> -    {
> -    case U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN:
> -        printf(", request AGPS data connection");
> -        break;
> -    case U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN:
> -        printf(", release AGPS data connection");
> -        break;
> -    case U_HARDWARE_GPS_AGPS_DATA_CONNECTED:
> -        printf(", request AGPS data connected");
> -        break;
> -    case U_HARDWARE_GPS_AGPS_DATA_CONN_DONE:
> -        printf(", AGPS data connection done");
> -        break;
> -    default:
> -    case U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED:
> -        printf(", AGPS data connection failed");
> -        break;
> -    }
> -
> -    printf(" ipaddr=%u\n", status->ipaddr);
> -}
> -
> -void gps_notify_cb(UHardwareGpsNiNotification *notification, void* context)
> -{
> -    printf("gps_notify_cb() called.\n");
> -}
> -
> -void agps_ril_request_set_id_cb(uint32_t flags, void* context)
> -{
> -    printf("agps_ril_request_set_id_cb() called.\n");
> -}
> -
> -void agps_ril_request_refloc_cb(uint32_t flags, void* context)
> -{
> -    printf("agps_ril_request_refloc_cb() called.\n");
> -}
> -
> -GPSTest::GPSTest()
> -    : u_hardware_gps(NULL)
> -{
> -}
> -
> -GPSTest::~GPSTest()
> -{
> -    if (u_hardware_gps)
> -        u_hardware_gps_delete(u_hardware_gps);
> -}
> -
> -void GPSTest::inject_time()
> -{
> -    // A real implementation would inject time from some NTP server.
> -    time_t t = time(0);
> -    int64_t time_millis = (int64_t)t * (int64_t)1000;
> -    u_hardware_gps_inject_time(u_hardware_gps,
> -                           time_millis /*NTP time would go here*/,
> -                           time_millis /*internal time when that NTP time was taken*/,
> -                           10 /* possible deviation, in milliseconds*/);
> -}
> -
> -void GPSTest::inject_reference_location(float lat, float lon, float accuracy)
> -{
> -    UHardwareGpsLocation location;
> -    location.latitude = lat;
> -    location.longitude = lon;
> -    location.accuracy = accuracy;
> -    u_hardware_gps_inject_location(u_hardware_gps, location);
> -}
> -
> -bool GPSTest::init_and_start(const char* supl_server, uint16_t port)
> -{
> -    UHardwareGpsParams gps_params;
> -    
> -    gps_params.location_cb = gps_location_cb;
> -    gps_params.status_cb = gps_status_cb;
> -    gps_params.sv_status_cb = gps_sb_status_cb;
> -    gps_params.nmea_cb = gps_nmea_cb;
> -    gps_params.set_capabilities_cb = gps_set_cabapilities_cb;
> -    gps_params.request_utc_time_cb = gps_request_utc_time_cb;
> -    gps_params.xtra_download_request_cb = gps_xtra_download_request_cb;
> -    gps_params.agps_status_cb = agps_status_cb;
> -    gps_params.gps_ni_notify_cb = gps_notify_cb;
> -    gps_params.request_setid_cb = agps_ril_request_set_id_cb;
> -    gps_params.request_refloc_cb = agps_ril_request_refloc_cb;
> -    gps_params.context = this;
> -
> -    UHardwareGps u_hardware_gps = u_hardware_gps_new(&gps_params);
> -    if (!u_hardware_gps)
> -    {
> -        printf("GPS creation failed!\n");
> -        return false;
> -    }
> -
> -    bool ok = u_hardware_gps_start(u_hardware_gps);
> -    if (!ok)
> -    {
> -        printf("GPS start up failed!\n");
> -        return false;
> -    }
> -
> -    u_hardware_gps_delete_aiding_data(u_hardware_gps,
> -                                      U_HARDWARE_GPS_DELETE_ALL);
> -
> -    u_hardware_gps_agps_set_server_for_type(
> -        u_hardware_gps,
> -        U_HARDWARE_GPS_AGPS_TYPE_SUPL,
> -        supl_server,
> -        port);
> -    
> -    return true;
> -}
> -
> -bool GPSTest::stop()
> -{
> -    bool ok = u_hardware_gps_stop(u_hardware_gps);
> -    if (!ok)
> -        printf("failed when stopping GPS!\n");
> -
> -    return ok;
> -}
> -}
> -
> -void wait_for_sigint()
> -{
> -    sigset_t signals;
> -    sigemptyset(&signals);
> -    sigaddset(&signals, SIGINT);
> -
> -    int sig;
> -    int result = sigwait(&signals, &sig);
> -    if (result != 0)
> -        printf("sigwait failed!\n");
> -}
> -
> -int main(int argc, char** argv)
> -{
> -    if (argc != 6)
> -    {
> -        printf("Usage: test_gps supl_server supl_server_port lat lon accuracy\n");
> -        return 1;
> -    }
> -
> -    const char* supl_server = argv[1];
> -    uint16_t port = atoi(argv[2]);
> -    
> -    double lat = atof(argv[3]);
> -    double lon = atof(argv[4]);
> -    float accuracy = atof(argv[5]);
> -
> -    int return_value = 0;
> -    ubuntu::GPSTest test;
> -
> -    if (!test.init_and_start(supl_server, port))
> -        return 1;    
> -
> -    printf("GPS initialized and started. Injecting reference location: %f %f %f.\n", lat, lon, accuracy);
> -    test.inject_reference_location(lat, lon, accuracy);
> -    printf("Now waiting for callbacks or SIGINT (to quit).\n");
> -    wait_for_sigint();
> -    printf("Exiting...\n");
> -
> -    if (!test.stop())
> -        return 1;
> -
> -    printf("GPS stopped.\n");
> -    return 0;
> -}
> 
> === removed file 'src/ubuntu/hybris/ubuntu_platform_hardware_api.cpp'
> --- src/ubuntu/hybris/ubuntu_platform_hardware_api.cpp	2014-05-22 15:29:37 +0000
> +++ src/ubuntu/hybris/ubuntu_platform_hardware_api.cpp	1970-01-01 00:00:00 +0000
> @@ -1,103 +0,0 @@
> -/*
> - * Copyright (C) 2012 Canonical Ltd
> - *
> - * This program is free software: you can redistribute it and/or modify
> - * it under the terms of the GNU Lesser General Public License version 3 as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU Lesser General Public License for more details.
> - *
> - * You should have received a copy of the GNU Lesser General Public License
> - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> - *
> - * Authored by: Thomas Voss <thomas.voss at canonical.com>
> - *              Ricardo Mendoza <ricardo.mendoza at canonical.com>
> - */
> -
> -// C APIs
> -#include <ubuntu/hardware/alarm.h>
> -#include <ubuntu/hardware/gps.h>
> -
> -#include "bridge.h"
> -
> -// Hardware - GPS
> -IMPLEMENT_FUNCTION1(
> -UHardwareGps, 
> -u_hardware_gps_new, 
> -UHardwareGpsParams*);
> -
> -IMPLEMENT_VOID_FUNCTION1(
> -u_hardware_gps_delete, 
> -UHardwareGps);
> -
> -IMPLEMENT_FUNCTION1(
> -bool, 
> -u_hardware_gps_start, 
> -UHardwareGps);
> -
> -IMPLEMENT_FUNCTION1(
> -bool, 
> -u_hardware_gps_stop, 
> -UHardwareGps);
> -
> -IMPLEMENT_VOID_FUNCTION4(
> -u_hardware_gps_inject_time, 
> -UHardwareGps, 
> -int64_t, 
> -int64_t, 
> -int);
> -
> -IMPLEMENT_VOID_FUNCTION2(
> -u_hardware_gps_inject_location, 
> -UHardwareGps, 
> -UHardwareGpsLocation);
> -
> -IMPLEMENT_VOID_FUNCTION2(
> -u_hardware_gps_delete_aiding_data, 
> -UHardwareGps, 
> -UHardwareGpsAidingData);
> -
> -IMPLEMENT_VOID_FUNCTION3(
> -u_hardware_gps_agps_set_reference_location,
> -UHardwareGps,
> -UHardwareGpsAGpsRefLocation*,
> -size_t);
> -
> -IMPLEMENT_VOID_FUNCTION2(
> -u_hardware_gps_agps_notify_connection_is_open,
> -UHardwareGps,
> -const char *);
> -
> -IMPLEMENT_VOID_FUNCTION1(
> -u_hardware_gps_agps_notify_connection_is_closed,
> -UHardwareGps);
> -
> -IMPLEMENT_VOID_FUNCTION1(
> -u_hardware_gps_agps_notify_connection_not_available,
> -UHardwareGps);
> -
> -IMPLEMENT_VOID_FUNCTION4(
> -u_hardware_gps_agps_set_server_for_type,
> -UHardwareGps,
> -UHardwareGpsAGpsType,
> -const char*,
> -uint16_t);
> -
> -IMPLEMENT_FUNCTION6(
> -bool, 
> -u_hardware_gps_set_position_mode, 
> -UHardwareGps, 
> -uint32_t, 
> -uint32_t,
> -uint32_t, 
> -uint32_t, 
> -uint32_t);
> -
> -IMPLEMENT_VOID_FUNCTION3(
> -u_hardware_gps_inject_xtra_data, 
> -UHardwareGps, 
> -char*, 
> -int);
> 
> === modified file 'tests/CMakeLists.txt'
> --- tests/CMakeLists.txt	2013-12-06 13:47:56 +0000
> +++ tests/CMakeLists.txt	2014-05-28 14:34:51 +0000
> @@ -7,24 +7,43 @@
>  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
>  
>  add_executable(
> -    test_ubuntu_application_sensors
> -    test_ubuntu_application_sensors.cpp
> -)
> -
> -target_link_libraries(
> -    test_ubuntu_application_sensors
> -
> -    ubuntu_application_api
> -    gtest
> -    gtest_main
> -    ${PROCESS_CPP_LIBRARIES}
> -)
> -
> -# we need to call the tests with pointing to the locally built test platform
> -# library
> +    test_ua_sensors_real
> +    test_ua_sensors_real.cpp
> +)
> +
> +add_executable(
> +    test_ua_sensors_mock
> +    test_ua_sensors_mock.cpp
> +)
> +
> +target_link_libraries(
> +    test_ua_sensors_mock
> +
> +    ubuntu_application_api
> +    gtest
> +    gtest_main
> +    ${PROCESS_CPP_LIBRARIES}
> +)
> +
> +target_link_libraries(
> +    test_ua_sensors_real
> +
> +    ubuntu_application_api
> +    gtest
> +    gtest_main
> +    ${PROCESS_CPP_LIBRARIES}
> +)
> +
>  add_test(
> -    test_ubuntu_application_sensors
> +    test_ua_sensors_mock
>      
> -    env LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/ubuntu/testbackend ${CMAKE_CURRENT_BINARY_DIR}/test_ubuntu_application_sensors
> +    env LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/ubuntu:${CMAKE_BINARY_DIR}/src/ubuntu/application/testbackend ${CMAKE_CURRENT_BINARY_DIR}/test_ua_sensors_mock
>  )
>  
> +if(DEFINED ENV{UBUNTU_PLATFORM_API_BACKEND})
> +    add_test(
> +        test_ua_sensors_real
> +
> +        env LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/ubuntu:${CMAKE_BINARY_DIR}/src/ubuntu/application/touch:${CMAKE_BINARY_DIR}/src/ubuntu/desktop ${CMAKE_CURRENT_BINARY_DIR}/test_ua_sensors_real
> +    )
> +endif()
> 
> === added file 'tests/test_ua_sensors_mock.cpp'
> --- tests/test_ua_sensors_mock.cpp	1970-01-01 00:00:00 +0000
> +++ tests/test_ua_sensors_mock.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,268 @@
> +/*
> + * Copyright (C) 2013 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Martin Pitt <martin.pitti at ubuntu.com>
> + */
> +
> +#include <cstdlib>
> +#include <cstdio>
> +#include <queue>
> +#include <chrono>
> +#include <iostream>
> +
> +#include <core/testing/fork_and_run.h>
> +
> +#include "gtest/gtest.h"
> +
> +#include <ubuntu/application/sensors/accelerometer.h>
> +#include <ubuntu/application/sensors/event/accelerometer.h>
> +#include <ubuntu/application/sensors/proximity.h>
> +#include <ubuntu/application/sensors/event/proximity.h>
> +#include <ubuntu/application/sensors/light.h>
> +#include <ubuntu/application/sensors/event/light.h>
> +
> +using namespace std;
> +
> +typedef chrono::time_point<chrono::system_clock,chrono::nanoseconds> time_point_system_ns;
> +
> +
> +/*******************************************
> + *
> + * Tests with simulated sensor backend
> + *
> + *******************************************/
> +
> +struct event {
> +    uint64_t timestamp;
> +    float x, y, z;
> +    UASProximityDistance distance;
> +    void* context;
> +};
> +queue<struct event> events;
> +
> +
> +class SimBackendTest : public testing::Test
> +{
> +  protected:
> +    virtual void SetUp()
> +    {
> +        snprintf(data_file, sizeof(data_file), "%s", "/tmp/sensor_test.XXXXXX");
> +        data_fd = mkstemp(data_file);
> +        if (data_fd < 0) {
> +            perror("mkstemp");
> +            abort();
> +        }
> +        setenv("UBUNTU_PLATFORM_API_SENSOR_TEST", data_file, 1);
> +        setenv("UBUNTU_PLATFORM_API_BACKEND", "test", 1);
> +
> +        // ensure the queue is clear
> +        while (events.size() > 0)
> +            events.pop();
> +    }
> +
> +    virtual void TearDown()
> +    {
> +        unlink(data_file);
> +    }
> +
> +    void set_data(const char* data)
> +    {
> +        write(data_fd, data, strlen(data));
> +        fsync(data_fd);
> +    }
> +
> +    char data_file[100];
> +    int data_fd;
> +};
> +
> +// without any data, there are no sensors defined
> +TESTP_F(SimBackendTest, NoData, {
> +    EXPECT_EQ(NULL, ua_sensors_accelerometer_new());
> +    EXPECT_EQ(NULL, ua_sensors_proximity_new());
> +    EXPECT_EQ(NULL, ua_sensors_light_new());
> +})
> +
> +TESTP_F(SimBackendTest, CreateProximity, {
> +    set_data("create proximity");
> +    EXPECT_EQ(NULL, ua_sensors_accelerometer_new());
> +    EXPECT_EQ(NULL, ua_sensors_light_new());
> +
> +    UASensorsProximity *s = ua_sensors_proximity_new();
> +    EXPECT_TRUE(s != NULL);
> +})
> +
> +TESTP_F(SimBackendTest, CreateAccelerometer, {
> +    set_data("create accel 0.5 1000 0.1");
> +    EXPECT_EQ(NULL, ua_sensors_proximity_new());
> +    EXPECT_EQ(NULL, ua_sensors_light_new());
> +
> +    UASensorsAccelerometer *s = ua_sensors_accelerometer_new();
> +    EXPECT_TRUE(s != NULL);
> +
> +    float min = 0.f; ua_sensors_accelerometer_get_min_value(s, &min);
> +    float max = 0.f; ua_sensors_accelerometer_get_max_value(s, &max);
> +    float res = 0.f; ua_sensors_accelerometer_get_resolution(s, &res);
> +
> +    EXPECT_FLOAT_EQ(0.5, min);
> +    EXPECT_FLOAT_EQ(1000.0, max);
> +    EXPECT_FLOAT_EQ(0.1, res);
> +})
> +
> +TESTP_F(SimBackendTest, CreateLight, {
> +    set_data("create light 0 10 0.5");
> +    EXPECT_EQ(NULL, ua_sensors_proximity_new());
> +    EXPECT_EQ(NULL, ua_sensors_accelerometer_new());
> +
> +    UASensorsLight *s = ua_sensors_light_new();
> +    EXPECT_TRUE(s != NULL);
> +
> +    float min = 0.f; ua_sensors_light_get_min_value(s, &min);
> +    float max = 0.f; ua_sensors_light_get_max_value(s, &max);
> +    float res = 0.f; ua_sensors_light_get_resolution(s, &res);
> +
> +    EXPECT_FLOAT_EQ(0.0, min);
> +    EXPECT_FLOAT_EQ(10.0, max);
> +    EXPECT_FLOAT_EQ(0.5, res);
> +})
> +
> +TESTP_F(SimBackendTest, ProximityEvents, {
> +    set_data("create proximity\n"
> +             "  # some comment\n"
> +             "  \n"
> +             "50 proximity near\n"
> +             "100 proximity far\n"
> +             "80 proximity unknown\n"
> +    );
> +
> +    UASensorsProximity *s = ua_sensors_proximity_new();
> +    EXPECT_TRUE(s != NULL);
> +    ua_sensors_proximity_enable(s);
> +    auto start_time = chrono::system_clock::now();
> +
> +    ua_sensors_proximity_set_reading_cb(s,
> +        [](UASProximityEvent* ev, void* ctx) {
> +            events.push({uas_proximity_event_get_timestamp(ev),
> +                         .0, .0, .0,
> +                         uas_proximity_event_get_distance(ev),
> +                         ctx});
> +        }, NULL);
> +
> +    usleep(350000);
> +    EXPECT_EQ(3, events.size());
> +
> +    auto e = events.front();
> +    events.pop();
> +    EXPECT_EQ(e.distance, U_PROXIMITY_NEAR);
> +    EXPECT_EQ(NULL, e.context);
> +    auto event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> +    auto delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> +    EXPECT_GE(delay, 30);
> +    EXPECT_LE(delay, 70);
> +
> +    e = events.front();
> +    events.pop();
> +    EXPECT_EQ(e.distance, U_PROXIMITY_FAR);
> +    event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> +    delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> +    EXPECT_GE(delay, 130);
> +    EXPECT_LE(delay, 170);
> +
> +    e = events.front();
> +    events.pop();
> +    EXPECT_EQ(e.distance, (UASProximityDistance) 0);
> +    event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> +    delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> +    EXPECT_GE(delay, 210);
> +    EXPECT_LE(delay, 250);
> +})
> +
> +TESTP_F(SimBackendTest, LightEvents, {
> +    set_data(" create  light  0 10 1\n"
> +             "1 light 5\n"
> +             "100 light 8\n"
> +    );
> +
> +    UASensorsLight *s = ua_sensors_light_new();
> +    EXPECT_TRUE(s != NULL);
> +    ua_sensors_light_enable(s);
> +    auto start_time = chrono::system_clock::now();
> +
> +    ua_sensors_light_set_reading_cb(s,
> +        [](UASLightEvent* ev, void* ctx) {
> +            float light = -1.f;
> +             uas_light_event_get_light(ev, &light);
> +            events.push({uas_light_event_get_timestamp(ev),
> +                         light, .0, .0,
> +                         (UASProximityDistance) 0, ctx});
> +        }, NULL);
> +
> +    usleep(130000);
> +    EXPECT_EQ(2, events.size());
> +
> +    auto e = events.front();
> +    events.pop();
> +    EXPECT_FLOAT_EQ(e.x, 5);
> +    EXPECT_EQ(NULL, e.context);
> +    auto event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> +    auto delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> +    EXPECT_LE(delay, 10);
> +
> +    e = events.front();
> +    events.pop();
> +    EXPECT_FLOAT_EQ(e.x, 8);
> +    event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> +    delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> +    EXPECT_GE(delay, 91);
> +    EXPECT_LE(delay, 111);
> +})
> +
> +TESTP_F(SimBackendTest, AccelEvents, {
> +    // cover the case of > 1 s, to ensure that we correctly do mod arithmetic
> +    set_data("create accel -1000 1000 0.1\n"
> +             "1100 accel 5.5 -8.5 9.9\n"
> +    );
> +
> +    UASensorsAccelerometer *s = ua_sensors_accelerometer_new();
> +    EXPECT_TRUE(s != NULL);
> +    ua_sensors_accelerometer_enable(s);
> +    auto start_time = chrono::system_clock::now();
> +
> +    ua_sensors_accelerometer_set_reading_cb(s,
> +        [](UASAccelerometerEvent* ev, void* ctx) {
> +            float x; uas_accelerometer_event_get_acceleration_x(ev, &x);
> +            float y; uas_accelerometer_event_get_acceleration_y(ev, &y);
> +            float z; uas_accelerometer_event_get_acceleration_z(ev, &z);
> +
> +            events.push({uas_accelerometer_event_get_timestamp(ev),
> +                         x,
> +                         y,
> +                         z,
> +                         (UASProximityDistance) 0, ctx});
> +        }, NULL);
> +
> +    usleep(1200000);
> +    EXPECT_EQ(1, events.size());
> +
> +    auto e = events.front();
> +    events.pop();
> +    EXPECT_FLOAT_EQ(e.x, 5.5);
> +    EXPECT_FLOAT_EQ(e.y, -8.5);
> +    EXPECT_FLOAT_EQ(e.z, 9.9);
> +    EXPECT_EQ(NULL, e.context);
> +    auto event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> +    auto delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> +    EXPECT_GE(delay, 1050);
> +    EXPECT_LE(delay, 1150);
> +})
> 
> === added file 'tests/test_ua_sensors_real.cpp'
> --- tests/test_ua_sensors_real.cpp	1970-01-01 00:00:00 +0000
> +++ tests/test_ua_sensors_real.cpp	2014-05-28 14:34:51 +0000
> @@ -0,0 +1,114 @@
> +/*
> + * Copyright (C) 2013 Canonical Ltd
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 3 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Authored by: Martin Pitt <martin.pitti at ubuntu.com>
> + */
> +
> +#include <cstdlib>
> +#include <cstdio>
> +#include <queue>
> +#include <chrono>
> +#include <iostream>
> +
> +#include <core/testing/fork_and_run.h>
> +
> +#include "gtest/gtest.h"
> +
> +#include <ubuntu/application/sensors/accelerometer.h>
> +#include <ubuntu/application/sensors/event/accelerometer.h>
> +#include <ubuntu/application/sensors/proximity.h>
> +#include <ubuntu/application/sensors/event/proximity.h>
> +#include <ubuntu/application/sensors/light.h>
> +#include <ubuntu/application/sensors/event/light.h>
> +
> +using namespace std;
> +
> +typedef chrono::time_point<chrono::system_clock,chrono::nanoseconds> time_point_system_ns;
> +
> +/*******************************************
> + *
> + * Tests with default backend
> + *
> + *******************************************/
> +
> +class DefaultBackendTest : public testing::Test
> +{
> +    virtual void SetUp()
> +    {
> +    }
> +};
> +
> +TESTP_F(DefaultBackendTest, CreateProximity, {
> +    // this can succeed or fail depending on whether the hardware we run this
> +    // on actually exists; but it should never crash
> +    UASensorsProximity *s = ua_sensors_proximity_new();
> +    if (s != NULL) {
> +        cerr << "proximity sensor present on this hardware\n";
> +        // calling its functions should not crash; we can't assert much about
> +        // their actual values, though
> +        ua_sensors_proximity_enable(s);
> +        float min; ua_sensors_proximity_get_min_value(s, &min);
> +        float max; ua_sensors_proximity_get_max_value(s, &max);
> +
> +        EXPECT_LE(min, max);
> +
> +        float res; ua_sensors_proximity_get_resolution(s, &res);
> +        ua_sensors_proximity_disable(s);
> +    } else {
> +        cerr << "no proximity sensor on this hardware\n";
> +    }
> +})
> +
> +TESTP_F(DefaultBackendTest, CreateAccelerometer, {
> +    // this can succeed or fail depending on whether the hardware we run this
> +    // on actually exists; but it should never crash
> +    UASensorsAccelerometer *s = ua_sensors_accelerometer_new();
> +    if (s != NULL) {
> +        cerr << "accelerometer sensor present on this hardware\n";
> +        // calling its functions should not crash; we can't assert much about
> +        // their actual values, though
> +        ua_sensors_accelerometer_enable(s);
> +        float min; ua_sensors_accelerometer_get_min_value(s, &min);
> +        float max; ua_sensors_accelerometer_get_max_value(s, &max);
> +
> +        EXPECT_LE(min, max);
> +
> +        float res; ua_sensors_accelerometer_get_resolution(s, &res);
> +        ua_sensors_accelerometer_disable(s);
> +    } else {
> +        cerr << "no accelerometer sensor on this hardware\n";
> +    }
> +})
> +
> +TESTP_F(DefaultBackendTest, CreateLight, {
> +    // this can succeed or fail depending on whether the hardware we run this
> +    // on actually exists; but it should never crash
> +    UASensorsLight *s = ua_sensors_light_new();
> +    if (s != NULL) {
> +        cerr << "light sensor present on this hardware\n";
> +        // calling its functions should not crash; we can't assert much about
> +        // their actual values, though
> +        ua_sensors_light_enable(s);
> +        float min; ua_sensors_light_get_min_value(s, &min);
> +        float max; ua_sensors_light_get_max_value(s, &max);
> +
> +        EXPECT_LE(min, max);
> +
> +        float res; ua_sensors_light_get_resolution(s, &res);
> +        ua_sensors_light_disable(s);
> +    } else {
> +        cerr << "no light sensor on this hardware\n";
> +    }
> +})
> 
> === removed file 'tests/test_ubuntu_application_sensors.cpp'
> --- tests/test_ubuntu_application_sensors.cpp	2014-02-13 13:12:41 +0000
> +++ tests/test_ubuntu_application_sensors.cpp	1970-01-01 00:00:00 +0000
> @@ -1,345 +0,0 @@
> -/*
> - * Copyright (C) 2013 Canonical Ltd
> - *
> - * This program is free software: you can redistribute it and/or modify
> - * it under the terms of the GNU Lesser General Public License version 3 as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU Lesser General Public License for more details.
> - *
> - * You should have received a copy of the GNU Lesser General Public License
> - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> - *
> - * Authored by: Martin Pitt <martin.pitti at ubuntu.com>
> - */
> -
> -#include <cstdlib>
> -#include <cstdio>
> -#include <queue>
> -#include <chrono>
> -#include <iostream>
> -
> -#include <core/testing/fork_and_run.h>
> -
> -#include "gtest/gtest.h"
> -
> -#include <ubuntu/application/sensors/accelerometer.h>
> -#include <ubuntu/application/sensors/event/accelerometer.h>
> -#include <ubuntu/application/sensors/proximity.h>
> -#include <ubuntu/application/sensors/event/proximity.h>
> -#include <ubuntu/application/sensors/light.h>
> -#include <ubuntu/application/sensors/event/light.h>
> -
> -using namespace std;
> -
> -typedef chrono::time_point<chrono::system_clock,chrono::nanoseconds> time_point_system_ns;
> -
> -
> -/*******************************************
> - *
> - * Tests with simulated sensor backend
> - *
> - *******************************************/
> -
> -struct event {
> -    uint64_t timestamp;
> -    float x, y, z;
> -    UASProximityDistance distance;
> -    void* context;
> -};
> -queue<struct event> events;
> -
> -
> -class SimBackendTest : public testing::Test
> -{
> -  protected:
> -    virtual void SetUp()
> -    {
> -        snprintf(data_file, sizeof(data_file), "%s", "/tmp/sensor_test.XXXXXX");
> -        data_fd = mkstemp(data_file);
> -        if (data_fd < 0) {
> -            perror("mkstemp");
> -            abort();
> -        }
> -        setenv("UBUNTU_PLATFORM_API_SENSOR_TEST", data_file, 1);
> -        setenv("UBUNTU_PLATFORM_API_BACKEND", "libubuntu_application_api_test.so.1", 1);
> -
> -        // ensure the queue is clear
> -        while (events.size() > 0)
> -            events.pop();
> -    }
> -
> -    virtual void TearDown()
> -    {
> -        unlink(data_file);
> -    }
> -
> -    void set_data(const char* data)
> -    {
> -        write(data_fd, data, strlen(data));
> -        fsync(data_fd);
> -    }
> -
> -    char data_file[100];
> -    int data_fd;
> -};
> -
> -// without any data, there are no sensors defined
> -TESTP_F(SimBackendTest, NoData, {
> -    EXPECT_EQ(NULL, ua_sensors_accelerometer_new());
> -    EXPECT_EQ(NULL, ua_sensors_proximity_new());
> -    EXPECT_EQ(NULL, ua_sensors_light_new());
> -})
> -
> -TESTP_F(SimBackendTest, CreateProximity, {
> -    set_data("create proximity");
> -    EXPECT_EQ(NULL, ua_sensors_accelerometer_new());
> -    EXPECT_EQ(NULL, ua_sensors_light_new());
> -
> -    UASensorsProximity *s = ua_sensors_proximity_new();
> -    EXPECT_TRUE(s != NULL);
> -})
> -
> -TESTP_F(SimBackendTest, CreateAccelerometer, {
> -    set_data("create accel 0.5 1000 0.1");
> -    EXPECT_EQ(NULL, ua_sensors_proximity_new());
> -    EXPECT_EQ(NULL, ua_sensors_light_new());
> -
> -    UASensorsAccelerometer *s = ua_sensors_accelerometer_new();
> -    EXPECT_TRUE(s != NULL);
> -
> -    float min = 0.f; ua_sensors_accelerometer_get_min_value(s, &min);
> -    float max = 0.f; ua_sensors_accelerometer_get_max_value(s, &max);
> -    float res = 0.f; ua_sensors_accelerometer_get_resolution(s, &res);
> -
> -    EXPECT_FLOAT_EQ(0.5, min);
> -    EXPECT_FLOAT_EQ(1000.0, max);
> -    EXPECT_FLOAT_EQ(0.1, res);
> -})
> -
> -TESTP_F(SimBackendTest, CreateLight, {
> -    set_data("create light 0 10 0.5");
> -    EXPECT_EQ(NULL, ua_sensors_proximity_new());
> -    EXPECT_EQ(NULL, ua_sensors_accelerometer_new());
> -
> -    UASensorsLight *s = ua_sensors_light_new();
> -    EXPECT_TRUE(s != NULL);
> -
> -    float min = 0.f; ua_sensors_light_get_min_value(s, &min);
> -    float max = 0.f; ua_sensors_light_get_max_value(s, &max);
> -    float res = 0.f; ua_sensors_light_get_resolution(s, &res);
> -
> -    EXPECT_FLOAT_EQ(0.0, min);
> -    EXPECT_FLOAT_EQ(10.0, max);
> -    EXPECT_FLOAT_EQ(0.5, res);
> -})
> -
> -TESTP_F(SimBackendTest, ProximityEvents, {
> -    set_data("create proximity\n"
> -             "  # some comment\n"
> -             "  \n"
> -             "50 proximity near\n"
> -             "100 proximity far\n"
> -             "80 proximity unknown\n"
> -    );
> -
> -    UASensorsProximity *s = ua_sensors_proximity_new();
> -    EXPECT_TRUE(s != NULL);
> -    ua_sensors_proximity_enable(s);
> -    auto start_time = chrono::system_clock::now();
> -
> -    ua_sensors_proximity_set_reading_cb(s,
> -        [](UASProximityEvent* ev, void* ctx) {
> -            events.push({uas_proximity_event_get_timestamp(ev),
> -                         .0, .0, .0,
> -                         uas_proximity_event_get_distance(ev),
> -                         ctx});
> -        }, NULL);
> -
> -    usleep(350000);
> -    EXPECT_EQ(3, events.size());
> -
> -    auto e = events.front();
> -    events.pop();
> -    EXPECT_EQ(e.distance, U_PROXIMITY_NEAR);
> -    EXPECT_EQ(NULL, e.context);
> -    auto event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> -    auto delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> -    EXPECT_GE(delay, 30);
> -    EXPECT_LE(delay, 70);
> -
> -    e = events.front();
> -    events.pop();
> -    EXPECT_EQ(e.distance, U_PROXIMITY_FAR);
> -    event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> -    delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> -    EXPECT_GE(delay, 130);
> -    EXPECT_LE(delay, 170);
> -
> -    e = events.front();
> -    events.pop();
> -    EXPECT_EQ(e.distance, (UASProximityDistance) 0);
> -    event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> -    delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> -    EXPECT_GE(delay, 210);
> -    EXPECT_LE(delay, 250);
> -})
> -
> -TESTP_F(SimBackendTest, LightEvents, {
> -    set_data(" create  light  0 10 1\n"
> -             "1 light 5\n"
> -             "100 light 8\n"
> -    );
> -
> -    UASensorsLight *s = ua_sensors_light_new();
> -    EXPECT_TRUE(s != NULL);
> -    ua_sensors_light_enable(s);
> -    auto start_time = chrono::system_clock::now();
> -
> -    ua_sensors_light_set_reading_cb(s,
> -        [](UASLightEvent* ev, void* ctx) {
> -            float light = -1.f;
> -             uas_light_event_get_light(ev, &light);
> -            events.push({uas_light_event_get_timestamp(ev),
> -                         light, .0, .0,
> -                         (UASProximityDistance) 0, ctx});
> -        }, NULL);
> -
> -    usleep(130000);
> -    EXPECT_EQ(2, events.size());
> -
> -    auto e = events.front();
> -    events.pop();
> -    EXPECT_FLOAT_EQ(e.x, 5);
> -    EXPECT_EQ(NULL, e.context);
> -    auto event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> -    auto delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> -    EXPECT_LE(delay, 10);
> -
> -    e = events.front();
> -    events.pop();
> -    EXPECT_FLOAT_EQ(e.x, 8);
> -    event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> -    delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> -    EXPECT_GE(delay, 91);
> -    EXPECT_LE(delay, 111);
> -})
> -
> -TESTP_F(SimBackendTest, AccelEvents, {
> -    // cover the case of > 1 s, to ensure that we correctly do mod arithmetic
> -    set_data("create accel -1000 1000 0.1\n"
> -             "1100 accel 5.5 -8.5 9.9\n"
> -    );
> -
> -    UASensorsAccelerometer *s = ua_sensors_accelerometer_new();
> -    EXPECT_TRUE(s != NULL);
> -    ua_sensors_accelerometer_enable(s);
> -    auto start_time = chrono::system_clock::now();
> -
> -    ua_sensors_accelerometer_set_reading_cb(s,
> -        [](UASAccelerometerEvent* ev, void* ctx) {
> -            float x; uas_accelerometer_event_get_acceleration_x(ev, &x);
> -            float y; uas_accelerometer_event_get_acceleration_y(ev, &y);
> -            float z; uas_accelerometer_event_get_acceleration_z(ev, &z);
> -
> -            events.push({uas_accelerometer_event_get_timestamp(ev),
> -                         x,
> -                         y,
> -                         z,
> -                         (UASProximityDistance) 0, ctx});
> -        }, NULL);
> -
> -    usleep(1200000);
> -    EXPECT_EQ(1, events.size());
> -
> -    auto e = events.front();
> -    events.pop();
> -    EXPECT_FLOAT_EQ(e.x, 5.5);
> -    EXPECT_FLOAT_EQ(e.y, -8.5);
> -    EXPECT_FLOAT_EQ(e.z, 9.9);
> -    EXPECT_EQ(NULL, e.context);
> -    auto event_time = time_point_system_ns(std::chrono::nanoseconds(e.timestamp));
> -    auto delay = chrono::duration_cast<chrono::milliseconds>(event_time - start_time).count();
> -    EXPECT_GE(delay, 1050);
> -    EXPECT_LE(delay, 1150);
> -})
> -
> -/*******************************************
> - *
> - * Tests with default backend
> - *
> - *******************************************/
> -
> -class DefaultBackendTest : public testing::Test
> -{
> -    virtual void SetUp()
> -    {
> -        unsetenv("UBUNTU_PLATFORM_API_BACKEND");
> -    }
> -};
> -
> -TESTP_F(DefaultBackendTest, CreateProximity, {
> -    // this can succeed or fail depending on whether the hardware we run this
> -    // on actually exists; but it should never crash
> -    UASensorsProximity *s = ua_sensors_proximity_new();
> -    if (s != NULL) {
> -        cerr << "proximity sensor present on this hardware\n";
> -        // calling its functions should not crash; we can't assert much about
> -        // their actual values, though
> -        ua_sensors_proximity_enable(s);
> -        float min; ua_sensors_proximity_get_min_value(s, &min);
> -        float max; ua_sensors_proximity_get_max_value(s, &max);
> -
> -        EXPECT_LE(min, max);
> -
> -        float res; ua_sensors_proximity_get_resolution(s, &res);
> -        ua_sensors_proximity_disable(s);
> -    } else {
> -        cerr << "no proximity sensor on this hardware\n";
> -    }
> -})
> -
> -TESTP_F(DefaultBackendTest, CreateAccelerometer, {
> -    // this can succeed or fail depending on whether the hardware we run this
> -    // on actually exists; but it should never crash
> -    UASensorsAccelerometer *s = ua_sensors_accelerometer_new();
> -    if (s != NULL) {
> -        cerr << "accelerometer sensor present on this hardware\n";
> -        // calling its functions should not crash; we can't assert much about
> -        // their actual values, though
> -        ua_sensors_accelerometer_enable(s);
> -        float min; ua_sensors_accelerometer_get_min_value(s, &min);
> -        float max; ua_sensors_accelerometer_get_max_value(s, &max);
> -
> -        EXPECT_LE(min, max);
> -
> -        float res; ua_sensors_accelerometer_get_resolution(s, &res);
> -        ua_sensors_accelerometer_disable(s);
> -    } else {
> -        cerr << "no accelerometer sensor on this hardware\n";
> -    }
> -})
> -
> -TESTP_F(DefaultBackendTest, CreateLight, {
> -    // this can succeed or fail depending on whether the hardware we run this
> -    // on actually exists; but it should never crash
> -    UASensorsLight *s = ua_sensors_light_new();
> -    if (s != NULL) {
> -        cerr << "light sensor present on this hardware\n";
> -        // calling its functions should not crash; we can't assert much about
> -        // their actual values, though
> -        ua_sensors_light_enable(s);
> -        float min; ua_sensors_light_get_min_value(s, &min);
> -        float max; ua_sensors_light_get_max_value(s, &max);
> -
> -        EXPECT_LE(min, max);
> -
> -        float res; ua_sensors_light_get_resolution(s, &res);
> -        ua_sensors_light_disable(s);
> -    } else {
> -        cerr << "no light sensor on this hardware\n";
> -    }
> -})
> 


-- 
https://code.launchpad.net/~ricmm/platform-api/v2-dynamic-refactor/+merge/220721
Your team Ubuntu Phablet Team is subscribed to branch lp:platform-api.



More information about the Ubuntu-reviews mailing list