diff options
Diffstat (limited to 'sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java')
-rw-r--r-- | sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java b/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java index 5a39a98..cfe904f 100644 --- a/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java +++ b/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java @@ -20,6 +20,11 @@ import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; +import android.util.Range; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import cyanogenmod.app.CMContextConstants; @@ -109,10 +114,21 @@ public class LiveDisplayManager { */ public static final int FEATURE_COLOR_BALANCE = 16; + /** + * System supports manual hue/saturation/intensity/contrast + * adjustment of display. + */ + public static final int FEATURE_PICTURE_ADJUSTMENT = 17; + + public static final int ADJUSTMENT_HUE = 0; + public static final int ADJUSTMENT_SATURATION = 1; + public static final int ADJUSTMENT_INTENSITY = 2; + public static final int ADJUSTMENT_CONTRAST = 3; + /** @hide */ public static final int FEATURE_FIRST = FEATURE_CABC; /** @hide */ - public static final int FEATURE_LAST = FEATURE_COLOR_BALANCE; + public static final int FEATURE_LAST = FEATURE_PICTURE_ADJUSTMENT; private static final String TAG = "LiveDisplay"; @@ -422,4 +438,48 @@ public class LiveDisplayManager { return false; } } + + /** + * Gets the current picture adjustment settings (hue, saturation, intensity, contrast) + * + * @return HSIC object with current settings + */ + public HSIC getPictureAdjustment() { + try { + if (checkService()) { + return sService.getPictureAdjustment(); + } + } catch (RemoteException e) { + } + return null; + } + + /** + * Sets a new picture adjustment + * + * @param hsic + * @return true if success + */ + public boolean setPictureAdjustment(final HSIC hsic) { + try { + return checkService() && sService.setPictureAdjustment(hsic); + } catch (RemoteException e) { + } + return false; + } + + /** + * Gets the default picture adjustment for the current display mode + * + * @return HSIC object with default values + */ + public HSIC getDefaultPictureAdjustment() { + try { + if (checkService()) { + return sService.getDefaultPictureAdjustment(); + } + } catch (RemoteException e) { + } + return null; + } } |