1. 14 Sep, 2020 1 commit
  2. 20 Jun, 2019 1 commit
  3. 17 May, 2019 1 commit
    • spiiroin's avatar
      [mce] Unify license blurbs. JB#33684 · 091d6e7e
      spiiroin authored
      MCE uses LGPL v2.1 (without "or later") license, but due to missing / use
      of different license blurbs this is not always clear enough.
      
      Replace blurbs referring to "LGPLv2" short form which could be either
      LGPL v2.0 or v2.1 without "or later" with the same blurb that is used
      in mce.c file.
      
      Similarly add blurb to source files that are missing one altogether.
      
      Add all authors that can be derived from git logs.
      
      Update Jolla Ltd. copyright statements to match git activity.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      091d6e7e
  4. 08 Mar, 2019 1 commit
    • spiiroin's avatar
      [dbus] Fix peerinfo tracking on mce startup · f5deaf81
      spiiroin authored
      Tracked services that are not running when mce starts up are left hanging in
      undefined state instead of getting declared as stopped. This happens because
      service is considered stopped when peerinfo makes transition away from
      running state - which is not possible before the service has been up at
      least once.
      
      Drop stale and deleted peerinfo states as they are not really needed and
      just add complexity.
      
      Handle state transitions resulting from name owner changes explicitly
      instead of doing them implicitly from within the setter function.
      
      Declare service as stopped when peerinfo enters stopped state rather than
      leaving running state.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      f5deaf81
  5. 25 Feb, 2019 1 commit
  6. 23 Nov, 2018 1 commit
    • spiiroin's avatar
      [dsme] Track thermal state from thermal manager. Fixes JB#43907 · e82c1a3f
      spiiroin authored
      MCE has functionality like PowerSaveMode that depends on device thermal
      state, however the thermal state datapipe that is supposed to carry
      thermal status information within MCE is not connected to any data source.
      
      Query current thermal status from thermal manager when the service shows
      up on D-Bus SystemBus, listen to thermal status change notifications, and
      feed the state information to thermal state datapipe.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      e82c1a3f
  7. 19 Sep, 2018 3 commits
    • spiiroin's avatar
      [datapipe] Make cache control property of datapipe. JB#22475 · c70ea98f
      spiiroin authored
      While in thery it might be useful to be able to control datapipe
      caching with every exec call, in practice the extra parameter just
      makes things look more complicated and errors are extremely difficult
      to spot.
      
      Define caching policy for each datapipe on initialization, and drop the
      cache control parameter from datapipe_exec_full() function.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      c70ea98f
    • spiiroin's avatar
      [datapipe] Drop useless datapipe_use_t enumeration. JB#22475 · f8b65183
      spiiroin authored
      As DATAPIPE_USE_INDATA is the only value left in the enumeration, it
      is pointless to pass it as an argument.
      
      Do not use datapipe_use_t values as function arguments.
      
      Remove the whole datapipe_use_t enumeration.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      f8b65183
    • spiiroin's avatar
      [datapipe] Mass rename datatypes. JB#22475 · d6b8b122
      spiiroin authored
      Switch to indent by 4 spaces.
      
      Rename datapipe_struct to datapipe_t, and use dp_ prefix for member data.
      
      Rename read_only_policy_t to datapipe_filtering_t, and values
        READ_WRITE -> DATAPIPE_FILTERING_ALLOWED
        READ_ONLY  -> DATAPIPE_FILTERING_DENIED
      
      Rename cache_free_policy_t to datapipe_data_t, and values
        DONT_FREE_CACHE -> DATAPIPE_DATA_LITERAL
        FREE_CACHE      -> DATAPIPE_DATA_DYNAMIC
      
      Rename data_source_t to datapipe_use_t, and values
        USE_INDATA -> DATAPIPE_USE_INDATA
        USE_CACHE  -> DATAPIPE_USE_CACHED
      
      Rename caching_policy_t to datapipe_cache_t, and values
        DONT_CACHE_INDATA -> DATAPIPE_CACHE_NOTHING
        CACHE_INDATA      -> DATAPIPE_CACHE_INDATA
        CACHE_OUTDATA     -> DATAPIPE_CACHE_OUTDATA
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      d6b8b122
  8. 28 May, 2018 1 commit
    • 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
      value.
      
      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>
      17104348
  9. 16 Mar, 2018 1 commit
    • spiiroin's avatar
      [dbus] Add dbus peer tracking api. JB#41340 · d456a8b9
      spiiroin authored
      While mce already has functionality for tracking dbus client
      details, the code was originally used for diagnostic logging
      purposes and is not really usable as generic purpose peer
      tracking api.
      
      Add functions for adding/removing peer detail trackers and
      make some already existing peerinfo functions available for
      use outside mce-dbus module too.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      d456a8b9
  10. 01 Mar, 2018 2 commits
    • spiiroin's avatar
      [fingerprint] Ignore powerkey during fingerprint enroll. Fixes JB#41217 · 2735b290
      spiiroin authored
      When enrolling fingerprints in devices where powerkey doubles as
      fingerprint sensor (e.g. f5121 / Sony Xperia X), it easily happens
      that the user presses the button all the way down - screen is blanked,
      which then causes cancellation of the enroll operation and the user
      must start all over again.
      
      Track fingerprint service availability and state on D-Bus.
      
      Ignore powerkey presses when enroll operation is in progress.
      
      Interpret fingerprint acquisition notifications as user activity
      during enroll, identify and verify operations - so that display
      blanking timers get reset every time user places finger on the
      sensor surface.
      
      The code in fingerprint plugin is derived from usb mode tracking
      plugin at modules/usbmode.c.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      2735b290
    • spiiroin's avatar
      [build] Remove unneeded include statements · 4e3a2510
      spiiroin authored
      The include files required by modules/headers changes over time.
      While missing headers cause compilation errors and are thus fixed
      promptly, the same does not apply for excess/redundant includes.
      
      Mass remove all includes that are no longer needed.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      4e3a2510
  11. 28 Feb, 2018 1 commit
    • spiiroin's avatar
      [datapipe] Unify naming. Contributes to JB#22475 · 5fadb870
      spiiroin authored
      Use "datapipe_"  prefix for all functions:
      
       datapipe_add_filter            <- append_filter_to_datapipe
       datapipe_add_input_trigger     <- append_input_trigger_to_datapipe
       datapipe_add_output_trigger    <- append_output_trigger_to_datapipe
       datapipe_exec_filters          <- execute_datapipe_filters
       datapipe_exec_full             <- execute_datapipe
       datapipe_exec_input_triggers   <- execute_datapipe_input_triggers
       datapipe_exec_output_triggers  <- execute_datapipe_output_triggers
       datapipe_free                  <- free_datapipe
       datapipe_init                  <- setup_datapipe
       datapipe_remove_filter         <- remove_filter_from_datapipe
       datapipe_remove_input_trigger  <- remove_input_trigger_from_datapipe
       datapipe_remove_output_trigger <- remove_output_trigger_from_datapipe
      
      Datapipes that are used for solely for requesting state changes (i.e. do not
      themselves have a state) have a verb in the name:
      
       display_state_request_pipe          <- display_state_req_pipe
       led_pattern_activate_pipe           (no change)
       led_pattern_deactivate_pipe         (no change)
       tklock_request_pipe                 <- tk_lock_pipe
      
      Datapipes that are used solely process input events without having a
      persistent state have "event" in the name:
      
       heartbeat_event_pipe                <- heartbeat_pipe
       ignore_incoming_call_event_pipe     <- ignore_incoming_call_pipe
       inactivity_event_pipe               <- device_inactive_event_pipe
       keypress_event_pipe                 <- keypress_pipe
       resume_detected_event_pipe          <- device_resumed_pipe
       touchscreen_event_pipe              <- touchscreen_pipe
       user_activity_event_pipe            <- user_activity_pipe
      
      Datapipes dealing with brightness have "brightness" included in the name:
      
       display_brightness_pipe             (no change)
       key_backlight_brightness_pipe       <- key_backlight_pipe
       led_brightness_pipe                 (no change)
       lpm_brightness_pipe                 (no change)
      
      Datapipes dealing with sensors have "sensor" in name and the one holding
      unfiltered data is called "actual":
      
       lid_sensor_actual_pipe              <- lid_cover_sensor_pipe
       lid_sensor_filtered_pipe            <- lid_cover_policy_pipe
       lid_sensor_is_working_pipe          (no change)
       light_sensor_actual_pipe            <- ambient_light_sensor_pipe
       light_sensor_filtered_pipe          <- ambient_light_level_pipe
       light_sensor_poll_request_pipe      <- ambient_light_poll_pipe
       orientation_sensor_actual_pipe      <- orientation_sensor_pipe
       proximity_sensor_actual_pipe        <- proximity_sensor_pipe
      
      Datapipes that have enumerated state reflect the enumeration type in
      datapipe name:
      
       alarm_ui_state_pipe                 (no change)
       audio_route_pipe                    (no change)
       battery_status_pipe                 (no change)
       bluez_service_state_pipe            <- bluez_available_pipe
       call_state_pipe                     (no change)
       call_type_pipe                      (no change)
       camera_button_state_pipe            <- camera_button_pipe
       charger_state_pipe                  (no change)
       compositor_service_state_pipe       <- compositor_available_pipe
       devicelock_service_state_pipe       <- devicelock_available_pipe
       devicelock_state_pipe               <- device_lock_state_pipe
       display_state_curr_pipe             <- display_state_pipe
       display_state_next_pipe             (no change)
       dsme_service_state_pipe             <- dsme_available_pipe
       jack_sense_state_pipe               <- jack_sense_pipe
       keyboard_available_state_pipe       <- keyboard_available_pipe
       keyboard_slide_state_pipe           <- keyboard_slide_pipe
       lens_cover_state_pipe               <- lens_cover_pipe
       lipstick_service_state_pipe         <- lipstick_available_pipe
       lockkey_state_pipe                  <- lockkey_pipe
       ngfd_service_state_pipe             <- ngfd_available_pipe
       submode_pipe                        (no change)
       system_state_pipe                   (no change)
       thermal_state_pipe                  (no change)
       uiexception_type_pipe               <- exception_state_pipe
       usb_cable_state_pipe                <- usb_cable_pipe
       usbmoded_service_state_pipe         <- usbmoded_available_pipe
      
      Datapipes that have boolean state should answer an
      "is" question:
      
       device_inactive_pipe                <- device_inactive_state_pipe
       interaction_expected_pipe           (no change)
       keypad_grab_active_pipe             (no change)
       keypad_grab_wanted_pipe             (no change)
       master_radio_enabled_pipe           <- master_radio_pipe
       music_playback_ongoing_pipe         <- music_playback_pipe
       osupdate_running_pipe               <- update_mode_pipe
       packagekit_locked_pipe              (no change)
       power_saving_mode_active_pipe       <- power_saving_mode_pipe
       proximity_blanked_pipe              <- proximity_blank_pipe
       shutting_down_pipe                  (no change)
       touch_detected_pipe                 (no change)
       touch_grab_active_pipe              (no change)
       touch_grab_wanted_pipe              (no change)
      
      Datapipes that have integer state should answer
      and "what is" question:
      
       battery_level_pipe                  (no change)
       inactivity_delay_pipe               <- inactivity_timeout_pipe
      
      Rename datapipe related callback functions and variables similarly as what
      was done to datapipes.
      
      Define submode bitmasks as submode_t enumeration instead of using
      gint type and preprocessor constants. Change the value naming from
      MCE_xxx_SUBMODE to MCE_SUBMODE_xxx.
      
      Change call_type_t enumeration value naming from xxx_CALL to
      CALL_TYPE_xxx.
      
      Change system_state_t enumeration value naming from MCE_STATE_xxx
      to MCE_SYSTEM_STATE_xxx.
      
      Fix setting up of power_saving_mode_active_pipe, master_radio_enabled_pipe
      and lens_cover_state_pipe so that initial values of appropriate type are
      used.
      
      Switch lockkey_state_pipe value from gboolean to key_state_t type.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      5fadb870
  12. 18 Nov, 2017 1 commit
  13. 02 Jun, 2017 2 commits
    • spiiroin's avatar
      [dbus] Drop unused async pid query functionality · 93dce250
      spiiroin authored
      No longer used, and if use arises, it would be better to implement via
      peerinfo mechanism that queries the pid anyway.
      
      Remove unused coode.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      93dce250
    • spiiroin's avatar
      [dbus] Enablers for limiting dbus methods to privileged clients. JB#38607 · ad906022
      spiiroin authored
      D-Bus configuration mechanisms do not support allowing/denying method calls
      based on effective uid/gid. While mce already has multiple partially
      overlapping ways to track clients, none of these are suitable for effective
      uid/gid checking.
      
      Track all D-Bus peers doing ipc with mce and maintain a cache of properties
      relevant for privilege checks for each peer.
      
      Delay execution of privileged method calls until the peer details are known
      so that access can be granted / denied.
      
      Rewrite existing client exit, service availability and debug identity
      tracking to utilize the same logic that is used for privilege checks.
      
      Also remove / hide some mce-dbus functions that are not used by other
      parts of mce code base.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      ad906022
  14. 12 May, 2017 2 commits
    • spiiroin's avatar
      [mce] Add valgrind mode to ease memory leak debugging · 87a66337
      spiiroin authored
      Using valgrind to find memory issues from mce can be tricky.
      
      Add --valgrind-mode command line option for running mce in valgrind friendly
      manner when needed.
      
      Do not unmap plugins so that valgrind can locate symbol information for them
      at exit time.
      
      Flush cached dbus message objects before exiting.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      87a66337
    • spiiroin's avatar
      [dbus] Use closable private D-Bus connection · c3addcb4
      spiiroin authored
      MCE should have controlled D-Bus connects and disconnects, but especially
      disconnect is uncertain when shared connections are used.
      
      Establish a private connection on mce startup and explicitly close the
      connection on shutdown.
      
      Also intercept dbus_bus_get() and dbus_bus_get_private() calls to libdbus
      to be sure libraries / plugins are attempting to make unexpected D-Bus
      connections.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      c3addcb4
  15. 11 May, 2017 1 commit
  16. 20 Apr, 2017 1 commit
  17. 24 Nov, 2016 3 commits
  18. 10 Nov, 2016 2 commits
    • spiiroin's avatar
      [dbus] Add method call for getting all mce settings. JB#34813 · d48ca6a7
      spiiroin authored
      If client needs to track multiple mce settings, getting the initial
      values one by one via blocking dbus calls is slow and cumbersome/difficult
      asynchronously (the number of available settings exceeds the default
      maximum number of pending dbus calls allowed by system bus configuration).
      
      Add com.nokia.mce.request.get_config_all() method call that can be used
      to get current values of all mce settings at once.
      
      Related constants are made available in mce-headers > 1.20.0.
      d48ca6a7
    • spiiroin's avatar
      [dbus] Remove unneeded constants · 59881ef5
      spiiroin authored
      These have been in mce-dev for ages.
      59881ef5
  19. 03 Nov, 2015 1 commit
    • spiiroin's avatar
      [dbus] Move dbus_any_t union declaration to mce-dbus.h · 0b7a9f9b
      spiiroin authored
      Essentially the same declaration is made in several source files and
      is used to simplify D-Bus message construction and parsing.
      
      Move the declaration to mce-dbus.h header file and remove redundant
      declarations from source files.
      
      Rename the union declared in the radiostates plugin as it is used in
      slightly different manner and needs to have non-const pointers.
      0b7a9f9b
  20. 09 Oct, 2015 3 commits
  21. 02 Oct, 2015 2 commits
    • spiiroin's avatar
      [dbus] Tune error recovery paths · 04db62d4
      spiiroin authored
      Fix a memory leak in config_reset_dbus_cb() error path and simplify error
      handling in dbus_acquire_services().
      04db62d4
    • spiiroin's avatar
      [dbus] Allow adjusting mce verbosity while it is running. Fixes JB#32492 · 03e2ef58
      spiiroin authored
      Now and then a situation arises where mce verbosity needs to be adjusted
      for debugging purposes without restarting the process. Currently it can
      be done via sending USR1/USR2 signals to mce process, but that is a bit
      clumsy and does not allow choosing the required logging level.
      
      Implement dbus method calls for adjusting mce verbosity and add mcetool
      option that utilizes this to select required verbosity level:
            --set-verbosity=<emerg|alert|crit|err|warning|notice|info|debug>
      
      The change is temporary and mce returns to default verbosity when the
      service is restarted / device is rebooted.
      03e2ef58
  22. 22 Sep, 2015 1 commit
    • spiiroin's avatar
      [dbus] Add method for querying uptime and suspend time. Fixes JB#31310 · efae71e6
      spiiroin authored
      Usually test automation scripts can get suspend statistics from proc fs.
      But as some devices do not have the necessary kernel interfaces, we need
      to have a common way to get suspend vs uptime statistics.
      
      Add a dbus-method for querying uptime and time spent in suspend. Provide
      mcetool option "--get-suspend-stats" for getting it in a form that easy
      to use from scripts.
      efae71e6
  23. 10 Sep, 2015 1 commit
  24. 24 Feb, 2015 1 commit
    • spiiroin's avatar
      Delay purging of D-Bus name owner information · 6cc8693a
      spiiroin authored
      A cache of D-Bus name owner information is maintained by mce - mostly
      for facilitate more informative diagnostic logging. The cached entries
      are purged when name owner changed signal is seen. If diagnostic
      logging is triggered by the same signal, the cached information can
      already be lost and failing re-attempt to get it creates noise on
      journal.
      
      Do the actual purging via idle callback, so that it happens after
      actions triggered by the name owner signal have been dealt with.
      6cc8693a
  25. 17 Feb, 2015 1 commit
    • spiiroin's avatar
      Add dbus method and mcetool option for requesting settings reset · 72f83bd6
      spiiroin authored
      Allows resetting mce settings back to defaults without needing to
      know what the defaults are and/or stopping mce service.
      
      To reset all settings to defaults, use:
        mcetool --reset-settings
      
      To reset for example only display related settings, use:
        mcetool --reset-settings=/display/
      
      [mce] Add dbus method for requesting settings reset. Fixes JB#24286
      72f83bd6
  26. 12 Feb, 2015 1 commit
    • spiiroin's avatar
      Do not attempt to reconnect if dsme socket connection is closed · b0074507
      spiiroin authored
      When dsme exits, mce sees the dsme specific socket getting closed
      before dsme dbus service drops from the system bus. Because the
      dbus service is still supposedly available, reconnect attempt
      is made but it only leads into spamming journal with warnings.
      
      Use dbus service tracking from mce-dbus module for dsme too.
      
      When eof or read error occurs on dsme socket, assume dsme has made
      and exit and wait for dbus service availability changes before
      attempting to reconnect.
      
      Also skip some dsme related warnings when the device is shutting
      down and not having dsme available is more or less expected.
      
      [mce] Do not attempt to reconnect if dsme socket connection is closed. Fixes JB#26373
      b0074507
  27. 23 Jan, 2015 1 commit
    • spiiroin's avatar
      Fix USB cable connection related issues in display blanking policy · 4da9aaa6
      spiiroin authored
      There is logic in mce to process charging state separately from usb
      cable connect state, but since the legacy logic for detecting does
      not work charging status has been used for things that should depend
      on cable connect. This delays things like turning on display to show
      usb mode selection dialog and makes it hard to decide how long the
      display should be kept on. And turning on display when mce starts
      up while usb cable is already attached can cause problems during 1st
      boot if the display state restoration occurs close to starting up of
      the startup wizard.
      
      Use usb mode provided by usb_moded to determine usb cable state. The
      usb_moded tracking logic is derived from the implentation used in dsme.
      Both mce and dsme use LGPL v2.1 license.
      
      Use separate display on rules for charging and cable connect changes.
      
      Do not turn on the display when cable is removed / charging stops.
      
      Do not turn on the display if usb cable is already connected when
      mce is started.
      
      Fix glitches in display state handling and automatic brightness
      tuning during mce startup.
      
      [mce] Fix USB cable connection related issues in display blanking policy. Fixes JB#25788
      4da9aaa6
  28. 22 Jan, 2015 1 commit
    • spiiroin's avatar
      Move dbus service tracking helpers from display plugin to mce-dbus · 27dc9059
      spiiroin authored
      There are multitudes of local dbus service tracking variants scattered
      around mce code base.
      
      The lipstick state is needed by tklock core module and provided by
      in theory optional display plugin.
      
      Move the name owner tracking implemented in display plugin to mce-dbus
      so that it can be used as common implementation for tracking all dbus
      services that are essential for mce operation. Initially use it for
      tracking availability of lipstick and compositor service.
      27dc9059
  29. 03 Sep, 2014 1 commit