Added
- Throw an exception indicating missing permissions when starting Motion Sense instead of silently ignoring the start request
Behavior changes
The MotionSenseStarter#start method will now throw a MotionSenseStartException, which includes a single property called failures. This property contains a set of all conditions that prevent Motion Sense from starting, such as missing required permissions or Motion Sense being disabled.
The FailureReason enum is defined as follows:
enum class FailureReason {
DISABLED,
NO_BATTERY_USAGE_PERMISSION,
NO_BLE_ADVERTISE_PERMISSION,
NO_BLE_CONNECT_PERMISSION,
NO_BLE_SCAN_PERMISSION,
NO_LOCATION_PERMISSION,
NO_NOTIFICATION_PERMISSION,
}Previously, this method silently ignored start requests when the required conditions were not met, which made debugging more difficult.