From a3fed85a0fe37acab8b5bbaa4702cf8b3a0fdd57 Mon Sep 17 00:00:00 2001 From: Vachounet Date: Fri, 19 Feb 2021 12:14:15 +0100 Subject: [PATCH] MotoActions: TorchAction: register custom torch callback * Actually callback is not registered and never triggered. When user enabled torch with power long press or with qs tile and then do the gesture to disable it (or the other way around), he will have to do the gesture twice since boolean has not been updated. Change-Id: I03e88b6975300943fbeaf536fdf8552b9e3b3396 --- .../src/org/lineageos/settings/device/actions/TorchAction.java | 1 + 1 file changed, 1 insertion(+) diff --git a/MotoActions/src/org/lineageos/settings/device/actions/TorchAction.java b/MotoActions/src/org/lineageos/settings/device/actions/TorchAction.java index 824d5d3..d1d824a 100644 --- a/MotoActions/src/org/lineageos/settings/device/actions/TorchAction.java +++ b/MotoActions/src/org/lineageos/settings/device/actions/TorchAction.java @@ -38,6 +38,7 @@ public class TorchAction implements SensorAction { public TorchAction(Context mContext) { mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE); + mCameraManager.registerTorchCallback(new MyTorchCallback(), null); mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE); try { for (final String cameraId : mCameraManager.getCameraIdList()) { -- 2.20.1