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
Loading
Please register or sign in to comment