Home
last modified time | relevance | path

Searched refs:EventIndex (Results 1 – 11 of 11) sorted by relevance

/frameworks/base/services/people/java/com/android/server/people/data/
DEventIndex.java68 public class EventIndex { class
69 private static final String TAG = EventIndex.class.getSimpleName();
93 static final EventIndex EMPTY = new EventIndex();
98 EventIndex::createOneDayLongTimeSlot,
99 EventIndex::createFourHoursLongTimeSlot,
100 EventIndex::createOneHourLongTimeSlot,
101 EventIndex::createTwoMinutesLongTimeSlot
106 static EventIndex combine(EventIndex lhs, EventIndex rhs) { in combine()
107 EventIndex older = lhs.mLastUpdatedTime < rhs.mLastUpdatedTime ? lhs : rhs; in combine()
108 EventIndex younger = lhs.mLastUpdatedTime >= rhs.mLastUpdatedTime ? lhs : rhs; in combine()
[all …]
DEventHistoryImpl.java63 private final SparseArray<EventIndex> mEventIndexArray = new SparseArray<>();
135 SparseArray<EventIndex> diskIndexes = in loadFromDisk()
157 public synchronized EventIndex getEventIndex(@Event.EventType int eventType) { in getEventIndex()
158 EventIndex eventIndex = mEventIndexArray.get(eventType); in getEventIndex()
159 return eventIndex != null ? new EventIndex(eventIndex) : mInjector.createEventIndex(); in getEventIndex()
164 public synchronized EventIndex getEventIndex(Set<Integer> eventTypes) { in getEventIndex()
165 EventIndex combined = mInjector.createEventIndex(); in getEventIndex()
167 EventIndex eventIndex = mEventIndexArray.get(eventType); in getEventIndex()
169 combined = EventIndex.combine(combined, eventIndex); in getEventIndex()
207 EventIndex eventIndex = mEventIndexArray.get(event.getType()); in addEventInMemory()
[all …]
DAggregateEventHistoryImpl.java32 public EventIndex getEventIndex(int eventType) { in getEventIndex()
34 EventIndex eventIndex = eventHistory.getEventIndex(eventType); in getEventIndex()
39 return EventIndex.EMPTY; in getEventIndex()
44 public EventIndex getEventIndex(Set<Integer> eventTypes) { in getEventIndex()
45 EventIndex merged = null; in getEventIndex()
47 EventIndex eventIndex = eventHistory.getEventIndex(eventTypes); in getEventIndex()
51 merged = EventIndex.combine(merged, eventIndex); in getEventIndex()
54 return merged != null ? merged : EventIndex.EMPTY; in getEventIndex()
62 EventIndex eventIndex = eventHistory.getEventIndex(eventTypes); in queryEvents()
DEventHistory.java29 EventIndex getEventIndex(@Event.EventType int eventType); in getEventIndex()
33 EventIndex getEventIndex(Set<Integer> eventTypes); in getEventIndex()
/frameworks/base/services/tests/servicestests/src/com/android/server/people/data/
DEventHistoryImplTest.java58 private static final EventIndex.Injector EVENT_INDEX_INJECTOR = new EventIndex.Injector() {
67 EventIndex createEventIndex() {
68 return new EventIndex(EVENT_INDEX_INJECTOR);
99 EventIndex eventIndex = mEventHistory.getEventIndex(Event.ALL_EVENT_TYPES); in testNoEvents()
113 EventIndex eventIndex = mEventHistory.getEventIndex(Event.ALL_EVENT_TYPES); in testMultipleEvents()
127 EventIndex eventIndex = mEventHistory.getEventIndex(Event.NOTIFICATION_EVENT_TYPES); in testQuerySomeEventTypes()
142 EventIndex eventIndex = mEventHistory.getEventIndex(Event.TYPE_SHARE_IMAGE); in testQuerySingleEventType()
163 EventIndex indexBeforePowerOff = mEventHistory.getEventIndex(Event.ALL_EVENT_TYPES); in testPersistenceAndRestoration()
171 EventIndex indexAfterPowerOff = mEventHistory.getEventIndex(Event.ALL_EVENT_TYPES); in testPersistenceAndRestoration()
184 EventIndex indexBeforePowerOff = mEventHistory.getEventIndex(Event.ALL_EVENT_TYPES); in testMimicDevicePowerOff()
[all …]
DEventIndexTest.java44 private EventIndex mEventIndex;
49 mEventIndex = new EventIndex(mInjector); in setUp()
122 EventIndex newIndex = new EventIndex(mEventIndex); in testCopyConstructor()
133 EventIndex a = new EventIndex(mInjector); in combineEventIndexes()
140 EventIndex b = new EventIndex(mInjector); in combineEventIndexes()
144 EventIndex combined = EventIndex.combine(a, b); in combineEventIndexes()
159 private class TestInjector extends EventIndex.Injector {
DAggregateEventHistoryImplTest.java55 private EventIndex.Injector mInjector = new EventIndex.Injector() {
95 EventIndex eventIndex; in testQueryEventIndexForSingleEventType()
112 EventIndex eventIndex; in testQueryEventIndexForMultipleEventTypes()
137 EventIndex createEventIndex() { in createEventIndex()
138 return new EventIndex(mInjector); in createEventIndex()
DUsageStatsQueryHelperTest.java378 private static final EventIndex.Injector EVENT_INDEX_INJECTOR = new EventIndex.Injector() {
387 EventIndex createEventIndex() {
388 return new EventIndex(EVENT_INDEX_INJECTOR);
/frameworks/base/services/tests/servicestests/src/com/android/server/people/prediction/
DSharesheetModelScorerTest.java38 import com.android.server.people.data.EventIndex;
98 private EventIndex mEventIndex1;
100 private EventIndex mEventIndex2;
102 private EventIndex mEventIndex3;
104 private EventIndex mEventIndex4;
106 private EventIndex mEventIndex5;
108 private EventIndex mEventIndex6;
110 private EventIndex mEventIndex7;
112 private EventIndex mEventIndex8;
114 private EventIndex mEventIndex9;
[all …]
DShareTargetPredictorTest.java53 import com.android.server.people.data.EventIndex;
101 @Mock private EventIndex mEventIndex1;
102 @Mock private EventIndex mEventIndex2;
103 @Mock private EventIndex mEventIndex3;
104 @Mock private EventIndex mEventIndex4;
105 @Mock private EventIndex mEventIndex5;
106 @Mock private EventIndex mEventIndex6;
/frameworks/base/core/proto/android/server/
Dpeopleservice.proto100 // Index of events' time distributions (com.android.server.people.data.EventIndex).