Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +23 −6 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,7 @@ import kotlin.Unit; import kotlinx.coroutines.CoroutineScope; import kotlinx.coroutines.CoroutineScope; import java.io.File; import java.io.FileWriter; import java.io.FileWriter; import java.io.IOException; import java.io.IOException; import java.io.PrintWriter; import java.io.PrintWriter; Loading Loading @@ -259,7 +260,8 @@ public class UdfpsController implements DozeReceiver, Dumpable { } } private void writeToUdfpsNode(String path, String value) { private void writeToUdfpsNode(String path, String value) { mBiometricExecutor.execute(() -> { if (isFileWritable(path)) { try (FileWriter writer = new FileWriter(path)) { try (FileWriter writer = new FileWriter(path)) { writer.write(value); writer.write(value); Log.d(TAG, "Successfully set " + path + " to " + value); Log.d(TAG, "Successfully set " + path + " to " + value); Loading @@ -267,6 +269,21 @@ public class UdfpsController implements DozeReceiver, Dumpable { Log.e(TAG, "Failed to write to " + path, e); Log.e(TAG, "Failed to write to " + path, e); } } } } }); } private boolean isFileWritable(String path) { File file = new File(path); if (!file.exists()) { Log.e(TAG, "File does not exist: " + path); return false; } if (!file.canWrite()) { Log.e(TAG, "File is not writable: " + path); return false; } return true; } @VisibleForTesting @VisibleForTesting public static final VibrationAttributes UDFPS_VIBRATION_ATTRIBUTES = public static final VibrationAttributes UDFPS_VIBRATION_ATTRIBUTES = Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +23 −6 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,7 @@ import kotlin.Unit; import kotlinx.coroutines.CoroutineScope; import kotlinx.coroutines.CoroutineScope; import java.io.File; import java.io.FileWriter; import java.io.FileWriter; import java.io.IOException; import java.io.IOException; import java.io.PrintWriter; import java.io.PrintWriter; Loading Loading @@ -259,7 +260,8 @@ public class UdfpsController implements DozeReceiver, Dumpable { } } private void writeToUdfpsNode(String path, String value) { private void writeToUdfpsNode(String path, String value) { mBiometricExecutor.execute(() -> { if (isFileWritable(path)) { try (FileWriter writer = new FileWriter(path)) { try (FileWriter writer = new FileWriter(path)) { writer.write(value); writer.write(value); Log.d(TAG, "Successfully set " + path + " to " + value); Log.d(TAG, "Successfully set " + path + " to " + value); Loading @@ -267,6 +269,21 @@ public class UdfpsController implements DozeReceiver, Dumpable { Log.e(TAG, "Failed to write to " + path, e); Log.e(TAG, "Failed to write to " + path, e); } } } } }); } private boolean isFileWritable(String path) { File file = new File(path); if (!file.exists()) { Log.e(TAG, "File does not exist: " + path); return false; } if (!file.canWrite()) { Log.e(TAG, "File is not writable: " + path); return false; } return true; } @VisibleForTesting @VisibleForTesting public static final VibrationAttributes UDFPS_VIBRATION_ATTRIBUTES = public static final VibrationAttributes UDFPS_VIBRATION_ATTRIBUTES = Loading