Replace HashMap with ArrayMap for better performance

Reason: https://screenshot.googleplex.com/BdHiua8gU8aGUmR

Test: manual
Bug: 308913393
Fix: 308913393
Change-Id: Iea085006ffe6ca48fe547319b9f0f4d20aa78bda
This commit is contained in:
Jun Lan
2023-11-02 18:15:39 +08:00
parent 4e80698911
commit b0f9489a09
6 changed files with 14 additions and 16 deletions

View File

@@ -34,7 +34,6 @@ import com.android.settings.Utils;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -295,7 +294,7 @@ public class DataProcessManager {
Log.d(TAG, "there is no work profile");
}
final Map<Long, UsageEvents> usageEventsMap = new HashMap<>();
final Map<Long, UsageEvents> usageEventsMap = new ArrayMap<>();
usageEventsMap.put(Long.valueOf(currentUserId), usageEventsForCurrentUser);
if (usageEventsForWorkProfile != null) {
Log.d(TAG, "usageEventsForWorkProfile is null");