1. 21 Jan, 2021 1 commit
  2. 18 Sep, 2018 1 commit
  3. 28 May, 2018 2 commits
    • spiiroin's avatar
      [mce-sensorfw] Implement sensor-test mode for mce. JB#41369 · 7bd4cfbc
      spiiroin authored
      When porting new devices, there already are numerous tools for testing
      sensors via kernel and/or android sensors hal interfaces. What is missing
      is an easy way to test sensors via interfaces exposed by mer sensorfwd.
      MCE implements robust sensofrwd IPC mechanisms and has user controllable
      debug logging facilities - take advantage of these to provide sensor
      test mode that can be used to test all sensors known to sensorfwd 0.10.0.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [mce-sensorfw] Refactor mce - sensorfwd IPC. JB#41369 · 17104348
      spiiroin authored
      So far MCE has utilized only three sensors - all of which report a single
      unsigned integer value. This has allowed code to organically grow in to a
      form that requires numerous glue functions for each sensor type and is
      ill-prepared for handling sensors that report vector form data.
      Reduce the amount of glue functions that needs to be implemented for each
      supported sensor type and stop assuming sensor data will be a single integer
      Handle situations where the standby-override attribute is not supported for
      an otherwise functioning sensor.
      Do not attempt to start mce-starting-up exceptional situation before the
      objects required by such operation have been created.
      Also fix spelling of some constants from SWF_xxx to SFW_xxx.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  4. 25 May, 2018 1 commit
    • spiiroin's avatar
      [mce-sensorfw] Do not retry loading of unavailable sensors. JB#41369 · c1fb3a29
      spiiroin authored
      Now that it is possible for sensorfwd to refuse loading a sensor plugin
      (due to the device not having such sensor), this can trigger MCE into
      perpetual retry-in-N-seconds D-Bus IPC loop.
      Differentiate between "sensor was not loaded" replies and "there were
      issues while requesting sensor load" error replies - so that former
      is taken to mean that the sensor is not available, and the latter as
      something that might be helped with retrying a bit later.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  5. 01 Mar, 2018 1 commit
  6. 03 Oct, 2016 1 commit
    • spiiroin's avatar
      [mce-sensorfw] Use obtained session id in logging. Fixes MER#1661 · f44aa462
      spiiroin authored
      Logging uses cached session id at stage where the cached value has not
      been updated to match reality. Causes diagnostic logging to look as if
      there would have been error / does not allow telling actual reason for
      failing to open a session.
      Use the session id obtained from sensorfwd.
  7. 07 Jul, 2015 1 commit
    • spiiroin's avatar
      Handle invalid session id from sensorfwd correctly · 88d3b4b4
      spiiroin authored
      MCE is assuming sensorfwd uses 0 for invalid session id while it
      is actually -1. This causes unwanted retries for sensor activation
      on devices where some sensors mce wants to use are not available.
      Use -1 for invalid session id.
      Differentiate between failure to obtain session id from sensorfwd
      (=retry) and getting invalid session id (=give up on failing sensor).
      [mce] Handle invalid session id from sensorfwd correctly. Fixes JB#30488
  8. 16 Jun, 2015 2 commits
    • spiiroin's avatar
      Improve handling of sensorfw related ipc failures · 7a20456c
      spiiroin authored
      If sensord gets blocked for some reason and is not able to send replies
      to D-Bus method calls mce is making in time, mce sees the request timeout
      and sensor state machines get stuck to error states until whole sensord
      service is restarted.
      Reattempt the failed ipc after brief delay until it succeeds. This should
      allow mce sensor tracking to recover from temporary scheduling problems
      that cause D-Bus method call timeouts.
      [mce] Improve handling of sensorfw related ipc failures. Fixes JB#29283
    • spiiroin's avatar
      Allow fine tuning ALS usage via mce settings · 41f1e2e1
      spiiroin authored
      MCE has one setting that dictates whether ambient light sensor is used
      or not. This was ok as long as ALS was used only for display brightness
      tuning, but now that there are other reasons for using ALS functionality
      of those too depend on whether automatic brightness tuning is in use or
      Leave the existing setting in place, use it as ALS master toggle and
      add separate settings for:
      - Use ALS automatic display brightness tuning
      - Use ALS for filtering false positive lid closed events
      If the master toggle is set to disabled, ALS is not used by mce.
      If the master toggle is set to enabled, ALS is powered up/down depending
      on feature specific settings and device state.
      Refactor ALS data processing so that:
      - callback for passing lux value from sensorfw uses int, not unsigned int
      - als power up depends on all three settings
      - variables holding cached lux values are given more descriptive names
      - all auto brightness filters use similar logic for testing whether the
        feature is enabled & als data is available
      - move all constants related to display settings to display.h
      ALS data is used for filtering out potential false positive lid close
      events only if the relevant settings are enabled.
      Options for mcetool:
        Now works as use als master toggle.
        Can be used to disable automatic brightness tuning even if using ALS
        is otherwise enabled.
        Can be used to disable lid close filtering even if using ALS is
        otherwise enabled.
      [mce] Allow fine tuning ALS usage via mce settings. Fixes JB#29892
  9. 03 Feb, 2015 2 commits
    • spiiroin's avatar
      Stop initial orientation reporting from triggering flip over gestures · 354553e1
      spiiroin authored
      If device was face-up the last time orientation sensor was enabled,
      sensord can report and mce assume that it is still face-up when the
      sensor is powered up the next time. This can make it look like the
      device were flipped over during sensor startup, which then silences
      incoming call / snoozes alarm  (if device is face-down and proximity
      sensor is not blocking display & sensor power up).
      Make mce forget orientation sensor state altogether when the sensor
      is stopped. And make sensor-gestures plugin wait a bit longer before
      accepting face-up immediately after sensor power up.
      [mce] Stop initial orientation reporting from triggering flip over gestures. Fixes NEMO#786
    • spiiroin's avatar
      Make state enum to state name helper functions globally available · 67d966cb
      spiiroin authored
      In many cases the helpers were created at the module that is primarily
      responsive for maintaining the datapipe content and datapipe listeners
      do debug logging using the numeric states - which requires effort to
      Move state enum to string helper functions to datapipe.c and list
      prototypes in mce.h next to enum type declaration.
  10. 16 Jan, 2015 1 commit
    • spiiroin's avatar
      Assume proximity covered while waiting for sensord to start up · 6a50ff9e
      spiiroin authored
      By default mce assumes that the proximity sensor is not covered unless
      ipc communication with sensord is in fully functioning state. This can
      cause problems during bootup (touch input gets enabled even though it
      should be blocked due to proximity sensor) and sensord restarts (the
      display can be powered on / lpm ui activated).
      Use time limited exceptional state during mce startup and sensord
      restarts during which time proximity=covered is reported to the
      state machines that use proximity state as an input.
      [mce] Assume proximity covered while waiting for sensord to start up. Fixes: JB#25575
  11. 11 Dec, 2014 1 commit
    • spiiroin's avatar
      Improvements to sensor state handling when sensord is not available · a8a9e7d1
      spiiroin authored
      If evdev source for als/ps is available amd sensord is not started, mce
      ends up using sensor state that (possibly never powered up) sensors happen
      to be reporting. This can break act dead mode totally if proximity sensor
      default is covered (double tap does not work and alarms are not shown).
      This fault was hidden for a while because sensord was erroneously started
      in act dead too.
      Add actual INITIAL state to relevant state machines instead of relying on
      "sensord not available" IDLE states. This makes initial state transitions
      to take place also in absence of sensord. This in turn is used to toggle
      tracking_active flags for sensor reporting so that safe-guess-defaults
      are used always when sensord is not alive regardless of whether we have
      sensord data from sensord itself or from evdev sources.
      [mce] Improvements to sensor state handling when sensord is not available. Fixes JB#24910
  12. 27 Aug, 2014 3 commits
  13. 25 Aug, 2014 6 commits
    • spiiroin's avatar
      Remove dead code · 108fc770
      spiiroin authored
      Leftovers from testing and evolving logic.
    • spiiroin's avatar
      Fix whitespace · ceb76aad
      spiiroin authored
    • spiiroin's avatar
      Remove unused debug logging · eda8f222
      spiiroin authored
      These were accidentally left in after testing.
    • spiiroin's avatar
      Fix pending call unref convention for dbus_send() helper functions · 7ea70a09
      spiiroin authored
      Legacy way of dealing with asynchronous dbus method calls in mce was to
      a) leave one extra ref to pending call when issuing the method call
      b) call dbus_pending_call_unref() from handler callback
      Which is problematic since (b) does not happen if the pending call is
      Now the extra reference is cleared after it is no longer needed and
      calls to dbus_pending_call_unref() from all related handler callbacks
      are removed.
    • spiiroin's avatar
      Add state transition diagram for mce-sensorfw module · a3487884
      spiiroin authored
      Can be turned in to a png file with dot from graphviz package:
        dot -Tpng mce-sensorfw.dot -o mce-sensorfw.png
    • spiiroin's avatar
      Rewrite mce-sensorfw module so that it does not use blocking dbus calls · 815e5ca7
      spiiroin authored
      The semi procedural logic is replaced by stacked state machines
      that should ensure that mce is never blocked if sensord gets stuck
      for some reason.
      Externally the interface provided by mce-sensorfw does not change.
      [mce] Rewrite mce-sensorfw module so that it does not use blocking dbus calls. Fixes JB#17747
  14. 27 May, 2014 1 commit
  15. 14 May, 2014 2 commits
  16. 13 May, 2014 1 commit
    • spiiroin's avatar
      Fix white space issues in mce code base · 9cc0f544
      spiiroin authored
      No functional changes.
      Files where majority of lines are indented with tabulators are changed
      so that every beginning of line uses tabulators for 8 character skips.
      The rest of the files use only space characters for indentation.
      Remove excess empty lines from all source files.
      Make indentation levels uniform within each source file.
      [mce] Fix white space issues in mce code base. Fixes JB#18915
  17. 11 Apr, 2014 1 commit
  18. 01 Apr, 2014 1 commit
  19. 14 Mar, 2014 1 commit
    • spiiroin's avatar
      Handle io watch error conditions gracefully · 7a56637c
      spiiroin authored
      All calls to g_io_add_watch() request error condition reporting, and
      all related callback functions at minimum will not create a virtual
      busyloop by leaving the io watch active and ignoring the error state.
      The mce io monitoring subsystem is modified so that instead of using
      separate io watches for data and error handling + optional error
      recovery callback it now has one io watch that first deals with
      possible errors and then handles possible input via monitor type
      specific logic and enforces delete notification callbacks for making
      clean up at upper level logic. This should allow mce to gracefully
      handle situations like adding/removing bluetooth keyboards.
      [mce] Handle io watch error conditions gracefully
  20. 11 Feb, 2014 1 commit
    • spiiroin's avatar
      Make devel build of mce log important external triggers by default · aeb6c0b1
      spiiroin authored
      Events logged are:
      * Time spent in suspend (via evdev inputs and mono vs boot time diff)
      * Proximity sensor state (from evdev orsensorfw / synthesized within mce)
      * Alarm state (D-Bus signal from alarm ui)
      * Call state (D-Bus signals from ofono)
      * CPU keepalive service (D-Bus method calls from clients)
      * Display blanking pause service (D-Bus method calls from clients)
      * Display blank/unblank alert leds (sysfs and D-Bus ipc with lipstick)
      * Display on/dim/off requests (D-Bus method calls from clients)
      * Display state changes (mce internal)
      * Device lock status (D-Bus signals from lipstick)
      * Tklock status changes (mce internal)
      * Tklock state requests (D-Bus method calls from clients)
      [mce] Make devel build of mce log important external triggers by default
  21. 21 Jan, 2014 1 commit
  22. 14 Jan, 2014 1 commit
    • spiiroin's avatar
      Tune logging levels · 327f33b8
      spiiroin authored
      Make things less noisy by default.
      Use mce specific LL_xxx levels instead of syslog LOG_xxx ones.
  23. 11 Nov, 2013 1 commit
  24. 31 Oct, 2013 2 commits
    • spiiroin's avatar
      Tone down diagnostic logging · 83e889de
      spiiroin authored
    • spiiroin's avatar
      If possible, use evdev inputs for PS and ALS data · d093c377
      spiiroin authored
      If ALS / PS inputs are detected during evdev probing, those
      will be used instead of the data provided by the sensord.
      This allows mce to apply wakelocks while processing the
      sensor data, and thus avoid accidental falling back to suspend
      in case there are ipc delays getting the data to mce via
      Enabling/disabling sensors still happens only via sensord.
      [mce] If possible, use evdev inputs for PS and ALS data
  25. 30 Oct, 2013 2 commits
  26. 14 Oct, 2013 2 commits