Fix LoaderCallback.onLoadFinished uncalled issue
When two loaders started almost at the same time, it is possible onLoadFinished is never called. Bug: 256523472 Test: Unit tests passed and manual test on device Change-Id: I41a041d5878f9930db44775408380d0d4588faba Signed-off-by: Zhenwei Chen <zhenwec@google.com>
This commit is contained in:
@@ -52,7 +52,6 @@ public class PowerUsageAdvanced extends PowerUsageBase {
|
||||
private static final String KEY_REFRESH_TYPE = "refresh_type";
|
||||
private static final String KEY_BATTERY_GRAPH = "battery_graph";
|
||||
private static final String KEY_APP_LIST = "app_list";
|
||||
private static final int LOADER_BATTERY_USAGE_STATS = 2;
|
||||
|
||||
@VisibleForTesting
|
||||
BatteryHistoryPreference mHistPref;
|
||||
@@ -165,7 +164,7 @@ public class PowerUsageAdvanced extends PowerUsageBase {
|
||||
bundle.putInt(KEY_REFRESH_TYPE, refreshType);
|
||||
if (!mIsChartDataLoaded) {
|
||||
mIsChartDataLoaded = true;
|
||||
getLoaderManager().restartLoader(LOADER_BATTERY_USAGE_STATS, bundle,
|
||||
restartLoader(LoaderIndex.BATTERY_HISTORY_LOADER, bundle,
|
||||
mBatteryHistoryLoaderCallbacks);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user