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
This commit is contained in:
parent
bcfceddbd8
commit
a3fed85a0f
@ -38,6 +38,7 @@ public class TorchAction implements SensorAction {
|
|||||||
|
|
||||||
public TorchAction(Context mContext) {
|
public TorchAction(Context mContext) {
|
||||||
mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
|
mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
|
||||||
|
mCameraManager.registerTorchCallback(new MyTorchCallback(), null);
|
||||||
mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
|
mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
try {
|
try {
|
||||||
for (final String cameraId : mCameraManager.getCameraIdList()) {
|
for (final String cameraId : mCameraManager.getCameraIdList()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user