Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8b8e208b authored by Matías Hernández's avatar Matías Hernández
Browse files

Fix user attribution of zen-related calls into NM/ZenModeHelper

Previously, any API calls would operate on the ZenModeConfig for the current user, even if the call was coming for a package runing on a background user. With this change, every call either specifies a specific user (calculated from the Binder caller) or explicitly indicates that it's supposed to work on the current configuration.

The only methods in ZenModeHelper that still access mConfig directly are:
* intialization-related ones
* setConfigLocked and callees (evaluateZenModeLocked, etc)
* loadConfigForUser and callees (cleanUpZenRules, etc)
* dump/metric-collecting methods (bugreports, etc)
* methods called internally by the system (such as ringer-related stuff)

Note that computed zen state and computed consolidated policy are still global, so background users who call setInterruptionFilter/setAutomaticZenRuleState will not observe them changing (until we switch back to that user). This is intended behavior because Zen isn't actually applied for them, in practice.

Bug: 323163267
Test: atest ZenModeHelperTest + manually
Flag: android.app.modes_multiuser
Change-Id: Id624f8b64ab016406694d9a5af629223ba2c84de
parent f76196eb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment