1. 14 Sep, 2020 1 commit
  2. 24 Oct, 2019 1 commit
    • spiiroin's avatar
      [fingerprint] Use gesture actions for fingerprint wake up. Fixes JB#47437 · 64e71c69
      spiiroin authored
      Originally fingerprint wake up was modeled to:
      - wake up display like double tap does
      - exit from lockscreen when device is not locked, or
      - indicate need to unlock when device is locked
      i.e. behave as if double power key press were made.
      
      This however means that fingerprint wake up never ends up showing
      lockscreen where things like date and time would be visible.
      
      Switch from handling fingerprint wake up as something explicit into
      treating it as just another gesture with configurable actions.
      
      Add "tkunlock2" gesture action, which behaves like "tkunlock" when
      device is unlocked and does nothing when device is locked.
      
      After which users can tweak fingerprint behavior with mcetool.
      
      mcetool --set-touchscreen-gesture-actions=fpwakeup,unblank,tkunlock
      
        The default behavior.
      
      mcetool --set-touchscreen-gesture-actions=fpwakeup,unblank,tkunlock2
      
        Exits from lockscreen only if device is not locked.
      
      mcetool --set-touchscreen-gesture-actions=fpwakeup,unblank
      
        Just wakes up display, leaving lockscreen status as it is.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      64e71c69
  3. 28 Aug, 2019 1 commit
    • spiiroin's avatar
      [battery-udev] Make charger type available on D-Bus. JB#38667 · a80fd7ea
      spiiroin authored
      Battery notifier in lipstick needs charger type information.
      
      Add charger type evaluation to udev power supply device tracker and
      broadcast changes internally within mce via a datapipe.
      
      Reflect datapipe changes as D-Bus signals, and add D-Bus methods for
      querying the current state.
      
      For development builds enable charger type simulation and appropriate
      mcetool options for controlling it.
      
      The required D-Bus constants are available in mce-dev >= 1.27.0.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      a80fd7ea
  4. 08 Aug, 2019 1 commit
    • spiiroin's avatar
      [dummy_compositor] Implement dummy compositor D-Bus service. JB#46723 · d26a075e
      spiiroin authored
      Performing seamless compositor hand off (such as switching from early
      boot unlock ui to regular lipstick ui) might not be possible if the
      compositors have non-compatible dependencies - like whether some android
      services are running or not.
      
      A dummy compositor service - that implements D-Bus interface expected
      by mce, but does not even attempt to control display hw - can be used
      to insert a stop gap within compositor to compositor hand off sequence
      where relevant services can then be started/stopped as required.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      d26a075e
  5. 15 Mar, 2019 4 commits
    • spiiroin's avatar
      [display] Wait for p-sensor state before acting on D-Bus requests · a6225765
      spiiroin authored
      When display on/dim requests are received over D-Bus, they must be
      subjected to proximity sensor check. However in on-demand proximity
      sensor mode this is not immediately available.
      
      Use the on-proximity action queue, so that proximity sensor gets powered
      up and display state requests are acted on once the sensor state is known.
      
      Also refactor the method call handler functionality so that repetitive
      copy-paste code can be eliminated.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      a6225765
    • spiiroin's avatar
      [tklock] Wait for p-sensor state before acting on fingerprint unlock · 8145d755
      spiiroin authored
      Fingerprint unlocking in LPM display state / immediately after blanking from
      LPM might need to perform full display unblank - which should not occur
      unless proximity sensor state is known.
      
      When ui-less fingerprint unlock is detected, trigger vibration feedback
      immediately but delay potential display unblanking until proximity
      sensor state is known.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      8145d755
    • spiiroin's avatar
      [powerkey] Wait for p-sensor state before executing powerkey/gesture actions · 1a529661
      spiiroin authored
      The actions executed due to powerkey press / touchscreen gesture events need
      to be subjected to proximity sensor check. If on-demand proximity sensor
      power up is used, sensor state is not available when input events are
      received.
      
      Use the on-proximity action queue, so that proximity sensor gets powered
      up and actions executed once the sensor state is known.
      
      As conditions for acting on power key and gesture events differ, queue
      predicate selection callback in front of the actual action callbacks.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      1a529661
    • spiiroin's avatar
      [proximity] On-demand proximity sensor activation. Fixes JB#34789 MER#1562 · d9c917b7
      spiiroin authored
      MCE code has built-in assumption that proximity sensor is either not used at
      all, or it is constantly powered on. The former basically means that in-call
      proximity blanking is not available. And the latter can cause direct (the
      sensor itself) or indirect (might block suspend) power drain, or make it
      more likely for lower level sensor handling glitches to surface.
      
      Make it possible to select on-demand proximity sensor activation.
      
      When selected, proximity sensor is powered up:
      - While the device in a state where it might be needed (calls, alarms, etc).
      - When events that could lead to display wakeup are received (powerkey
        presses, doubletaps, etc).
      
      As the sensor state is not available immediately after requesting
      sensor powerup, implement on-proximity action queue which can be used
      to schedule actions to be taken when the sensor has reached a stable
      state.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      d9c917b7
  6. 19 Dec, 2018 1 commit
    • spiiroin's avatar
      [battery-udev] Tweak battery full heuristics. Fixes JB#44036 · 07d0350b
      spiiroin authored
      The heuristics used for avoiding false positives in charger detection
      clash with heuristics needed for dealing with devices that use
      "Discharging" or "Not charging" battery status for signaling battery
      full condition.
      
      Add built-in blacklist to ignore all power suppply devices currently
      known to produce false positives for battery/charger detection.
      
      Remove charger device validation heuristics based on receiving
      "changed" udev notifications.
      
      Add slight delay between getting udev notifications and state evaluation
      to increase chances of getting both charger and battery events handled
      in one go.
      
      Do power supply device evaluation in two stages: Charger devices first,
      then battery devices - so that it is already known whether some charger
      devices are online when dealing with battery state heuristics.
      
      Treat also battery status transitions from "Charging" to "Discharging"
      or "Not charging" as battery full if they happen while a charger is
      connected and battery capacity is close enough to maximum.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      07d0350b
  7. 20 Nov, 2018 2 commits
    • spiiroin's avatar
      [buttonbacklight] Add setting for backlight off delay. JB#42094 · b5b680c9
      spiiroin authored
      The five second delay might be too long for some and too short for others.
      
      Add a setting so that the delay can be customized in device specific
      configuration files and/or persistently changed by the user via:
      
        mcetool --set-button-backlight-off-delay=<ms>
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      b5b680c9
    • spiiroin's avatar
      [buttonbacklight] Power off backlight after timeout. JB#42094 · 117697fd
      spiiroin authored
      The backlight for menu/home/back keys is enabled whenever UI side signals
      that key events will be used for UI control. Previously this meant that an
      android application is on top. Now that it is possible for these keys to
      be used also in SFOS context, it as a side effect means that the backlight
      is on practically always.
      
      Keep the logical backlight enable policy as it were, but implement a layer
      beneath it to allow powering off the button backlight after 5 seconds of
      no significant activity (e.g. display state changes and input events not
      related to touch screen).
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      117697fd
  8. 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
  9. 17 Oct, 2018 1 commit
    • spiiroin's avatar
      [mce-io] Augment resume detection with timerfd source. Fixes JB#43297 · f5e7d2f9
      spiiroin authored
      MCE needs to perform some tasks like rethinking timer expiration when device
      resumes from suspend. The resume detection is built on assumption that some
      input devices will send EV_SYN events on resume. In devices where such events
      are not emitted, on resume tasks can get indefinitely delayed.
      
      Take advantage on the fact that system time gets updated on resume, and
      use timerfd to trigger resume detection logic whenever system time changes.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      f5e7d2f9
  10. 18 Sep, 2018 3 commits
  11. 16 Mar, 2018 1 commit
  12. 15 Mar, 2018 1 commit
  13. 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
  14. 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
  15. 20 Apr, 2017 1 commit
  16. 06 Apr, 2017 1 commit
    • spiiroin's avatar
      [event-input] Expose touch and volume key policy on D-Bus. JB#38001 · c3c42ee0
      spiiroin authored
      Originally the mechanism used for stopping touch screen and volume key
      events from reaching ui layers was to disable the hw generating them.
      As this is not always possible, mce was modified so that it grabs evdev
      input device nodes instead. That too is problematic in devices that use
      multitouch protocol B and/or emit volume key events from input devices
      that can't be grabbed for some reason (such as providing also power key).
      
      As an enabler for UI side event filtering, expose the mce side input
      policy decisions on dbus. When the relevant UI components listen to
      these signals and handle/ignore input events accordingly, there is no
      need for mce to grab any input device nodes anymore.
      
      Also change the activation/deactivation of the opt-in debug led pattern
      PatternTouchInputBlocked to be based on the policy decision rather than
      grabbing/ungrabbing of touch input device nodes.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      c3c42ee0
  17. 31 Jan, 2017 1 commit
  18. 23 Jan, 2017 1 commit
    • spiiroin's avatar
      [mce] Expose battery/charging data on D-Bus. Fixes JB#37422 · afe100cb
      spiiroin authored
      Tracking battery data via statefs requires dealing with fuse and kernel
      related quirks. Since mce already deals with that, it would be preferable
      to reuse already functioning code instead of duplicating it elsewhere.
      
      Add handlers D-Bus method calls that can be used to query current values
      and send signals when state changes are detected.
      
      The following information is made available:
      - usb_cable_state: unknown | connected | disconnected
      - charging_state:  unknown | on | off
      - battery_status:  unknown | full | ok | low | empty
      - battery_level:   -1 | 0...100
      
      Related D-Bus constants are defined in mce-headers >= 1.21.0.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      
      REVIEW separate internal & dbus state processing more clearly
      afe100cb
  19. 24 Nov, 2016 1 commit
  20. 31 Mar, 2016 3 commits
  21. 11 Mar, 2016 1 commit
    • spiiroin's avatar
      [display] Use disable-blanking-from-lockscreen setting. MER#1542 · e463be68
      spiiroin authored
      When display and tklock modules were rewritten, all blanking timers
      were moved from tklock.c to modules/display.c. However the functionality
      dealing with setting for disabling timer based blanking from lockscreen
      was accidentally left behind in the tklock module rendering the whole
      setting useless.
      
      Move the setting logic to display module and remove old FIXME note.
      e463be68
  22. 07 Mar, 2016 1 commit
    • spiiroin's avatar
      [powerkey] Add enablers for configuring touchscreen gestures. Fixes MER#1537 · 9fe42f8b
      spiiroin authored
      Traditionally the only touchscreen gesture that has been able to wake
      the device from suspend has been the double tap. Now there are devices
      that support more gestures for waking up the device, but there are no
      means to differentiate / configure actions taken based on the various
      gestures.
      
      MCE already assumes EV_MSC:MSC_GESTURE event with value 4 is double tap.
      Extend on this and assume that also other gestures get reported in the
      similar fashion.
      
      Move gesture event handling from tklock.c to powerkey.c.
      
      Drop support for double tap setting and make gesture actions configurable
      similarly to what can be done with power key presses.
      
      Increase the number of user configurable dbus actions to 10. Tweak the
      related mcetool options so that instead of N similar but separate
      options (--set-powerkey-dbus-actionN=args) there is just one that takes
      action index as the first parameter (--set-powerkey-dbus-action=N,args).
      
      Add mcetool --set-touchscreen-gesture-actions options for configuring the
      gesture actions. Retain the old --set-doubletap-mode as an alias for the
      sake of backwards compatibility.
      9fe42f8b
  23. 07 Jan, 2016 3 commits
    • spiiroin's avatar
      [input] Add setting to allow/deny input device grabbing. JB#33644 · 0fa25544
      spiiroin authored
      Grabbing touch input events is problematic - especially with devices
      that use stateful protocol B for reporting. In general it would be better
      to allow lipstick to see all the touch events but ignore them while
      display is not in fully powered up state.
      
      Add a setting that can be used to instruct mce not to grab touch input
      device nodes. By default the grabbing is allowed.
      
      Normally platform specific configuration files are expected to be used
      when needed, but users can also tweak the setting via mcetool option
      --set-input-grab-allowed.
      0fa25544
    • spiiroin's avatar
      [touch] Use multitouch module for double tap emulation. JB#33644 · 255bba29
      spiiroin authored
      Attach multitouch state tracker to touch input devices and use it
      to provide double tap simulation.
      255bba29
    • spiiroin's avatar
      [touch] Add handler for multitouch protocol A and B. JB#33644 · a27e2168
      spiiroin authored
      The existing touch screen input event handling in mce is implemented in
      several places and in general does handle differences between A and B
      protocols in robust manner - and assumes that there will be only one
      touch/mouse input device available.
      
      Implement logic for tracking touch input state / double tap detection in
      a manner that allows the code to be re-used for several input devices
      when/if needed.
      a27e2168
  24. 09 Dec, 2015 1 commit
  25. 10 Nov, 2015 3 commits
  26. 29 Oct, 2015 1 commit
    • spiiroin's avatar
      [alarm] Hold wakelock while expecting alarm ui startup. Fixes JB#33008 · ad0e6c75
      spiiroin authored
      There is a rtc wakeup related scheduling hazard that can make DSME
      miss the fact that resume was made in order to show alarm dialog and
      device falls back to suspend before alarm ui has a chance to block
      suspend.
      
      Track alarm queue status from D-Bus signals emitted by timed and block
      suspend for up to 1 minute when alarm ui is expected to start up.
      ad0e6c75
  27. 15 Oct, 2015 1 commit
    • spiiroin's avatar
      [als] Add datapipe for temporarily enabling ALS. Contributes to JB#32278 · fda52bcf
      spiiroin authored
      Normally the ambient light sensor is enabled/disabled based on the
      display state. However there are situations where it would be nice
      to poll light value even when the display is off.
      
      Add ambient_light_poll_pipe datapipe. When it is executed with a true
      value, the sensor is turned on for 5 seconds - unless the als master
      toggle is turned off in mce settings.
      
      Since the assumption is that ambient light sensor is configured not to
      wake up the device from suspend, a wakelock is held to keep device from
      entering suspend for the duration of als poll.
      fda52bcf