Adds helper methods in SearchUiManager and OnboardingPrefs.
Bug: 233656600
Test: With topic change.
Change-Id: I9ddb910e94d389ec682617ce874fff6a2ce703c8
diff --git a/src/com/android/launcher3/allapps/SearchUiManager.java b/src/com/android/launcher3/allapps/SearchUiManager.java
index 6299657..6138bc4 100644
--- a/src/com/android/launcher3/allapps/SearchUiManager.java
+++ b/src/com/android/launcher3/allapps/SearchUiManager.java
@@ -68,4 +68,9 @@
/** Refresh the currently displayed list of results. */
default void refreshResults() {}
+
+ /** Returns whether search is in zero state. */
+ default boolean inZeroState() {
+ return false;
+ }
}
diff --git a/src/com/android/launcher3/util/OnboardingPrefs.java b/src/com/android/launcher3/util/OnboardingPrefs.java
index 64aeceb..f4cf21e 100644
--- a/src/com/android/launcher3/util/OnboardingPrefs.java
+++ b/src/com/android/launcher3/util/OnboardingPrefs.java
@@ -142,16 +142,11 @@
}
/**
- * 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);
}