Handle night display state when timezone changes

Bug: 64458884
Test: make RunSettingsRoboTests -j100

Change-Id: I1f0c073b796aa6826c236757e19c6ff6d5cb7602
This commit is contained in:
Christine Franks
2017-08-25 14:02:42 -07:00
parent 6361c9d851
commit c6c299bdbb
5 changed files with 47 additions and 21 deletions

View File

@@ -161,8 +161,7 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
@VisibleForTesting
boolean hasUsedNightDisplay(Context context) {
final ContentResolver cr = context.getContentResolver();
final long lastActivatedTimeMillis = Secure.getLong(cr,
Secure.NIGHT_DISPLAY_LAST_ACTIVATED_TIME, -1);
return lastActivatedTimeMillis > 0;
return Secure.getInt(cr, Secure.NIGHT_DISPLAY_AUTO_MODE, 0) != 0
|| Secure.getString(cr, Secure.NIGHT_DISPLAY_LAST_ACTIVATED_TIME) != null;
}
}