summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Keith <javelinanddart@gmail.com>2019-01-18 16:31:04 +0100
committerPaul Keith <javelinanddart@gmail.com>2019-01-18 17:31:13 +0100
commit5fc1e4bb282d5d5591d7d5f1dd177e790d07a9b2 (patch)
tree8ca2311ca6932d62547c07e24f5b569940f87a0c
parentf703684d7c6efe33f683227db173aed961b99371 (diff)
downloadandroid_hardware_lineage_lineagehw-5fc1e4bb282d5d5591d7d5f1dd177e790d07a9b2.tar.gz
android_hardware_lineage_lineagehw-5fc1e4bb282d5d5591d7d5f1dd177e790d07a9b2.tar.bz2
android_hardware_lineage_lineagehw-5fc1e4bb282d5d5591d7d5f1dd177e790d07a9b2.zip
lineagehw: Remove reference to HIDL stuff
* HIDL compat will be handled in the SDK instead * While we're at it, cleanup styling for some stuff Change-Id: I5fd37a8cac0b24f6539de6a7a24f567330e5abe2
-rw-r--r--Android.bp1
-rw-r--r--src/org/lineageos/hardware/AdaptiveBacklight.java21
-rw-r--r--src/org/lineageos/hardware/ColorBalance.java19
-rw-r--r--src/org/lineageos/hardware/DisplayModeControl.java40
-rw-r--r--src/org/lineageos/hardware/KeyDisabler.java16
-rw-r--r--src/org/lineageos/hardware/LiveDisplayVendorImpl.java392
-rw-r--r--src/org/lineageos/hardware/PictureAdjustment.java30
-rw-r--r--src/org/lineageos/hardware/SunlightEnhancement.java22
-rw-r--r--src/org/lineageos/hardware/TouchscreenGestures.java2
-rw-r--r--src/org/lineageos/hardware/TouchscreenHovering.java13
-rw-r--r--src/org/lineageos/hardware/Utils.java68
11 files changed, 32 insertions, 592 deletions
diff --git a/Android.bp b/Android.bp
index dd27f2e..40f20d6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -17,7 +17,6 @@
java_library {
name: "org.lineageos.hardware",
srcs: ["src//**/*.java"],
- static_libs: ["vendor.lineage.livedisplay-V1.0-java"],
libs: [
"org.lineageos.platform.internal",
diff --git a/src/org/lineageos/hardware/AdaptiveBacklight.java b/src/org/lineageos/hardware/AdaptiveBacklight.java
index c3d027a..1a78c6d 100644
--- a/src/org/lineageos/hardware/AdaptiveBacklight.java
+++ b/src/org/lineageos/hardware/AdaptiveBacklight.java
@@ -20,7 +20,6 @@ package org.lineageos.hardware;
import android.util.Log;
import org.lineageos.internal.util.FileUtils;
-import vendor.lineage.livedisplay.V1_0.Feature;
/**
* Adaptive backlight support (this refers to technologies like NVIDIA SmartDimmer,
@@ -32,19 +31,12 @@ public class AdaptiveBacklight {
private static final String FILE_CABC = "/sys/class/graphics/fb0/cabc";
- private static final boolean sHasNativeSupport =
- LiveDisplayVendorImpl.getInstance().hasNativeFeature(Feature.ADAPTIVE_BACKLIGHT);
-
/**
* Whether device supports an adaptive backlight technology.
*
* @return boolean Supported devices must return always true
*/
public static boolean isSupported() {
- if (sHasNativeSupport) {
- return true;
- }
-
return FileUtils.isFileReadable(FILE_CABC) && FileUtils.isFileWritable(FILE_CABC);
}
@@ -55,15 +47,7 @@ public class AdaptiveBacklight {
* the operation failed while reading the status; true in any other case.
*/
public static boolean isEnabled() {
- try {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().isAdaptiveBacklightEnabled();
- }
- return Integer.parseInt(FileUtils.readOneLine(FILE_CABC)) > 0;
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return false;
+ return Integer.parseInt(FileUtils.readOneLine(FILE_CABC)) > 0;
}
/**
@@ -74,9 +58,6 @@ public class AdaptiveBacklight {
* failed; true in any other case.
*/
public static boolean setEnabled(boolean status) {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().setAdaptiveBacklightEnabled(status);
- }
return FileUtils.writeLine(FILE_CABC, status ? "1" : "0");
}
}
diff --git a/src/org/lineageos/hardware/ColorBalance.java b/src/org/lineageos/hardware/ColorBalance.java
index 3260bfa..714983e 100644
--- a/src/org/lineageos/hardware/ColorBalance.java
+++ b/src/org/lineageos/hardware/ColorBalance.java
@@ -17,8 +17,6 @@
package org.lineageos.hardware;
-import vendor.lineage.livedisplay.V1_0.Feature;
-
/**
* Color balance support
*
@@ -29,16 +27,13 @@ import vendor.lineage.livedisplay.V1_0.Feature;
*/
public class ColorBalance {
- private static final boolean sHasNativeSupport =
- LiveDisplayVendorImpl.getInstance().hasNativeFeature(Feature.COLOR_BALANCE);
-
/**
* Whether device supports color balance control
*
* @return boolean Supported devices must return always true
*/
public static boolean isSupported() {
- return sHasNativeSupport;
+ return false;
}
/**
@@ -48,9 +43,6 @@ public class ColorBalance {
* towards warmer temperatures, positive values move towards cooler temperatures.
*/
public static int getValue() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getColorBalance();
- }
return 0;
}
@@ -62,9 +54,6 @@ public class ColorBalance {
* failed; true in any other case.
*/
public static boolean setValue(int value) {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().setColorBalance(value);
- }
return false;
}
@@ -73,9 +62,6 @@ public class ColorBalance {
* @return int
*/
public static int getMinValue() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getColorBalanceRange().getLower();
- }
return 0;
}
@@ -84,9 +70,6 @@ public class ColorBalance {
* @return int
*/
public static int getMaxValue() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getColorBalanceRange().getUpper();
- }
return 0;
}
}
diff --git a/src/org/lineageos/hardware/DisplayModeControl.java b/src/org/lineageos/hardware/DisplayModeControl.java
index ecb271a..fe6e0e3 100644
--- a/src/org/lineageos/hardware/DisplayModeControl.java
+++ b/src/org/lineageos/hardware/DisplayModeControl.java
@@ -17,12 +17,9 @@
package org.lineageos.hardware;
-import android.util.Log;
-
import lineageos.hardware.DisplayMode;
-import vendor.lineage.livedisplay.V1_0.Feature;
-/*
+/**
* Display Modes API
*
* A device may implement a list of preset display modes for different
@@ -36,18 +33,15 @@ import vendor.lineage.livedisplay.V1_0.Feature;
public class DisplayModeControl {
- private static final boolean sHasNativeSupport =
- LiveDisplayVendorImpl.getInstance().hasNativeFeature(Feature.DISPLAY_MODES);
-
- /*
+ /**
* All HAF classes should export this boolean.
* Real implementations must, of course, return true
*/
public static boolean isSupported() {
- return sHasNativeSupport;
+ return false;
}
- /*
+ /**
* Get the list of available modes. A mode has an integer
* identifier and a string name.
*
@@ -55,44 +49,32 @@ public class DisplayModeControl {
* map the name to a human-readable format or perform translation.
*/
public static DisplayMode[] getAvailableModes() {
- if (!sHasNativeSupport) {
- return new DisplayMode[0];
- }
- return LiveDisplayVendorImpl.getInstance().getDisplayModes();
+ return new DisplayMode[0];
}
- /*
+ /**
* Get the name of the currently selected mode. This can return
* null if no mode is selected.
*/
public static DisplayMode getCurrentMode() {
- if (!sHasNativeSupport) {
- return null;
- }
- return LiveDisplayVendorImpl.getInstance().getCurrentDisplayMode();
+ return null;
}
- /*
+ /**
* Selects a mode from the list of available modes by it's
* string identifier. Returns true on success, false for
* failure. It is up to the implementation to determine
* if this mode is valid.
*/
public static boolean setMode(DisplayMode mode, boolean makeDefault) {
- if (!sHasNativeSupport) {
- return false;
- }
- return LiveDisplayVendorImpl.getInstance().setDisplayMode(mode, makeDefault);
+ return false;
}
- /*
+ /**
* Gets the preferred default mode for this device by it's
* string identifier. Can return null if there is no default.
*/
public static DisplayMode getDefaultMode() {
- if (!sHasNativeSupport) {
- return null;
- }
- return LiveDisplayVendorImpl.getInstance().getDefaultDisplayMode();
+ return null;
}
}
diff --git a/src/org/lineageos/hardware/KeyDisabler.java b/src/org/lineageos/hardware/KeyDisabler.java
index 3d7baa2..fab93b6 100644
--- a/src/org/lineageos/hardware/KeyDisabler.java
+++ b/src/org/lineageos/hardware/KeyDisabler.java
@@ -16,7 +16,7 @@
package org.lineageos.hardware;
-/*
+/**
* Disable capacitive keys
*
* This is intended for use on devices in which the capacitive keys
@@ -27,27 +27,25 @@ package org.lineageos.hardware;
public class KeyDisabler {
- /*
+ /**
* All HAF classes should export this boolean.
* Real implementations must, of course, return true
*/
+ public static boolean isSupported() {
+ return false;
+ }
- public static boolean isSupported() { return false; }
-
- /*
+ /**
* Are the keys currently blocked?
*/
-
public static boolean isActive() {
return false;
}
- /*
+ /**
* Disable capacitive keys
*/
-
public static boolean setActive(boolean state) {
throw new UnsupportedOperationException();
}
-
}
diff --git a/src/org/lineageos/hardware/LiveDisplayVendorImpl.java b/src/org/lineageos/hardware/LiveDisplayVendorImpl.java
deleted file mode 100644
index 680d1c0..0000000
--- a/src/org/lineageos/hardware/LiveDisplayVendorImpl.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright (C) 2015 The CyanogenMod Project
- * Copyright (C) 2018 The LineageOS Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.lineageos.hardware;
-
-import android.os.IHwBinder.DeathRecipient;
-import android.os.RemoteException;
-import android.util.Log;
-import android.util.Range;
-import com.android.internal.annotations.GuardedBy;
-
-import lineageos.hardware.DisplayMode;
-import lineageos.hardware.HSIC;
-import vendor.lineage.livedisplay.V1_0.IColor;
-
-/**
- * This class loads an implementation of the LiveDisplay native interface.
- */
-public class LiveDisplayVendorImpl {
-
- private static final String TAG = "LiveDisplayVendorImpl";
-
- @GuardedBy("this")
- private IColor mDaemon;
- private int mFeatures;
-
- private LiveDisplayVendorImpl() {}
-
- private static class LiveDisplayVendorImplHolder {
- private static final LiveDisplayVendorImpl instance = new LiveDisplayVendorImpl();
- }
-
- public static LiveDisplayVendorImpl getInstance() {
- return LiveDisplayVendorImplHolder.instance;
- }
-
- private synchronized IColor getColorService() {
- if (mDaemon == null) {
- Log.v(TAG, "mDaemon was null, reconnect to LiveDisplay IColor");
- try {
- mDaemon = IColor.getService();
- } catch (java.util.NoSuchElementException e) {
- // Service doesn't exist or cannot be opened. Logged below.
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to get LiveDisplay IColor interface", e);
- }
- if (mDaemon == null) {
- Log.w(TAG, "LiveDisplay IColor HIDL not available");
- return null;
- }
-
- mDaemon.asBinder().linkToDeath(new DeathRecipient() {
- @Override
- public void serviceDied(long cookie) {
- Log.e(TAG, "LiveDisplay IColor HAL died");
- reset();
- }
- }, 0);
- }
- return mDaemon;
- }
-
- private void reset() {
- mFeatures = 0;
- synchronized (this) {
- mDaemon = null;
- }
- }
-
- public boolean hasNativeFeature(int feature) {
- if (mFeatures == 0) {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "hasNativeFeature: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- mFeatures = daemon.getSupportedFeatures();
- Log.i(TAG, "Using LiveDisplay IColor backend (features: " + mFeatures + ")");
- } catch (RemoteException e) {
- Log.e(TAG, "hasNativeFeature failed", e);
- reset();
- return false;
- }
- }
- Log.d(TAG, "hasNativeFeature: mFeatures=" + Integer.toString(mFeatures));
- return (mFeatures & feature) != 0;
- }
-
- public DisplayMode[] getDisplayModes() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getDisplayModes: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.HIDLModeListToArray(daemon.getDisplayModes());
- } catch (RemoteException e) {
- Log.e(TAG, "getDisplayModes failed", e);
- reset();
- }
- return null;
- }
-
- public DisplayMode getCurrentDisplayMode() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getCurrentDisplayMode: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- DisplayMode mode = Utils.fromHIDLMode(daemon.getCurrentDisplayMode());
- // mode.id is -1 means it's invalid.
- return mode.id == -1 ? null : mode;
- } catch (RemoteException e) {
- Log.e(TAG, "getDisplayModes failed", e);
- reset();
- }
- return null;
- }
-
- public DisplayMode getDefaultDisplayMode() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getDefaultDisplayMode: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- DisplayMode mode = Utils.fromHIDLMode(daemon.getDefaultDisplayMode());
- // mode.id is -1 means it's invalid.
- return mode.id == -1 ? null : mode;
- } catch (RemoteException e) {
- Log.e(TAG, "getDefaultDisplayMode failed", e);
- reset();
- }
- return null;
- }
-
- public boolean setDisplayMode(DisplayMode mode, boolean makeDefault) {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "setDisplayMode: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- return daemon.setDisplayMode(mode.id, makeDefault);
- } catch (RemoteException e) {
- Log.e(TAG, "setDisplayMode failed", e);
- reset();
- }
- return false;
- }
-
- public boolean setAdaptiveBacklightEnabled(boolean enabled) {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "setAdaptiveBacklightEnabled: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- return daemon.setAdaptiveBacklightEnabled(enabled);
- } catch (RemoteException e) {
- Log.e(TAG, "setAdaptiveBacklightEnabled failed", e);
- reset();
- }
- return false;
- }
-
- public boolean isAdaptiveBacklightEnabled() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "isAdaptiveBacklightEnabled: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- return daemon.isAdaptiveBacklightEnabled();
- } catch (RemoteException e) {
- Log.e(TAG, "isAdaptiveBacklightEnabled failed", e);
- reset();
- }
- return false;
- }
-
- public boolean setOutdoorModeEnabled(boolean enabled) {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "setOutdoorModeEnabled: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- return daemon.setOutdoorModeEnabled(enabled);
- } catch (RemoteException e) {
- Log.e(TAG, "setOutdoorModeEnabled failed", e);
- reset();
- }
- return false;
- }
-
- public boolean isOutdoorModeEnabled() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "isOutdoorModeEnabled: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- return daemon.isOutdoorModeEnabled();
- } catch (RemoteException e) {
- Log.e(TAG, "isOutdoorModeEnabled failed", e);
- reset();
- }
- return false;
- }
-
- public Range<Integer> getColorBalanceRange() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getColorBalanceRange: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLRange(daemon.getColorBalanceRange());
- } catch (RemoteException e) {
- Log.e(TAG, "getColorBalanceRange failed", e);
- reset();
- }
- return null;
- }
-
- public int getColorBalance() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getColorBalance: no LiveDisplay IColor HAL!");
- return 0;
- }
- try {
- return daemon.getColorBalance();
- } catch (RemoteException e) {
- Log.e(TAG, "getColorBalance failed", e);
- reset();
- }
- return 0;
- }
-
- public boolean setColorBalance(int value) {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "setColorBalance: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- return daemon.setColorBalance(value);
- } catch (RemoteException e) {
- Log.e(TAG, "setColorBalance failed", e);
- reset();
- }
- return false;
- }
-
- public boolean setPictureAdjustment(final HSIC hsic) {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "setPictureAdjustment: no LiveDisplay IColor HAL!");
- return false;
- }
- try {
- return daemon.setPictureAdjustment(Utils.toHIDLHSIC(hsic));
- } catch (RemoteException e) {
- Log.e(TAG, "setPictureAdjustment failed", e);
- reset();
- }
- return false;
- }
-
- public HSIC getPictureAdjustment() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getPictureAdjustment: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLHSIC(daemon.getPictureAdjustment());
- } catch (RemoteException e) {
- Log.e(TAG, "getPictureAdjustment failed", e);
- reset();
- }
- return null;
- }
-
- public HSIC getDefaultPictureAdjustment() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getDefaultPictureAdjustment: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLHSIC(daemon.getDefaultPictureAdjustment());
- } catch (RemoteException e) {
- Log.e(TAG, "getDefaultPictureAdjustment failed", e);
- reset();
- }
- return null;
- }
-
- public Range<Float> getHueRange() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getHueRange: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLIntRange(daemon.getHueRange());
- } catch (RemoteException e) {
- Log.e(TAG, "getHueRange failed", e);
- reset();
- }
- return null;
- }
-
- public Range<Float> getSaturationRange() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getSaturationRange: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLRange(daemon.getSaturationRange());
- } catch (RemoteException e) {
- Log.e(TAG, "getSaturationRange failed", e);
- reset();
- }
- return null;
- }
-
- public Range<Float> getIntensityRange() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getIntensityRange: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLRange(daemon.getIntensityRange());
- } catch (RemoteException e) {
- Log.e(TAG, "getIntensityRange failed", e);
- reset();
- }
- return null;
- }
-
- public Range<Float> getContrastRange() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getContrastRange: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLRange(daemon.getContrastRange());
- } catch (RemoteException e) {
- Log.e(TAG, "getContrastRange failed", e);
- reset();
- }
- return null;
- }
-
- public Range<Float> getSaturationThresholdRange() {
- IColor daemon = getColorService();
- if (daemon == null) {
- Log.e(TAG, "getSaturationThresholdRange: no LiveDisplay IColor HAL!");
- return null;
- }
- try {
- return Utils.fromHIDLRange(daemon.getSaturationThresholdRange());
- } catch (RemoteException e) {
- Log.e(TAG, "getSaturationThresholdRange failed", e);
- reset();
- }
- return null;
- }
-}
diff --git a/src/org/lineageos/hardware/PictureAdjustment.java b/src/org/lineageos/hardware/PictureAdjustment.java
index da2b68e..cf778c5 100644
--- a/src/org/lineageos/hardware/PictureAdjustment.java
+++ b/src/org/lineageos/hardware/PictureAdjustment.java
@@ -20,7 +20,6 @@ package org.lineageos.hardware;
import android.util.Range;
import lineageos.hardware.HSIC;
-import vendor.lineage.livedisplay.V1_0.Feature;
/**
* Picture adjustment support
@@ -30,16 +29,13 @@ import vendor.lineage.livedisplay.V1_0.Feature;
*/
public class PictureAdjustment {
- private static final boolean sHasNativeSupport =
- LiveDisplayVendorImpl.getInstance().hasNativeFeature(Feature.PICTURE_ADJUSTMENT);
-
/**
* Whether device supports picture adjustment
*
* @return boolean Supported devices must return always true
*/
public static boolean isSupported() {
- return sHasNativeSupport;
+ return false;
}
/**
@@ -49,9 +45,6 @@ public class PictureAdjustment {
* @return the HSIC object or null if not supported
*/
public static HSIC getHSIC() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getPictureAdjustment();
- }
return null;
}
@@ -64,9 +57,6 @@ public class PictureAdjustment {
* @return the HSIC object or null if not supported
*/
public static HSIC getDefaultHSIC() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getDefaultPictureAdjustment();
- }
return null;
}
@@ -78,9 +68,6 @@ public class PictureAdjustment {
* failed; true in any other case.
*/
public static boolean setHSIC(final HSIC hsic) {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().setPictureAdjustment(hsic);
- }
return false;
}
@@ -89,9 +76,6 @@ public class PictureAdjustment {
* @return range of floats
*/
public static Range<Float> getHueRange() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getHueRange();
- }
return new Range(0.0f, 0.0f);
}
@@ -100,9 +84,6 @@ public class PictureAdjustment {
* @return range of floats
*/
public static Range<Float> getSaturationRange() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getSaturationRange();
- }
return new Range(0.0f, 0.0f);
}
@@ -111,9 +92,6 @@ public class PictureAdjustment {
* @return range of floats
*/
public static Range<Float> getIntensityRange() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getIntensityRange();
- }
return new Range(0.0f, 0.0f);
}
@@ -122,9 +100,6 @@ public class PictureAdjustment {
* @return range of floats
*/
public static Range<Float> getContrastRange() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getContrastRange();
- }
return new Range(0.0f, 0.0f);
}
@@ -136,9 +111,6 @@ public class PictureAdjustment {
* @return range of floats
*/
public static Range<Float> getSaturationThresholdRange() {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().getSaturationThresholdRange();
- }
return new Range(0.0f, 0.0f);
}
}
diff --git a/src/org/lineageos/hardware/SunlightEnhancement.java b/src/org/lineageos/hardware/SunlightEnhancement.java
index 413deb9..9a1578b 100644
--- a/src/org/lineageos/hardware/SunlightEnhancement.java
+++ b/src/org/lineageos/hardware/SunlightEnhancement.java
@@ -20,7 +20,6 @@ package org.lineageos.hardware;
import android.util.Log;
import org.lineageos.internal.util.FileUtils;
-import vendor.lineage.livedisplay.V1_0.Feature;
/**
* Facemelt mode!
@@ -35,9 +34,6 @@ public class SunlightEnhancement {
private static final String FILE_HBM = "/sys/class/graphics/fb0/hbm";
private static final String FILE_SRE = "/sys/class/graphics/fb0/sre";
- private static final boolean sHasNativeSupport =
- LiveDisplayVendorImpl.getInstance().hasNativeFeature(Feature.OUTDOOR_MODE);
-
private static String getFacemeltPath() {
if (FileUtils.fileExists(FILE_HBM)) {
return FILE_HBM;
@@ -60,10 +56,6 @@ public class SunlightEnhancement {
* @return boolean Supported devices must return always true
*/
public static boolean isSupported() {
- if (sHasNativeSupport) {
- return true;
- }
-
return FileUtils.isFileReadable(FACEMELT_PATH) && FileUtils.isFileWritable(FACEMELT_PATH);
}
@@ -74,15 +66,7 @@ public class SunlightEnhancement {
* or the operation failed while reading the status; true in any other case.
*/
public static boolean isEnabled() {
- try {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().isOutdoorModeEnabled();
- }
- return Integer.parseInt(FileUtils.readOneLine(FACEMELT_PATH)) > 0;
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return false;
+ return Integer.parseInt(FileUtils.readOneLine(FACEMELT_PATH)) > 0;
}
/**
@@ -93,10 +77,6 @@ public class SunlightEnhancement {
* failed; true in any other case.
*/
public static boolean setEnabled(boolean status) {
- if (sHasNativeSupport) {
- return LiveDisplayVendorImpl.getInstance().setOutdoorModeEnabled(status);
- }
-
return FileUtils.writeLine(FACEMELT_PATH, status ? FACEMELT_MODE : "0");
}
diff --git a/src/org/lineageos/hardware/TouchscreenGestures.java b/src/org/lineageos/hardware/TouchscreenGestures.java
index 1256255..3110eef 100644
--- a/src/org/lineageos/hardware/TouchscreenGestures.java
+++ b/src/org/lineageos/hardware/TouchscreenGestures.java
@@ -44,7 +44,7 @@ public class TouchscreenGestures {
return false;
}
- /*
+ /**
* Get the list of available gestures. A mode has an integer
* identifier and a string name.
*
diff --git a/src/org/lineageos/hardware/TouchscreenHovering.java b/src/org/lineageos/hardware/TouchscreenHovering.java
index 53cade5..2f147b8 100644
--- a/src/org/lineageos/hardware/TouchscreenHovering.java
+++ b/src/org/lineageos/hardware/TouchscreenHovering.java
@@ -28,7 +28,9 @@ public class TouchscreenHovering {
*
* @return boolean Supported devices must return always true
*/
- public static boolean isSupported() { return false; }
+ public static boolean isSupported() {
+ return false;
+ }
/**
* This method return the current activation status of touchscreen hovering
@@ -36,7 +38,9 @@ public class TouchscreenHovering {
* @return boolean Must be false if touchscreen hovering is not supported or not activated,
* or the operation failed while reading the status; true in any other case.
*/
- public static boolean isEnabled() { return false; }
+ public static boolean isEnabled() {
+ return false;
+ }
/**
* This method allows to setup touchscreen hovering status.
@@ -45,6 +49,7 @@ public class TouchscreenHovering {
* @return boolean Must be false if touchscreen hovering is not supported or the operation
* failed; true in any other case.
*/
- public static boolean setEnabled(boolean status) { return false; }
-
+ public static boolean setEnabled(boolean status) {
+ return false;
+ }
}
diff --git a/src/org/lineageos/hardware/Utils.java b/src/org/lineageos/hardware/Utils.java
deleted file mode 100644
index 68db903..0000000
--- a/src/org/lineageos/hardware/Utils.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2018 The LineageOS Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.lineageos.hardware;
-
-import android.util.Range;
-
-import lineageos.hardware.DisplayMode;
-import lineageos.hardware.HSIC;
-
-import java.util.ArrayList;
-
-class Utils {
- public static DisplayMode[] HIDLModeListToArray(
- ArrayList<vendor.lineage.livedisplay.V1_0.DisplayMode> modes) {
- int size = modes.size();
- DisplayMode[] r = new DisplayMode[size];
- for (int i = 0; i < size; i++) {
- vendor.lineage.livedisplay.V1_0.DisplayMode m = modes.get(i);
- r[i] = new DisplayMode(m.id, m.name);
- }
- return r;
- }
-
- public static DisplayMode fromHIDLMode(vendor.lineage.livedisplay.V1_0.DisplayMode mode) {
- return new DisplayMode(mode.id, mode.name);
- }
-
- public static HSIC fromHIDLHSIC(vendor.lineage.livedisplay.V1_0.HSIC hsic) {
- return new HSIC((float) hsic.hue, hsic.saturation, hsic.intensity,
- hsic.contrast, hsic.saturationThreshold);
- }
-
- public static vendor.lineage.livedisplay.V1_0.HSIC toHIDLHSIC(HSIC hsic) {
- vendor.lineage.livedisplay.V1_0.HSIC h = new vendor.lineage.livedisplay.V1_0.HSIC();
- h.hue = (int) hsic.getHue();
- h.saturation = hsic.getSaturation();
- h.intensity = hsic.getIntensity();
- h.contrast = hsic.getContrast();
- h.saturationThreshold = hsic.getSaturationThreshold();
- return h;
- }
-
- public static Range<Integer> fromHIDLRange(vendor.lineage.livedisplay.V1_0.Range range) {
- return new Range(range.min, range.max);
- }
-
- public static Range<Float> fromHIDLIntRange(vendor.lineage.livedisplay.V1_0.Range range) {
- return new Range((float) range.min, (float) range.max);
- }
-
- public static Range<Float> fromHIDLRange(vendor.lineage.livedisplay.V1_0.FloatRange range) {
- return new Range(range.min, range.max);
- }
-}