sdm845-common: pocketmode: Kill off Lineage SDK dependency

Change-Id: I05f35124be4547b7fbc3ff3aa145bf27600454e4
This commit is contained in:
LuK1337 2019-07-04 11:51:05 +01:00 committed by Bruno Martins
parent eb33fe1abe
commit 77847d96e0
2 changed files with 7 additions and 15 deletions

View File

@ -11,16 +11,6 @@ LOCAL_CERTIFICATE := platform
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_PRIVILEGED_MODULE := true
LOCAL_STATIC_ANDROID_LIBRARIES := \
android-support-v4 \
android-support-v7-appcompat \
android-support-v7-preference \
android-support-v7-recyclerview \
android-support-v14-preference
LOCAL_STATIC_JAVA_LIBRARIES := \
org.lineageos.platform.internal
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* 2017-2018 The LineageOS Project
* 2017-2019 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.
@ -22,10 +22,10 @@ import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.FileUtils;
import android.util.Log;
import org.lineageos.internal.util.FileUtils;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
@ -56,8 +56,10 @@ public class ProximitySensor implements SensorEventListener {
@Override
public void onSensorChanged(SensorEvent event) {
boolean isNear = event.values[0] < mSensor.getMaximumRange();
if (FileUtils.isFileWritable(FP_PROX_NODE)) {
FileUtils.writeLine(FP_PROX_NODE, isNear ? "1" : "0");
try {
FileUtils.stringToFile(FP_PROX_NODE, isNear ? "1" : "0");
} catch (IOException e) {
Log.e(TAG, "Failed to write to " + FP_PROX_NODE, e);
}
}