[AppsFilter] read-only interface for snapshots

Provides a read-only interface that is used by computer and snapshots.
It fixes the data conflicts when AppsFilter is changed while a snapshot is
taken. This requires a watchable class for SparseSetArray.

Test: atest AppsFilterTest
Test: atest com.android.server.utils.WatcherTest
Test: m RUN_ERROR_PRONE=true framework services.core |& grep AppsFilter
BUG: 218411030
Change-Id: Ib9d13537b6cec911b2a189aea828e9baec650585
13 files changed