Add null check when restart batteryinfo loader
Even though we unregister contentObserver in onPause and register in onResume, callback still be called while fragment is detached. Anyhow add a null check in settings to stop crash Fixes: 131905853 Test: RunSettingsRoboTests Change-Id: I8c0c2c04c3b8d942e0c97cf71a7d3e735a24b467
This commit is contained in:
@@ -378,6 +378,9 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList
|
||||
|
||||
@VisibleForTesting
|
||||
void restartBatteryInfoLoader() {
|
||||
if (getContext() == null) {
|
||||
return;
|
||||
}
|
||||
getLoaderManager().restartLoader(BATTERY_INFO_LOADER, Bundle.EMPTY,
|
||||
mBatteryInfoLoaderCallbacks);
|
||||
if (mPowerFeatureProvider.isEstimateDebugEnabled()) {
|
||||
|
Reference in New Issue
Block a user