Search in sources :

Example 1 with ColorDisplayManager

use of android.hardware.display.ColorDisplayManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class NightDisplayPreferenceController method isSuggestionComplete.

public static boolean isSuggestionComplete(Context context) {
    final boolean isEnabled = context.getResources().getBoolean(R.bool.config_night_light_suggestion_enabled);
    // The suggestion is always complete if not enabled.
    if (!isEnabled) {
        return true;
    }
    final ColorDisplayManager manager = context.getSystemService(ColorDisplayManager.class);
    return manager.getNightDisplayAutoMode() != ColorDisplayManager.AUTO_MODE_DISABLED;
}
Also used : ColorDisplayManager(android.hardware.display.ColorDisplayManager)

Example 2 with ColorDisplayManager

use of android.hardware.display.ColorDisplayManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DisplayWhiteBalancePreferenceController method updateVisibility.

@VisibleForTesting
void updateVisibility() {
    if (mPreference != null) {
        ColorDisplayManager cdm = getColorDisplayManager();
        // Display white balance is only valid in linear light space. COLOR_MODE_SATURATED
        // implies unmanaged color mode, and hence unknown color processing conditions.
        // We also disallow display white balance when color accessibility features are enabled.
        mPreference.setVisible(cdm.getColorMode() != ColorDisplayManager.COLOR_MODE_SATURATED && !cdm.areAccessibilityTransformsEnabled(mContext));
    }
}
Also used : ColorDisplayManager(android.hardware.display.ColorDisplayManager) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 3 with ColorDisplayManager

use of android.hardware.display.ColorDisplayManager in project android_packages_apps_Settings by omnirom.

the class DisplayWhiteBalancePreferenceController method updateVisibility.

@VisibleForTesting
void updateVisibility() {
    if (mPreference != null) {
        ColorDisplayManager cdm = getColorDisplayManager();
        // Display white balance is only valid in linear light space. COLOR_MODE_SATURATED
        // implies unmanaged color mode, and hence unknown color processing conditions.
        // We also disallow display white balance when color accessibility features are enabled.
        mPreference.setVisible(cdm.getColorMode() != ColorDisplayManager.COLOR_MODE_SATURATED && !cdm.areAccessibilityTransformsEnabled(mContext));
    }
}
Also used : ColorDisplayManager(android.hardware.display.ColorDisplayManager) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 4 with ColorDisplayManager

use of android.hardware.display.ColorDisplayManager in project android_packages_apps_Settings by omnirom.

the class NightDisplayPreferenceController method isSuggestionComplete.

public static boolean isSuggestionComplete(Context context) {
    final boolean isEnabled = context.getResources().getBoolean(R.bool.config_night_light_suggestion_enabled);
    // The suggestion is always complete if not enabled.
    if (!isEnabled) {
        return true;
    }
    final ColorDisplayManager manager = context.getSystemService(ColorDisplayManager.class);
    return manager.getNightDisplayAutoMode() != ColorDisplayManager.AUTO_MODE_DISABLED;
}
Also used : ColorDisplayManager(android.hardware.display.ColorDisplayManager)

Aggregations

ColorDisplayManager (android.hardware.display.ColorDisplayManager)4 VisibleForTesting (androidx.annotation.VisibleForTesting)2