Skip to content
Commit ac6bbdb6 authored by Mårten Kongstad's avatar Mårten Kongstad Committed by Ryan Mitchell
Browse files

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
parent 038b24eb
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