Support FoldingFeature for CONCURRENT state
Some emulated states such as CONCURRENT can be used in multiple
base/physical states (OPENED and HALF_OPENED).
This change adds support for the one-to-many mapping by:
1) Adding COMMON_STATE_USE_BASE_STATE constant. An internal state
where the CommonFoldingFeature.State should be derived from the
base/physical device state.
2) Updated DeviceStateCallback implementation which now listens to
both onStateChanged (existing) and onBaseStateChanged (new).
For emulated states configured as COMMON_STATE_USE_BASE_STATE,
the base/physical state is sent to the client.
Slight code cleanup:
1) Adds COMMON_STATE_NO_FOLDING_FEATURES which is used by some
device configurations but not currently defined. This constant
is used for device states where folding features do not exist.
2) A few function/variable renames
3) Added annotations
Bug: 268613897
Test: Using sample app, enter concurrent mode and then check
folding features
Change-Id: I8e2ad9e52996d6e337b22a21312518bf839c5670
2 files changed