From b45fb35b0fb0d270593e6cc68ddcad56a16f59d8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Sep 2016 11:41:48 +0200 Subject: [PATCH] convert context to local variable --- .../com/simplemobiletools/flashlight/MarshmallowCamera.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/flashlight/MarshmallowCamera.java b/app/src/main/java/com/simplemobiletools/flashlight/MarshmallowCamera.java index 85c0855..0832ca0 100644 --- a/app/src/main/java/com/simplemobiletools/flashlight/MarshmallowCamera.java +++ b/app/src/main/java/com/simplemobiletools/flashlight/MarshmallowCamera.java @@ -12,14 +12,12 @@ import com.squareup.otto.Bus; class MarshmallowCamera { private static final String TAG = MyCameraImpl.class.getSimpleName(); - private Context mContext; private CameraManager manager; private String cameraId; @TargetApi(Build.VERSION_CODES.M) - MarshmallowCamera(Context cxt) { - mContext = cxt; - manager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE); + MarshmallowCamera(Context context) { + manager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE); try { final String[] list = manager.getCameraIdList(); cameraId = list[0];