1. 03 Jul, 2020 1 commit
  2. 25 Jun, 2020 3 commits
    • spiiroin's avatar
      [battery-udev] Refresh all udev properties on heartbeat. Fixes JB#48324 · 2261f932
      spiiroin authored
      There might not be udev notification about every battery capacity
      percent value change. While this is usually harmless when battery
      is sufficiently full, it can cause issues like missed battery low
      notifications and/or delay battery empty shutdown so much that
      battery gets too depleted for regular bootup.
      
      Poll power supply device properties in process watchdog heartbeat
      pace i.e. about every 36 seconds of uptime not spent in suspend.
      
      Periodic udev polling is enabled by default, but can be disabled
      via mce configuration.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      2261f932
    • spiiroin's avatar
      [battery-udev] Enablers for forced udev property refreshing. JB#49693 · a01dacd6
      spiiroin authored
      For example pinephone sends udev notification about charger disconnect, but
      not about battery making related transition to discharging state - which
      leaves system believing battery is still getting charged.
      
      Add enablers for optionally refreshing properties of all power supply
      devices whenever at least one device is reporting changes.
      
      Forced refresh is disabled by default. Enabling should be done only
      on those devices where it is needed, via hw specific mce configuration.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      a01dacd6
    • spiiroin's avatar
      [battery-udev] Enablers for configurable charger types. JB#49693 · d387d08c
      spiiroin authored
      For example pinephone exposes charger devices in a manner where the
      name is prefixed with chiptype (e.g. "axp813-ac" / "axp20x-usb").
      As mce does not recognize these, both wall charger and pc connection
      gets treated as "other" type charger - which works to some extent but
      triggers incorrect UI actions.
      
      If direct match for power supply device type / name is not found, try
      to eliminate chipname prefix so that for example names such as
      "axp20x-usb" get treated as plain "usb".
      
      To future proof things, make it possible to override build-in
      defaults and heuristics via mce configuration files.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      d387d08c
  3. 12 Jun, 2020 1 commit
  4. 12 Sep, 2019 1 commit
    • spiiroin's avatar
      [mce-hybris] Enablers for masking hybris plugin features. JB#46746 · e0d23627
      spiiroin authored
      In some cases functionality from mce-plugin-libhybris that works and
      is needed in some devices can cause problems in other devices - for
      example using android hwc2 interface for display blank/unblank purposes
      can interfere with minui based unlock/upgrade UIs on devices that use
      kms/drm instead of legacy frame buffer.
      
      Make it possible to use configuration files for enabling / disabling
      features implemented in the hybris plugin.
      
      Keep all features enabled by default.
      
      Install configuration file that keeps enabled those features that actually
      might be used by mce and disables the rest.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      e0d23627
  5. 02 Nov, 2018 1 commit
    • spiiroin's avatar
      [led] Add proximity sensor debugging patterns. JB#43690 · 5667900c
      spiiroin authored
      Debugging proximity sensor issues is difficult as inspecting logs is
      usually not possible in the situation where the problem is detected,
      or the sensor has failed in distant enough past so that logs have been
      already lost due to log rotation.
      
      Add led patterns that are activated/deactivated as follows:
      - PatternProximityCovered when sensor is reporting closed state.
      - PatternProximityUncovering when sensor is reporting uncovered state, but
        effective state is still covered (uncover hysteresis).
      - PatternProximityUncovered when effective proximity state is uncovered.
      
      The patterns are disabled by default, but can be enabled via:
        mcetool --enable-led-pattern=PatternProximityCovered\
                --enable-led-pattern=PatternProximityUncovering\
                --enable-led-pattern=PatternProximityUncovered
      
      And disabled again with:
        mcetool --disable-led-pattern=PatternProximityCovered\
                --disable-led-pattern=PatternProximityUncovering\
                --disable-led-pattern=PatternProximityUncovered
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      5667900c
  6. 30 Oct, 2018 1 commit
    • spiiroin's avatar
      [battery-udev] Add battery tracker that utilizes udev. Fixes JB#43282 · d2e2e0aa
      spiiroin authored
      Reading battery information from virtual filesystem provided by statefs has
      problems that vary from one device type to another.
      
      Implementing udev based battery and charger tracking bypasses problematic
      statefs interfaces and also allows suspend proofing input processing in more
      robust manner.
      
      The battery-udev plugin enumerates all power_supply devices via libudev on
      startup and then subscribes to change notifications. Properties exposed via
      udev are mapped into battery / charger information in the format expected by
      mce and then broadcast internally within mce via relevant aatapipes and
      externally on D-Bus.
      
      If some power_supply devices are producing false positives or otherwise
      causing problems for the heuristics, they can be excluded from evaluation
      via blacklist block in mce configuration files.
      
        [BatteryUDevDeviceBlacklist]
        <device1 sysname>=TRUE
        <device2 sysname>=TRUE
      
      Sample config file at: inifiles/battery-udev-devices.ini
      
      When debugging (porting to new platform etc) the plugin can be instructed to
      track also changes in power_supply properties that should not be relevant
      for battery / charger state evaluation via config block like:
      
        [BatteryUDevPropertyBlacklist]
        <property name>=TRUE  # property changes are not shown
        <property name>=FALSE # property changes are shown
        # properties not mentioned in blacklist are show
      
      Sample config file at: inifiles/battery-udev-properties.ini
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      d2e2e0aa
  7. 15 Aug, 2018 1 commit
    • spiiroin's avatar
      [fingerprint] Add support for debug led patterns · 7f395b61
      spiiroin authored
      There are no visible clues for fingerprint authentication being
      possible / activated. This makes it difficult to differentiate between
      situations where fingerprint scanner has not been activated and lower
      lever functionality having problems with fingerprint acquisition.
      
      To ease debugging, add led patterns for lighting up the led in yellow
      color when fingerprint scanner is active and briefly turning the led
      blue on fingerprint acquisition events.
      
      These led patterns are not used by default, user must opt-in via:
        mcetool --enable-led-pattern=PatternScanningFingerprint
        mcetool --enable-led-pattern=PatternFingerprintAcquired
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      7f395b61
  8. 01 Mar, 2018 1 commit
    • 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
  9. 06 Oct, 2017 1 commit
    • spiiroin's avatar
      [buttonbacklight] Implement button backlight policy. JB#39838 · 74e962be
      spiiroin authored
      Devices designed with Android in mind can have menu/home/back
      buttons in front face. In some devices these buttons are
      practically invisible unless the underlying button backlight is
      turned on.
      
      Add D-Bus interface that can used by applications and/or
      lipstick for requesting and tracking button backlight state.
      
      Implement policy that turns button backlight on when:
      - Related sysfs controls have been defined in mce configuration
      - At least one D-Bus client has requested backlight
      - Display is powered up
      - Lockscreen is not active
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      74e962be
  10. 29 Sep, 2015 1 commit
  11. 12 Jun, 2015 1 commit
    • spiiroin's avatar
      Allow keyboard input device to get slider state from another input device · f7422083
      spiiroin authored
      There is an assumption in mce that slidable keyboards emit SW_KEYPAD_SLIDE
      events from the same input device that is emitting the actual key press
      events. However for example iyokan devices emits key presses from
      "pm8xxx-keypad" device and slide status as SW_LID event from "gpio-slider".
      While is already possible to use configuration files map SW_LID to the
      SW_KEYPAD_SLIDE event expected by mce, the keyboard availability logic
      does not work because it comes from different input device node.
      
      Make it possible to link keyboard input device to another input device
      that emits (optionally translated) SW_KEYPAD_SLIDE events.
      
      When evaluating sliding keyboard status, fetch the slider state from
      the device specified in the configuration.
      
      Add keyboard to slider state linking entry to example evdev input
      configuration file.
      
      [mce] Allow keyboard input device to get slider state from another input device. Fixes MER#1100
      f7422083
  12. 07 May, 2015 1 commit
    • spiiroin's avatar
      Tweak backlight control path configuration · eca66711
      spiiroin authored
      A way to explicitly define for backlight brightness control paths has
      been implemented a long time ago. However it uses hard-coded key names
      that do not follow the conventions used in the rest of the mce code base.
      
      Fix configuration item naming and use constants instead of hard-coding.
      
      Warn if number of possible brightness control files differs from the
      number of possible maximum brightness files.
      
      Add an example configuration ini-file.
      
      [mce] Tweak backlight control path configuration. Fixes MER#977
      eca66711
  13. 14 Mar, 2015 1 commit
    • spiiroin's avatar
      Remove SoftOff mode · b6d161ea
      spiiroin authored
      SoftOff mode is basically manual suspend to RAM for pre N900 era maemo
      devices. The logic in MCE side does not work and also support needed by
      it has beed dropped from DSME side ages ago.
      
      Remove all remnants of SoftOff mode that still linger in mce code tree.
      
      [mce] Remove SoftOff mode. Fixes JB#27285
      b6d161ea
  14. 13 Mar, 2015 1 commit
    • spiiroin's avatar
      Remove unused mce.ini configuration items · 9545acf7
      spiiroin authored
      During the evolution of mce it has repeatedly happened that code for
      some features has disappeared, but the related config items, macros
      and in some cases even variables remain littering the source tree.
      
      Remove all ini-file based configuration items, defines and variables
      that are not actually used in the code.
      
      [mce] Remove unused mce.ini configuration items. Fixes JB#25531
      9545acf7
  15. 25 Jan, 2015 1 commit
    • spiiroin's avatar
      Get battery data from statefs · 09e166ac
      spiiroin authored
      By default load statefs battery plugin instead of the upower one.
      
      [mce] Get battery data from statefs. Fixes JB#6273
      09e166ac
  16. 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
  17. 23 Dec, 2014 1 commit
    • spiiroin's avatar
      Refactor mce event input module · de4489de
      spiiroin authored
      Rename functions, data types and variables to reflect logical grouping
      and move items in each logical group close to each other.
      
      Switch indentation to use 4 spaces instead of 1 tabulator.
      
      Remove unused legacy ini-file config items.
      
      No significant functional changes.
      de4489de
  18. 12 Dec, 2014 1 commit
    • spiiroin's avatar
      Add enablers for evdev event mapping · 21b7d320
      spiiroin authored
      MCE assumes that certain events have strongly defined meaning, but on
      some devices kernel is emitting events that do not match expectations
      that mce has about them.
      
      Make it possible to add configuration files that are used to translate
      events kernel is emitting into what makes logical sense to mce.
      
      [mce] Add enablers for evdev event mapping
      21b7d320
  19. 24 Oct, 2014 1 commit
    • spiiroin's avatar
      Rewrite powerkey handler to allow more flexible configuration · 6154e96c
      spiiroin authored
      Taking double powerkey presses in use caused unconditional delay for
      single press handling. The actions that could be configured to be taken
      were not be differentiated based on display state, which made it
      impossible do one thing from display off and another one from display on.
      And since static configuration was used, changes did not take effect
      without restarting mce.
      
      Make possible actions as small and simple as possible. Allow combining
      them freely to choose actions taken. Use separate action combinations
      depending on whether display is on or off. Execute common parts of
      single and double press actions immediately when 1st powerkey press
      is released.
      
      Allow more flexibility for using custom dbus actions by allowing user
      configured method call to be made instead of signal broadcast.
      
      Use dynamic runtime changeable settings instead of static configuration
      from ini-files and add options to mcetool for changing all of them.
      
      Use the new functionality to:
      - apply device lock when double press is made from display on
      - unblank and hide lockscreen when double press is made from display off
      
      [mce] Rewrite powerkey handler to allow more flexible configuration. Fixes JB#23653
      6154e96c
  20. 03 Sep, 2014 1 commit
    • spiiroin's avatar
      Add memnotify plugin for signaling memory pressure level changes · be261b48
      spiiroin authored
      If /dev/memnotify is available the plugin will set up two memory use
      triggering levels. These are used to determine normal/warning/critical
      memory pressure situations. The current state can be queried via D-Bus
      method call "get_memory_level" and changes are broadcast as D-Bus signal
      "sig_memory_level_ind".
      
      Introspect data for new signal and method call is:
        <node name="/com/nokia/mce/signal">
          <interface name="com.nokia.mce.signal">
            <signal name="sig_memory_level_ind">
              <arg name="memory_level" type="s"/>
            </signal>
          </interface>
        </node>
      
        <node name="/com/nokia/mce/request">
          <interface name="com.nokia.mce.request">
            <method name="get_memory_level">
              <arg direction="out" name="memory_level" type="s"/>
            </method>
          </interface>
        </node>
      
      While it is up to other components to react to changes in memory
      pressure, it is expected that on warning level non-essential caches
      should be released and on critical level non-essential processes
      should be terminated.
      
      As the actual level limits must device specific, the built in config
      does not specify warning/critical levels.
      
      The levels can be specified by installing configuration files to
      "/etc/mce/<priority><name>.conf". Where priority is two digit
      number from 00 to 99 (60 is used for other device specific configs)
      and name should be something unique enough (say, package name).
      
      The levels can be adjusted during mce runtime via mcetool options
            --set-memuse-warning-used=<page_count>
            --set-memuse-warning-active=<page_count>
            --set-memuse-critical-used=<page_count>
            --set-memuse-critical-active=<page_count>
      
      The mcetool --status option shows the current memory use level.
      
      [mce] Add memnotify plugin for signaling memory pressure level changes. Fixes JB#22490
      be261b48
  21. 05 Aug, 2014 1 commit
    • spiiroin's avatar
      Add support for fixed time brightness fading · 642fd019
      spiiroin authored
      Previously display brightness fading was done using constant velocity
      or in constant time without considering the type of transition that
      was taking place. This made large changes like changing brightness
      settings or display dimming take a long time and/or easy to miss.
      
      Now separate fade durations are used when:
      - blanking screen
      - unblanking screen
      - dimming screen
      - other display state changes
      - adjusting to ambient light / brightness setting changes
      
      The values can be changed via mcetool options
            --set-brightness-fade-def=<msecs>
            --set-brightness-fade-dim=<msecs>
            --set-brightness-fade-als=<msecs>
            --set-brightness-fade-blank=<msecs>
            --set-brightness-fade-unblank=<msecs>
      
      Setting a value to zero disables fading and immediate transition is made.
      
      Also prefers direct sysfs manipulation for brightness control over using
      android hal via libhybris since the latter introduces some overhead and
      does not provide a way to read current backlight brightness level.
      
      [mce] Add support for fixed time brightness fading. Fixes JB#21713
      642fd019
  22. 27 Jun, 2014 1 commit
  23. 23 Jun, 2014 1 commit
    • spiiroin's avatar
      Package legacy configuration items separately · 68e2ce2f
      spiiroin authored
      Move legacy configuration entries to separate file: legacy.ini.
      
      Make them available via separate mce-config-legacy rpm package.
      
      Also add one line description at the top of the each ini-file.
      
      [mce] Package legacy configuration items separately. Fixes NEMO#616
      68e2ce2f
  24. 05 Jun, 2014 1 commit
    • spiiroin's avatar
      Tune led brightness configuration · f767aa27
      spiiroin authored
      Use 6/20/100 percent for minimum/normal/maximum ambient light levels.
      
      [mce] Tune led brightness configuration. Fixes JB#20149
      f767aa27
  25. 14 May, 2014 1 commit
    • spiiroin's avatar
      Use ambient light sensor to tune display brightness in lpm_on state · f40f2dc0
      spiiroin authored
      Add ALS profile configuration for use with lpm_on state. Should stay
      relatively dim indoors, saturates to 100% brightness at the same level
      as lowest display brightness profile.
      
      Setup a datapipe for communicating lpm brightness changes between display
      and brightness filtering plugins.
      
      Set standby override flag for ambient light sensor so that it can be
      powered on in lpm_on state too.
      
      [mce] Use ambient light sensor to tune display brightness in lpm_on state. Fixes JB#18791
      f40f2dc0
  26. 24 Apr, 2014 2 commits
    • spiiroin's avatar
      Tune ALS profiles · 33fb7b33
      spiiroin authored
      Widens dynamic range by allowing lower minimum brightness levels
      also for brightest profiles.
      
      Improves reaction to sunlight by saturating to 100% brightness
      level with smaller lux values than before.
      
      [mce] Tune ALS profiles. Fixes JB#12301
      33fb7b33
    • spiiroin's avatar
      Block late suspend while bluetooth activity is seen on D-Bus · fc628ee9
      spiiroin authored
      Add plugin for monitoring bluetooth activity on D-Bus.
      
      Any D-Bus signals from bluez are taken as bluetooth activity and late
      suspend is blocked until no more signals are seen for 5 seconds. This
      should allow time for bluetooth related processing to happen without
      the device falling to late suspend too early.
      
      [mce] Block late suspend while bluetooth activity is seen on D-Bus. Fixes JB#18124
      fc628ee9
  27. 14 Apr, 2014 1 commit
    • spiiroin's avatar
      Tune PowerOff led pattern priority · c90756be
      spiiroin authored
      The led testing patterns have priority of 9. Since the shutdown
      indication should have the highest priority, adjust the PowerOff
      led pattern to priority 8.
      c90756be
  28. 11 Apr, 2014 2 commits
    • spiiroin's avatar
      Add led indicator for display is dimmed state · 49cf4092
      spiiroin authored
      If the display brightness difference between display on and dimmed is too
      small to notice, use low intensity led pattern as dimmed indicator.
      49cf4092
    • spiiroin's avatar
      Support 100 brightness levels and up to 21 ALS profiles · c749d9f7
      spiiroin authored
      Previously mce used brightness levels 1-5, that corresponded to 20, 40,
      60, 80 or 100 percent brightness (manual mode) or selected one of the 5
      ALS profiles available (automatic mode).
      
      Now brightness level setting itself is percentage in manual mode and thus
      allows user to have more freedom to select suitable brightness.
      
      In automatic mode the percentage is mapped to one of the maximum of 21
      ALS profiles. The profiles follow the same logic as the previous five
      did, but having more of them allows user to select suitable compromise
      between how low the brightness is allowed to go vs. how fast it should go
      to the maximum brightness. There is also greater difference between the
      profiles in "office lightning" conditions, which hopefully makes it more
      apparent to users that the automatic mode is actually doing something.
      
      Existing brightness settings in the 1-5 range are migrated on during mce
      start up.
      
      Also the dimmed display brightness is now dynamic and is always less
      bright than the display on brightness.
      
      [mce] Support 100 brightness levels and 21 ALS profiles. Fixes JB#13670
      c749d9f7
  29. 08 Apr, 2014 1 commit
    • spiiroin's avatar
      Start led pattern when killing lipstick · 19624ed7
      spiiroin authored
      Configure "killing lipstick" led pattern. Needs to have higher priority
      than "problems with lipstick ipc" patterns, but lower than "problems
      with frame buffer sleep/wakeup".
      
      The led pattern is started when mce tries to make lipstick dump core.
      And stopped when lipstick process dies - or when even SIGKILL does
      not result in death of lipstick.
      
      [mce] Start led pattern when killing lipstick
      19624ed7
  30. 01 Apr, 2014 1 commit
    • spiiroin's avatar
      Detect and broadcast device flip over gestures · 17dad917
      spiiroin authored
      If the device orientation changes from face up to face down while
      the display is on and there is active call or alarm, an appropriate
      ui feedback signal is sent over D-Bus System Bus.
      
      [mce] Detect and broadcast device flip over gestures. Fixes JB#17820
      17dad917
  31. 26 Mar, 2014 1 commit
    • spiiroin's avatar
      Make shutdown led pattern have priority over powerup pattern · 50b00fad
      spiiroin authored
      If bootup must be cancelled before it finishes (for example due to battery
      or thermal policy) and shutdown is started, we can have a situation where
      both powerup and shutdown led patterns are active simultaenously. After the
      fix we will show the shutdown led pattern in cases like this.
      
      [mce] Make shutdown led pattern have priority over powerup pattern. Fixes JB#17671
      50b00fad
  32. 18 Mar, 2014 3 commits
    • spiiroin's avatar
      Fix debug led pattern naming · 183b9d92
      spiiroin authored
      Correct systematic copy-paste error in pattern names.
      183b9d92
    • spiiroin's avatar
      Tune example custom led pattern priorities · fdd96095
      spiiroin authored
      Even though these are not included in the rpm / used by default, the
      example patterns are moved to priority range in between communication
      and charging patterns. This should make it less likely that duplicating
      these for custom purposes ends up in completely wrong priority range.
      fdd96095
    • spiiroin's avatar
      Tune debug led pattern priorities · 180670f5
      spiiroin authored
      All debug led patterns now have lower priority than shutdown pattern to
      make it easier to detect that shutdown has started even if the ui is not
      in responsive state.
      
      Also kernel suspend problems have priority over lipstick ipc issues.
      
      [mce] Tune debug led pattern priorities
      180670f5
  33. 10 Mar, 2014 1 commit
    • spiiroin's avatar
      Grab touch input while display is off · a7e41b03
      spiiroin authored
      Input is grabbed when display is powered off.
      
      The grab is released when display is powered on and there are no
      finger or palm touch detected.
      
      This should stop the UI side from seeing touch events during
      display power up and provides additional protection against
      stray input if the device is held without covering the proximity
      sensor.
      
      [mce] Grab touch input while display is off
      a7e41b03
  34. 31 Jan, 2014 1 commit
    • spiiroin's avatar
      Add module for tracking PackageKit D-Bus service and Locked property · eaf8800e
      spiiroin authored
      Query PackageKit service state and properties on mce startup.
      
      Track changes to Locked property while PackageKit service is available.
      
      Handle PackageKit service starting up or exiting.
      
      [mce] Add module for tracking PackageKit D-Bus service and Locked property
      eaf8800e