Merge "Disable AOD when accessibility color inversion is on." into oc-dr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
861b35e1df
@@ -94,8 +94,8 @@ public class AmbientDisplayConfiguration {
|
||||
}
|
||||
|
||||
public boolean alwaysOnEnabled(int user) {
|
||||
return boolSettingDefaultOn(Settings.Secure.DOZE_ALWAYS_ON, user)
|
||||
&& alwaysOnAvailable();
|
||||
return boolSettingDefaultOn(Settings.Secure.DOZE_ALWAYS_ON, user) && alwaysOnAvailable()
|
||||
&& !accessibilityInversionEnabled(user);
|
||||
}
|
||||
|
||||
public boolean alwaysOnAvailable() {
|
||||
@@ -103,10 +103,18 @@ public class AmbientDisplayConfiguration {
|
||||
&& ambientDisplayAvailable();
|
||||
}
|
||||
|
||||
public boolean alwaysOnAvailableForUser(int user) {
|
||||
return alwaysOnAvailable() && !accessibilityInversionEnabled(user);
|
||||
}
|
||||
|
||||
public String ambientDisplayComponent() {
|
||||
return mContext.getResources().getString(R.string.config_dozeComponent);
|
||||
}
|
||||
|
||||
private boolean accessibilityInversionEnabled(int user) {
|
||||
return boolSettingDefaultOff(Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, user);
|
||||
}
|
||||
|
||||
private boolean ambientDisplayAvailable() {
|
||||
return !TextUtils.isEmpty(ambientDisplayComponent());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user