Merge "Adds helper methods in SearchUiManager and OnboardingPrefs." into tm-dev

This commit is contained in:
TreeHugger Robot
2022-06-03 20:10:27 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 7 deletions
@@ -68,4 +68,9 @@ public interface SearchUiManager {
/** Refresh the currently displayed list of results. */
default void refreshResults() {}
/** Returns whether search is in zero state. */
default boolean inZeroState() {
return false;
}
}
@@ -142,16 +142,11 @@ public class OnboardingPrefs<T extends ActivityContext> {
}
/**
* Add "incCountBy" to the given event count, if we haven't already reached the max count.
* Sets the event count to the given value.
*
* @return Whether we have now reached the max count.
*/
public boolean incrementEventCountBy(int incCountBy, @EventCountKey String eventKey) {
int count = getCount(eventKey);
if (hasReachedMaxCount(count, eventKey)) {
return true;
}
count += incCountBy;
public boolean setEventCount(int count, @EventCountKey String eventKey) {
mSharedPrefs.edit().putInt(eventKey, count).apply();
return hasReachedMaxCount(count, eventKey);
}