Add SuggestionFeatureProvider interface.
The interface is added so that a vendor can add new suggestions to the settings app, and customize details for these suggestions. Test: make RunSettingsRoboTests BUG: 34219298 Change-Id: I373c63709b1aaf68360aa2561a2ecfc3194e0e2b
This commit is contained in:
@@ -26,4 +26,10 @@ 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 the suggestion has already been completed and does not need to be shown */
|
||||
boolean isSuggestionCompleted(Context context);
|
||||
|
||||
}
|
@@ -25,4 +25,14 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPresent(String className) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuggestionCompleted(Context context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ import com.android.settings.Settings.WifiCallingSuggestionActivity;
|
||||
import com.android.settings.Settings.ZenModeAutomationSuggestionActivity;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.WallpaperSuggestionActivity;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.drawer.Tile;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -67,6 +68,13 @@ public class SuggestionsChecks {
|
||||
} else if (className.equals(FingerprintEnrollSuggestionActivity.class.getName())) {
|
||||
return isDeviceSecured() || !isFingerprintEnabled();
|
||||
}
|
||||
|
||||
SuggestionFeatureProvider provider =
|
||||
FeatureFactory.getFactory(mContext).getSuggestionFeatureProvider();
|
||||
if (provider != null && provider.isPresent(className)) {
|
||||
return provider.isSuggestionCompleted(mContext);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user