pax_global_header 0000666 0000000 0000000 00000000064 14024150334 0014506 g ustar 00root root 0000000 0000000 52 comment=d7a36de882b3f8818d485b0ec94f3fa5fe1152dd
hfd-service-0.1.0/ 0000775 0000000 0000000 00000000000 14024150334 0013703 5 ustar 00root root 0000000 0000000 hfd-service-0.1.0/.gitignore 0000664 0000000 0000000 00000000610 14024150334 0015670 0 ustar 00root root 0000000 0000000
# Created by https://www.gitignore.io/api/cmake
# Edit at https://www.gitignore.io/?templates=cmake
### CMake ###
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
### CMake Patch ###
# External projects
*-prefix/
# End of https://www.gitignore.io/api/cmake
build
build-*
hfd-service-0.1.0/CMakeLists.txt 0000664 0000000 0000000 00000002155 14024150334 0016446 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.0)
project(hfd-service)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(FindPkgConfig)
include(GNUInstallDirs)
pkg_check_modules(UDEV REQUIRED libudev)
option(ENABLE_LIBHYBRIS "Enable libhybris support" ON)
if (ENABLE_LIBHYBRIS)
pkg_check_modules(ANDROID_HEADERS android-headers)
pkg_check_modules(ANDROID_HARDWARE libhardware)
if(ANDROID_HEADERS_FOUND AND ANDROID_HARDWARE_FOUND)
message(STATUS "Bulding with libhybris support")
set(HAVE_LIBHYBRIS true)
else()
message(WARNING "Bulding without libhybris support, missing required dependencies!")
endif()
else()
message(STATUS "Bulding without libhybris support")
endif()
find_package(Qt5Core REQUIRED)
find_package(Qt5DBus REQUIRED)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
add_subdirectory(src)
add_subdirectory(tools)
add_subdirectory(qt)
# Dbus file
install(FILES data/hfd-service.conf
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/init
)
# Dbus policy
install(FILES data/com.lomiri.hfd.conf
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/system.d
)
hfd-service-0.1.0/Jenkinsfile 0000664 0000000 0000000 00000005717 14024150334 0016101 0 ustar 00root root 0000000 0000000 String stashFileList = '*.gz,*.bz2,*.xz,*.deb,*.ddeb,*.dsc,*.changes,*.buildinfo,lintian.txt'
String archiveFileList = '*.gz,*.bz2,*.xz,*.deb,*.ddeb,*.dsc,*.changes,*.buildinfo'
pipeline {
agent any
stages {
stage('Build source') {
steps {
sh '/usr/bin/build-source.sh'
stash(name: 'source', includes: stashFileList)
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
}
}
stage('Build binary - armhf') {
steps {
parallel(
"Build binary - armhf": {
node(label: 'arm64') {
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
unstash 'source'
sh '''export architecture="armhf"
build-binary.sh'''
stash(includes: stashFileList, name: 'build-armhf')
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
}
},
"Build binary - arm64": {
node(label: 'arm64') {
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
unstash 'source'
sh '''export architecture="arm64"
build-binary.sh'''
stash(includes: stashFileList, name: 'build-arm64')
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
}
},
"Build binary - amd64": {
node(label: 'amd64') {
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
unstash 'source'
sh '''export architecture="amd64"
build-binary.sh'''
stash(includes: stashFileList, name: 'build-amd64')
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
}
}
)
}
}
stage('Results') {
steps {
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
unstash 'build-armhf'
unstash 'build-arm64'
unstash 'build-amd64'
archiveArtifacts(artifacts: archiveFileList, fingerprint: true, onlyIfSuccessful: true)
sh '''/usr/bin/build-repo.sh'''
}
}
stage('Cleanup') {
steps {
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
}
}
}
}
hfd-service-0.1.0/Readme.md 0000664 0000000 0000000 00000001107 14024150334 0015421 0 ustar 00root root 0000000 0000000 # hfd-service
**H**uman **f**eedback **d**evice **service** is a dbus activated service that manages human feedback devices sutch as leds and vibrators on mobile devices.
This replaces usensord and unity8's own led/light handeler
## Why?
We have a need for a more modular system running service now that we have different devices handeling implementations differently.
Secondly we could not use unity8's own led handeler as this only runs in userspace and we wont have access to sysfs devices from there in a secure maner. We can use a dbus service protected with apparmor.
hfd-service-0.1.0/data/ 0000775 0000000 0000000 00000000000 14024150334 0014614 5 ustar 00root root 0000000 0000000 hfd-service-0.1.0/data/com.lomiri.hfd.conf 0000664 0000000 0000000 00000000737 14024150334 0020302 0 ustar 00root root 0000000 0000000
hfd-service-0.1.0/data/com.lomiri.hfd.xml 0000664 0000000 0000000 00000001601 14024150334 0020144 0 ustar 00root root 0000000 0000000
hfd-service-0.1.0/data/hfd-service.conf 0000664 0000000 0000000 00000000673 14024150334 0017670 0 ustar 00root root 0000000 0000000 description "hfd service for feedback support"
start on started dbus
stop on stopped dbus
pre-start script
# If we're running on Android-based device, we want to wait until the
# Android container is up.
if [ -e /system/build.prop ]; then
while ! initctl status lxc-android-config| \
grep -q ' start/running,\| start/post-start,'; do
sleep 0.1
done
fi
end script
exec hfd-service
hfd-service-0.1.0/debian/ 0000775 0000000 0000000 00000000000 14024150334 0015125 5 ustar 00root root 0000000 0000000 hfd-service-0.1.0/debian/changelog 0000664 0000000 0000000 00000000214 14024150334 0016774 0 ustar 00root root 0000000 0000000 hfd-service (0.1.0) xenial; urgency=medium
* initial release
-- Marius Gripsgard Sat, 21 Mar 2020 02:06:32 +0100
hfd-service-0.1.0/debian/compat 0000664 0000000 0000000 00000000002 14024150334 0016323 0 ustar 00root root 0000000 0000000 9
hfd-service-0.1.0/debian/control 0000664 0000000 0000000 00000002621 14024150334 0016531 0 ustar 00root root 0000000 0000000 Source: hfd-service
Section: admin
Priority: optional
Build-Depends: cmake (>= 2.8.10),
debhelper (>= 9),
pkg-config,
libandroid-properties-dev,
libhardware-dev,
android-headers,
libudev-dev,
qtbase5-dev,
qtfeedback5-dev,
cmake-extras,
qtdeclarative5-dev
Maintainer: Marius Gripsgard
Standards-Version: 3.9.5
Homepage: https://github.com/ubports/deviceinfo
Package: hfd-service
Section: libs
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
Description: Library to detect and configure devices
Library to detect and configure devices
Package: libqt5feedback5-hfd
Section: libs
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
hfd-service,
Description: Library to detect and configure devices
Library to detect and configure devices
Package: qml-module-hfd
Section: libs
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
hfd-service,
Description: Library to detect and configure devices
Library to detect and configure devices
Package: hfd-service-tools
Section: admin
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
hfd-service,
Description: Tools to detect and configure devices
Tools to detect and configure devices
hfd-service-0.1.0/debian/copyright 0000664 0000000 0000000 00000002056 14024150334 0017063 0 ustar 00root root 0000000 0000000 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: deviceinfo
Upstream-Contact: Marius Gripsgard
Source: https://github.com/ubports/deviceinfo
Files: *
Copyright: 2019 UBports foundation, Marius Gripsgard
License: GPL-3
License: GPL-3
This program is free software: you can redistribute it and/or modify it
under the terms of the 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 warranties of
MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
PURPOSE. See the applicable version of the GNU Lesser 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 .
.
On Debian systems, the complete text of the GNU General Public License
can be found in `/usr/share/common-licenses/GPL-3'
hfd-service-0.1.0/debian/hfd-service-tools.install 0000664 0000000 0000000 00000000034 14024150334 0022047 0 ustar 00root root 0000000 0000000 usr/bin/hfd-service-tools-*
hfd-service-0.1.0/debian/hfd-service.install 0000664 0000000 0000000 00000000126 14024150334 0020713 0 ustar 00root root 0000000 0000000 usr/bin/hfd-service
etc/init/hfd-service.conf
etc/dbus-1/system.d/com.lomiri.hfd.conf
hfd-service-0.1.0/debian/libqt5feedback5-hfd.install 0000664 0000000 0000000 00000000065 14024150334 0022207 0 ustar 00root root 0000000 0000000 /usr/lib/*/qt5/plugins/feedback/libqtfeedback_hfd.so
hfd-service-0.1.0/debian/qml-module-hfd.install 0000664 0000000 0000000 00000000031 14024150334 0021322 0 ustar 00root root 0000000 0000000 /usr/lib/*/qt5/qml/Hfd/*
hfd-service-0.1.0/debian/rules 0000775 0000000 0000000 00000000114 14024150334 0016201 0 ustar 00root root 0000000 0000000 #!/usr/bin/make -f
%:
dh $@ --parallel --buildsystem cmake --fail-missing
hfd-service-0.1.0/qt/ 0000775 0000000 0000000 00000000000 14024150334 0014327 5 ustar 00root root 0000000 0000000 hfd-service-0.1.0/qt/CMakeLists.txt 0000664 0000000 0000000 00000000070 14024150334 0017064 0 ustar 00root root 0000000 0000000 add_subdirectory(feedback-plugin)
add_subdirectory(qml)
hfd-service-0.1.0/qt/demo/ 0000775 0000000 0000000 00000000000 14024150334 0015253 5 ustar 00root root 0000000 0000000 hfd-service-0.1.0/qt/demo/feedback.qml 0000664 0000000 0000000 00000001637 14024150334 0017521 0 ustar 00root root 0000000 0000000 import QtQuick 2.7
import Ubuntu.Components 1.3
import QtFeedback 5.0
MainView {
id: root
objectName: 'mainView'
applicationName: "app"
automaticOrientation: true
width: units.gu(45)
height: units.gu(75)
Page {
anchors.fill: parent
header: PageHeader {
id: header
title: i18n.tr("led test")
}
Column {
anchors {
top: header.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
Button {
text: "feedback"
onClicked: haptic.start();
}
}
HapticsEffect {
id: haptic
attackIntensity: 0.0
attackTime: 50
intensity: 1.0
duration: 100
fadeTime: 50
fadeIntensity: 0.0
}
}
}
hfd-service-0.1.0/qt/demo/leds.qml 0000664 0000000 0000000 00000001204 14024150334 0016712 0 ustar 00root root 0000000 0000000 import QtQuick 2.7
import Ubuntu.Components 1.3
import Hfd 0.1
MainView {
id: root
objectName: 'mainView'
applicationName: "app"
automaticOrientation: true
width: units.gu(45)
height: units.gu(75)
Page {
anchors.fill: parent
header: PageHeader {
id: header
title: i18n.tr("led test")
}
Column {
anchors.fill: parent
Button {
text: "on"
onClicked: Leds.state = Leds.state == 0 ? 1 : 0
}
Label {
text: "state: " + Leds.state
}
}
}
}
hfd-service-0.1.0/qt/feedback-plugin/ 0000775 0000000 0000000 00000000000 14024150334 0017347 5 ustar 00root root 0000000 0000000 hfd-service-0.1.0/qt/feedback-plugin/CMakeLists.txt 0000664 0000000 0000000 00000001700 14024150334 0022105 0 ustar 00root root 0000000 0000000 find_package(PkgConfig)
find_package(Qt5Core REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(Qt5Feedback REQUIRED)
qt5_add_resources(FEEDBACK_RESOURCES feedback.qrc)
set(QTFEEDBACK_HFD_SRC
hfd_feedback.h
hfd_feedback.cpp
)
qt5_add_dbus_interface(QTFEEDBACK_HFD_SRC
${CMAKE_SOURCE_DIR}/data/com.lomiri.hfd.xml hfdInterface
)
add_library(
qtfeedback_hfd SHARED
${QTFEEDBACK_HFD_SRC}
${FEEDBACK_RESOURCES}
)
# Ideally, we would read the plugin installation location from cmake
# but this does not work currently.
set(PLUGIN_INSTALL_LOCATION "${CMAKE_INSTALL_LIBDIR}/qt5/plugins/feedback")
# get_target_property(PLUGIN_LOCATION Qt5::Feedback PLUGIN_LOCATION)
message(STATUS "Installing Qt5 feedback plugin to: ${PLUGIN_INSTALL_LOCATION}")
target_link_libraries(
qtfeedback_hfd
${CMAKE_THREAD_LIBS_INIT}
Qt5::Core
Qt5::DBus
Qt5::Feedback
)
install(
TARGETS qtfeedback_hfd
LIBRARY DESTINATION ${PLUGIN_INSTALL_LOCATION})
hfd-service-0.1.0/qt/feedback-plugin/feedback.json 0000664 0000000 0000000 00000000060 14024150334 0021762 0 ustar 00root root 0000000 0000000 { "Interfaces": ["QFeedbackHapticsInterface"] }
hfd-service-0.1.0/qt/feedback-plugin/feedback.qrc 0000664 0000000 0000000 00000000141 14024150334 0021576 0 ustar 00root root 0000000 0000000
feedback.json