Pass component name into SuggestionFeatureProvider

So that the provider can be used for more than one suggestion.

Test: Robolectric test for implementation of the provider
Bug: 62039057
Change-Id: Ibea41ea6d98e67c55ec157556675e854f3ea31c4
This commit is contained in:
Maurice Lam
2017-05-24 17:51:06 -07:00
parent ee991f4956
commit 7551c80bc8
3 changed files with 14 additions and 8 deletions

View File

@@ -16,7 +16,9 @@
package com.android.settings.dashboard.suggestions;
import android.content.ComponentName;
import android.content.Context;
import android.support.annotation.NonNull;
import com.android.settingslib.drawer.Tile;
import com.android.settingslib.suggestions.SuggestionParser;
@@ -31,11 +33,11 @@ public interface SuggestionFeatureProvider {
*/
boolean isSmartSuggestionEnabled(Context context);
/** Return true if className is the name of a class of one of your newly added suggestion. */
boolean isPresent(String className);
/** Return true if {@code suggestion} is managed by this provider. */
boolean isPresent(@NonNull ComponentName suggestion);
/** Return true if the suggestion has already been completed and does not need to be shown */
boolean isSuggestionCompleted(Context context);
boolean isSuggestionCompleted(Context context, @NonNull ComponentName suggestion);
/**
* Ranks the list of suggestions in place.