OSDN Git Service

Fix crash in Monkey test.
authorLei Yu <jackqdyulei@google.com>
Wed, 4 Apr 2018 00:25:18 +0000 (17:25 -0700)
committerLei Yu <jackqdyulei@google.com>
Wed, 4 Apr 2018 18:00:05 +0000 (11:00 -0700)
commitfd62af5792a834899d2fbea758a4c8b844ba47fa
tree975bd024e4ea3b3f6e354e1c2d204d5ad27b118f
parentcf60ff7e08e4f10e653210bcd4105156bcca86ff
Fix crash in Monkey test.

When battery page is launched, BatteryTipLoader will start running.
If we rotate the screen before loader is finished, it will store null
to Bundle and will crash when restoring from that Bundle.

In this cl, we add null pointer check for tip list to avoid the crash.

Also remove a TODO since it is obsolete.

Change-Id: Ic59bc20c633f3a7467f7b5e95da062160bcb4e93
Fixes: 77534165
Test: RunSettingsRoboTests
src/com/android/settings/fuelgauge/batterytip/BatteryTipPreferenceController.java
tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryTipPreferenceControllerTest.java