Add LifecycleOperationStorage and tests

This is preparatory work to fix bug b/161089758 where
it's possible for an app's BackupAgent to crash and leave
the app in 'restricted mode' when subsequently relaunched.

The bug fix involves storing new associations between
package name and operation tokens.  Rather than further
extend UserBackupManagerService, this change introduces a
new LifecycleOperationStorage class, and interface
OperationStorage, which takes the responsibility for
storing Operations by token, the associated locking, and
adds the new mapping from package name to operation tokens.

Later changes will refactor UserBackupManagerService to
use LifecycleOperationStorage, and several related classes
to use OperationStorage.

BUG: 161089758
Test: atest FrameworksServicesTests:OperationStoreTest
Change-Id: I689d36cdf84504d7710f05f5abcd12fe4bb1b6d8
3 files changed