1. 27 Sep, 2018 1 commit
    • spiiroin's avatar
      [hybrisadaptor] Refactor sensor start/stop logic · 8fab5538
      spiiroin authored
      Whether sensors should be started or stopped depends on a number
      of state variables. Using case specific conditionals at places
      where state variables might change makes the code fragile and
      hard to maintain.
      Separate sensor hal operations more clearly from logic and forms
      dictated by sensorfwd conventions.
      Use m_memberName naming convention for member variables, make
      all member data private and usable only via accessor functions.
      Use a single sensor start/stop policy evaluation function and
      call it from each place where relevant state variables might
      Use sensorfwd specific logging functions instead of qDebug etc.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  2. 26 Sep, 2018 1 commit
  3. 27 Jun, 2018 2 commits
  4. 26 Jun, 2018 2 commits
  5. 19 Jun, 2018 4 commits
  6. 01 Jun, 2018 2 commits
  7. 29 May, 2018 4 commits
    • spiiroin's avatar
      [nodebase] Emit debug logging if stub methods are reached · 4a34bdb3
      spiiroin authored
      Classes that inherit NodeBase should provide actual implementation
      for sensor specific setter/getter methods. To ease debugging make
      it visible when/if the default virtual stub methods get called.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [hybrisadaptor] Use pthreads for hybris reader · 38ed4f8e
      spiiroin authored
      An attempt is made to start/stop android sensor hal event reader during
      runtime based on whether at least one sensor is activated via hal or
      not - this which is a bit useless to start with (the thread would just
      block while all sensors are deactivated), the stopping does not actually
      work - which causes segfault during cleanup if orderly exit is attempted.
      Use posix thread API instead of QThread as it gives more fine grained
      control over asynchronous cancellation and posix signal blocking.
      Start thread on sensord startup, cancel it when sensord is exiting.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [sensord] Use pipe to trasfer posix signals to mainloop · d72f6f87
      spiiroin authored
      Sensord does async signal unsafe operations from posix signal handlers.
      Use pipe and QSocketNotifier() to transfer async signals from signal
      handler context to qt mainloop.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [sensormanager] Add plugin availability config and D-Bus queries. JB#41369 · 8cf47d1f
      spiiroin authored
      Allow disabling / enabling sensors plugins via config entries like:
      - "True" means that loading of the sensor plugin is made available
        via D-Bus interface and can be loaded.
      - "False" means the plugin will not be loaded and sensor is not
        made available via D-Bus
      - "Feature_*" means that sensor availability is checked from hw
        settings. If sensorfwd is compiled without ssu-sysinfo support
        these will be treated similarly to "True".
      - "" (or plugin that does not have config entry) is taken as "True",
        but a warning is logged in case of sensor plugins.
      If a plugin that is enabled in configuration fails to load, it is
      marked as not available until sensorfwd restart.
      Add new D-Bus method calls:
      - availablePlugins() lists all available plugins
      - availableSensorPlugins() lists available sensor plugins (which,
        when loaded, make new sensor objects and interfaces available)
      - pluginAvailable(name) can be used to check whether a named plugin
        is installed and available
      Package default sensor availability configuration file that disables
      all sensors except those that can be evaluated based on the hw
      settings configuration.
      Add example of device specific configuration file - these should be
      installed from hw adaptation packages and can override the defaults.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  8. 24 May, 2018 8 commits
    • spiiroin's avatar
      [config] Process config.d files in alnum order · 4a04b3ed
      spiiroin authored
      Each configuration file is kept in separate QSettings object and lookup
      for values is done in load order - which is reverse from convention
      where 10-something.conf can be overridden with 20-something-else.conf.
      Change evaluation so that latter files can override earlier ones under
      assumption that so far there have been no devices that would actually
      employ more than one config.d file and thus glitches are unlikely.
      Also merge data from all settings files into a single QSettings object
      i.e. trade a bit more complex startup for simpler lookups during runtime.
      The primary config file, if specified, still overrides any settings made
      from config.d files.
      Rename 90-sensord-default.conf to 10-sensord-default.conf so that it
      still is 10 points up from the minimum priority.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
    • spiiroin's avatar
      [logging] Use four distinct logging verbosity levels · 6fcb8934
      spiiroin authored
      While there are functions for "test" and "debug" level logging, both
      of these are compressed to QtDebugMsg type.
      Use QtInfoMsg type for "debug" logging and utilize a mapping function
      to make the QtMsgType values applicable for numerical comparing.
      Also drop sensordLog() macro that is just an alias for sensordLogD().
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [packaging] Fix local sensorfwd RPM builds · c62d3565
      spiiroin authored
      If scratchbox target has development packages required for building
      hybris plugin packages, building of the main sensorfwd package fails
      because unwanted files get copied under RPM BUILDROOT directory.
      Apparently this happens because unconditionally executed build time
      hybris availability check needed for Debian builds misfires.
      Make execution of qtCompileTest(hybris) conditional and trigger it only
      when making a Debian build.
      Note: While this does fix the RPM build problems, I have no means to
      verify whether Debian builds still work as expected.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [git] Remove .gitignore · d532d8c3
      spiiroin authored
      Making generated files not show up in git status can create hard to spot
      issues while doing local rebuilds. Also what should be hidden is a matter of
      taste, and having .gitignore that resides in master repo just makes it more
      difficult to tweak the ignores.
      Drop .gitignore from repository.
      Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com
    • spiiroin's avatar
      Bump version to 0.9.7 · a0a19124
      spiiroin authored
    • spiiroin's avatar
      Merge branch 'jb41619_after_oneshots' into 'master' · d6ce9475
      spiiroin authored
      Make sensorfwd wait for oneshot-root.service
      See merge request !24
    • spiiroin's avatar
      [systemd] Make sensorfwd wait for oneshot-root.service. Fixes JB#41619 · f15887ce
      spiiroin authored
      Android services/actions launched by droid-hal-init, queued oneshot
      scripts and sensorfwd are executing in parallel during bootup. During
      especially the 1st boot the scheduling of tasks can lead to sensorfwd
      getting hold of nonfunctional sensor hal.
      Delaying sensorfwd startup until oneshot scripts have been executed
      makes it less likely for the problem to surface.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  9. 23 Feb, 2018 7 commits
  10. 22 Feb, 2018 1 commit
  11. 18 Feb, 2018 2 commits
  12. 31 Aug, 2017 4 commits
    • spiiroin's avatar
      Bump version to 0.9.4 · bcdff5b1
      spiiroin authored
    • spiiroin's avatar
      Merge branch 'jb39550_ps_in_suspend' into 'master' · 61818753
      spiiroin authored
      Improve proximity sensor handling in suspend
      See merge request !19
    • spiiroin's avatar
      [hybris-adaptors] Use wakelock to ensure proximity data io. Fixes JB#39550 · ab997543
      spiiroin authored
      While android hal takes care of blocking suspend while sensorfwd is
      processing sensor events, this does not guarantee that clients receive
      sensor changes before the device falls back to suspend.
      So far this has not been a problem as only proximity sensor changes are
      tracked in suspend and mce can tap into suspend proof evdev input devices
      and ignore data passed by sensorfwd. However at least Sony Xperia X does
      not make evdev sources available and mce needs to rely on data from
      sensorfwd and the device can fall back to suspend before mce has a chance
      to read the sensor data.
      Obtain a wakelock that is automatically canceled by kernel after one second
      when sending proximity sensor data to clients.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [hybris-adaptors] Select 1st sensor variant for each sensor type. JB#39550 · 818be651
      spiiroin authored
      The advent of virtual sensor variants means it is likely that several
      sensors are listed by android hal for each sensor type. Looks like at
      least Sony Xperia X lists primary sensors (that have wakeup capabilities
      like we expect) before secondary sensors. As sensorfwd uses the last
      entry listed for each sensor type, it means we get inverse wakeup from
      suspend behavior from what we want: The proximity sensor does not wake
      up the device, but something like ambient light sensor would - if it
      were left active in suspend.
      Probably this sensor selection should mimic what android java side does
      when choosing default sensor for type, but that has dependencies to
      sensors api versions etc.
      Choose the 1st sensor listed for each type in assumption that it will be
      the best fit for our purposes in case of having several virtual sensor
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  13. 11 Aug, 2017 1 commit
  14. 08 Aug, 2017 1 commit