diff options
author | 2024-10-23 15:49:25 +0200 | |
---|---|---|
committer | 2024-10-23 15:49:25 +0200 | |
commit | db82c35b0061e3d89edc749f9b76ff55fda521bf (patch) | |
tree | 31bf38c2ce10825b97e357a0c7a34fe27f7d5d60 /packages/Shell/src | |
parent | 5025d6854ee7798c7b7ea152e549354a1919500c (diff) |
EventConditionProvider: Ensure that reloadTrackers precedes evaluateSubscriptions
A previous (luckily, flagged) change to this class delayed the first call to reloadTrackers() to onUserSwitched(). This works well on HSUM devices; however on devices where user 0 is also a proper user and has event-based Zen Rules, we would try to do the first evaluation when onSubscribe() is called, before creating the trackers, which would eventually NPE.
Therefore we change the approach slightly:
* We restore the call to reloadTrackers() for the system user. This is pointless on HSUM (but also harmless, because user 0 will have no event rules).
* We only reload trackers on user switch when actually switching to a different user. This prevents wasting work during boot on non-HSUM devices.
* Although it should no longer be triggered, we early-exit when no trackers produced a result from the evaluation.
Fixes: 374683409
Test: atest EventConditionProviderTest + manual on non-HSUM and HSUM devices
Flag: android.app.modes_hsum
Change-Id: I543bdec20ec2858c2cbe7c7a6bc4e7f19a728ab0
Diffstat (limited to 'packages/Shell/src')
0 files changed, 0 insertions, 0 deletions