Ensure only either RBC or even dimmer can be on
Not Both Even dimmer is the successor to RBC, so we shouldn't enable both simultaneously, they are not compatible Bug: 179428400 Test: manual, atest DisplayServiceTests Change-Id: I18d5a9c7418b8141afd4b67d121a96cb50ba5274
This commit is contained in:
@@ -32,6 +32,7 @@ import android.text.TextUtils;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.server.display.feature.flags.Flags;
|
||||
import com.android.settings.R;
|
||||
import com.android.settingslib.PrimarySwitchPreference;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
@@ -88,6 +89,15 @@ public class ReduceBrightColorsPreferenceController
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
// Successor to this feature is Even Dimmer
|
||||
// found in display/EvenDimmerPreferenceController
|
||||
// Only allow RBC if even dimmer is not possible on this device
|
||||
if (Flags.evenDimmer() && mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_evenDimmerEnabled)) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
|
||||
return ColorDisplayManager.isReduceBrightColorsAvailable(mContext) ? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user