Lock the screen when screen time limit is reached in a child session

Implement locking the screen when parental controls are enabled for child user, using the new MVP design as discussed in Teams/Design/os-mockups#271 (comment 2445908)

TODO:

  • Call relevant dbus functions asynchronously
  • Handle errors when malcontent-timerd is not running
  • Fix existing tests assuming parental limit is disabled
  • Write new tests assuming parental limit is enabled

First part of the gnome-shell integration for parental controls session time limits #8529 (closed)

Testing with the shell toolbox:

Once the toolbox has latest malcontent !3870 (merged), one can run the devkit via shell toolbox, and execute the command line utility (malcontent-client) from within the container.

Testing on the host:

If for some reason you want to test on the host (i.e. on GNOME OS), you can build and install a systemd-sysext with latest malcontent for testing, calling following script from within malcontent checkout:

./tools/build-sysext.sh --source-dir .

You can use malcontent-client command line utility to manage session limits:

malcontent-client get-session-limits
malcontent-client set-session-limits daily-limit --daily-limit 3600
malcontent-client set-session-limits daily-schedule --start-time 08:00 --end-time 22:00
# Daily time limit: 1 hour, bedtime: 22:00

When the active time since enabling any parental session limits reaches the daily limit, or the current time now reaches the bedtime, the lock screen should appear.

There's a related pending change in gnome-control-center, that makes related wellbeing settings insenstivie, as they no longer have any effect when parental control session limits are enabled. After setting any session limits either with malcontent-control or malcontent-client, the wellbeing panel should show the banner and the Screen Limits section should become insensitive.

Fixes #8575 (closed)

Edited by Ignacy Kuchciński

Merge request reports

Loading