AndroidBuildProvider
interface AndroidBuildProvider
Interface for providing Android Build properties in a testable way.
This abstraction allows for easier unit testing by enabling dependency injection of Build property access rather than directly accessing static Build fields. It provides access to key device identification properties from Build class.
Testing Benefits:
Enables mocking of Build properties during unit tests
Allows testing with different device configurations
Prevents tests from being dependent on actual device properties
Usage:
class MyCollector(private val buildProvider: AndroidBuildProvider = DefaultAndroidBuildProvider()) {
fun getDeviceInfo() = buildProvider.getHardware()
}Content copied to clipboard
See also
for the production implementation
for the underlying Android Build class