Add a type for battery receiver, then in callback client know for which reason it been invoked: 1. battery level change 2. battery saver state change 3. battery plug state change So in this CL, we won't update battery tip for battery level change, then battery tip won't be dismissed by itself. Also note in onResume() we will manually update battery tip. So if user stay in battery settings page and close the screen, once he opens it we will still force update everything. Fixes: 79171742 Test: RunSettingsRoboTests Change-Id: I997844216fd8267e545d74e0d434de9e338f76a1 Merged-In: I997844216fd8267e545d74e0d434de9e338f76a1
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.