Prevent the load of the slice again if it is already
in the cache. loadSlice just fills Slice read from the DB into a map, if there is already such slice in the map, we could skip the async load process. Change-Id: I6e96ef72a9dc5a833ae158492134f4a6c94a7465 Bug: 249101421 Test: robotest
This commit is contained in:
@@ -385,6 +385,10 @@ public class SettingsSliceProvider extends SliceProvider {
|
||||
|
||||
@VisibleForTesting
|
||||
void loadSlice(Uri uri) {
|
||||
if (mSliceWeakDataCache.containsKey(uri)) {
|
||||
Log.d(TAG, uri + " loaded from cache");
|
||||
return;
|
||||
}
|
||||
long startBuildTime = System.currentTimeMillis();
|
||||
|
||||
final SliceData sliceData;
|
||||
|
Reference in New Issue
Block a user