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

Skip to content
Commit 0a942a36 authored by Gil Cukierman's avatar Gil Cukierman
Browse files

Implement the identifier disclosure window

This commit implements the logic that tracks identifier disclosures and
decides when notifications should be emitted to the user. The actual
implementation of notifications is left to a future change. The core
concept is a disclosure window. A disclosure window is either open or
closed. Each disclosure window is associated with a single user
notification.

All new disclosures either:
1. are dropped if they are emergencies or the notifier is disabled.
2. open a new window if one is not open.
3. are added to an existing open window.

A window remains open for some duration, N, after its most recent
disclosure. Once N time has passed, the window is closed. If the
notifier is disabled, the window is closed.

The implementation makes use of a single threaded executor service to
offload all work that could eventually result in IPC for notifications
sent. The separate thread allows us to ensure that that calls into the
notifier won't block, since currently calls happen in Looper threads,
which can't block. The single thread allows us to enforce and reason
about strictly serialized operations more easily. This is important
because semantically, the notification for N+1 disclosures should happen
before the notification for N+2 disclosures.

Bug: 315818642
Test: atest CellularIdentifierDisclosureNotifierTest
Change-Id: I24ccf562fcc6601c4d0523ae4aa2eb9a23a55cbf
parent a850c09c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment