1. 15 Jan, 2019 2 commits
  2. 11 Jan, 2019 1 commit
  3. 08 Nov, 2018 2 commits
  4. 07 Nov, 2018 1 commit
  5. 01 Oct, 2018 6 commits
  6. 28 Sep, 2018 5 commits
  7. 27 Sep, 2018 3 commits
    • spiiroin's avatar
      [hybrisadaptor] Provide fallback values for select sensors. JB#43020 · a997710c
      spiiroin authored
      It is possible that on-change type sensors are not reported by android
      hal until a change is actually detected. Sensorfwd is left using zero
      initialized default values like proximity=covered / light=darkness -
      which in turn can cause various issues after each bootup.
      As the initial state can't be queried, choose the lest harmful option
      and define fallback values during sensor hal probing:
      - proximity sensor = not covered
      - light sensor = 400 lux
      If no actual sensor data has been received in a situation where sensor
      state needs to be communicated to clients, apply the fallback value.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [hybrisadaptor] Subject sensor type specific actions to common policy · ed38fb45
      spiiroin authored
      Sensor specific adaptors derived from HybrisAdaptor class can be configured
      to enable/disable sensors directly via sysfs. While doing that they also
      bypass enable/disable policy that is implemented in HybrisAdaptor.
      Fix each HybrisXxxAdaptor class so that common policy logic is executed
      first, and direct sysfs manipulation is done based on policy decision.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • 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>
  8. 26 Sep, 2018 1 commit
  9. 27 Jun, 2018 2 commits
  10. 26 Jun, 2018 2 commits
  11. 19 Jun, 2018 4 commits
  12. 01 Jun, 2018 2 commits
  13. 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>
  14. 24 May, 2018 5 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