Improve Night Light suggestion criterion

Night Light suggestion will now show even if the user is using Night
Light in manual mode. If the user has previously tapped or dismissed the
suggestion, the suggestion will not show again.

Bug: 68938869
Test: make ROBOTEST_FILTER=\
"(NightDisplayPreferenceControllerTest|SuggestionFeatureProviderImplTest)" \
RunSettingsRoboTests

Change-Id: Iea838df043d75dfa73a1a383275dc42956374113
This commit is contained in:
Sean Stout
2018-02-01 18:01:05 -08:00
parent 9dc3f74ccf
commit 2ae92b541d
4 changed files with 68 additions and 50 deletions

View File

@@ -28,6 +28,11 @@ public class NightDisplayPreferenceController extends AbstractPreferenceControll
super(context);
}
public static boolean isSuggestionComplete(Context context) {
final ColorDisplayController controller = new ColorDisplayController(context);
return controller.getAutoMode() != ColorDisplayController.AUTO_MODE_DISABLED;
}
@Override
public boolean isAvailable() {
return ColorDisplayController.isAvailable(mContext);