AutoSyncWorkDataPreferenceController gets mUserHandle from Utils.getManagedProfileWithDisabled which may return null, crash will happend when updateState called. So a judgement here seems helpful to make the program more robust. Bug: https://partnerissuetracker.corp.google.com/u/1/issues/72908879 Test: make ROBOTEST_FILTER="(AutoSyncWorkDataPreferenceControllerTest)" RunSettingsRoboTests Change-Id: I53ca027a2f2dd79655cc2eee67db236cfa03f656 Signed-off-by: tiansiming [田思明] <tiansiming@xiaomi.com>
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.