OMS: add transactional API
Implement a transactional API for the OMS. This allows a caller to batch
together individual operations, and apply those operations atomically:
either they all succeed (and notifications are sent out accordingly), or
some operation fails (and the transaction is cancelled, any internal
changes are rolled back, and no notifications are sent out).
As an added bonus, batching OMS operations result in fewer requests to
the system to refresh affected packages.
This commit adds support for transactions but leaves the old one-shot
API intact. The old API should be considered deprecated and will be
removed at some point in the future.
Note: the old API provided both setEnabled and setHighestPriority as
separate calls. In the transactional API, setEnabled implies
setHighestPriority.
Also, refactor the methods to broadcast ACTION_OVERLAY_CHANGED and to
reach out to the package and activity managers. The methods no longer
call each other: instead, it is up to the caller to explicitly invoke
each method.
Bug: 119916381
Test: builds
Change-Id: I63df58510efbc5f7a7d3146a122c3d6209e7478b
5 files changed