DeviceParts: enable proximity_state
diff --git a/DeviceParts/src/org/omnirom/device/KeyHandler.java b/DeviceParts/src/org/omnirom/device/KeyHandler.java
index aacded0..6a0dfb7 100644
--- a/DeviceParts/src/org/omnirom/device/KeyHandler.java
+++ b/DeviceParts/src/org/omnirom/device/KeyHandler.java
@@ -98,6 +98,7 @@
     private static final int FP_GESTURE_LONG_PRESS = 188;
 
     private static final String DT2W_CONTROL_PATH = "/sys/devices/platform/soc/c80000.i2c/i2c-4/4-0038/dclick_mode";
+    private static final String GOODIX_CONTROL_PATH = "/sys/devices/platform/soc/soc:goodixfp/proximity_state";
 
     private static final int[] sSupportedGestures = new int[]{
         KEY_GESTURE_C,
@@ -159,6 +160,11 @@
         public void onSensorChanged(SensorEvent event) {
             mProxyIsNear = event.values[0] == 1;
             if (DEBUG_SENSOR) Log.i(TAG, "mProxyIsNear = " + mProxyIsNear + " mProxyWasNear = " + mProxyWasNear);
+            if (mUseProxiCheck) {
+                if (Utils.fileWritable(GOODIX_CONTROL_PATH)) {
+                    Utils.writeValue(GOODIX_CONTROL_PATH, mProxyIsNear ? "1" : "0");
+                }
+            }
             if (mUseWaveCheck || mUsePocketCheck) {
                 if (mProxyWasNear && !mProxyIsNear) {
                     long delta = SystemClock.elapsedRealtime() - mProxySensorTimestamp;
@@ -405,12 +411,19 @@
         if (DEBUG) Log.i(TAG, "Display on");
         if (enableProxiSensor()) {
             mSensorManager.unregisterListener(mProximitySensor, mPocketSensor);
+            enableGoodix();
         }
         if (mUseTiltCheck) {
             mSensorManager.unregisterListener(mTiltSensorListener, mTiltSensor);
         }
     }
 
+    private void enableGoodix() {
+        if (Utils.fileWritable(GOODIX_CONTROL_PATH)) {
+            Utils.writeValue(GOODIX_CONTROL_PATH, "0");
+        }
+    }
+
     private void updateDoubleTapToWake() {
         Log.i(TAG, "udateDoubleTapToWake " + mDoubleTapToWake);
         if (Utils.fileWritable(DT2W_CONTROL_PATH)) {
diff --git a/prebuilt/system/etc/init/init.qcom.rc b/prebuilt/system/etc/init/init.qcom.rc
index ac70ade..dfc506a 100644
--- a/prebuilt/system/etc/init/init.qcom.rc
+++ b/prebuilt/system/etc/init/init.qcom.rc
@@ -41,3 +41,6 @@
 
     chown system system /sys/devices/platform/soc/c80000.i2c/i2c-4/4-0038/dclick_mode
     chmod 0660 /sys/devices/platform/soc/c80000.i2c/i2c-4/4-0038/dclick_mode
+
+    chown system system /sys/devices/platform/soc/soc:goodixfp/proximity_state
+    chmod 0660 /sys/devices/platform/soc/soc:goodixfp/proximity_state