Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 143889bb authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "SystemUI: Fix couldn't connect to camera when Flashlight is on"

parents 1898cc57 f42790e8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        filter.addAction(Intent.ACTION_SCREEN_ON);
        // receive broadcast from SnapdragonCamera
        filter.addAction(FlashlightController.ACTION_CLOSE_FLASHLIGHT);
        if (DEBUG_MEDIA_FAKE_ARTWORK) {
            filter.addAction("fake_artwork");
        }
@@ -3286,6 +3288,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                if (DEBUG_MEDIA_FAKE_ARTWORK) {
                    updateMediaMetaData(true);
                }
            } else if (FlashlightController.ACTION_CLOSE_FLASHLIGHT.equals(action)) {
                Bundle bundle = intent.getExtras();
                if (bundle != null) {
                    if (bundle.getBoolean("camera_led", false))
                        mFlashlightController.killFlashlight();
                }
            }
        }
    };
+3 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ public class FlashlightController {
    private static final int DISPATCH_OFF = 1;
    private static final int DISPATCH_AVAILABILITY_CHANGED = 2;

    public static final String ACTION_CLOSE_FLASHLIGHT =
            "org.codeaurora.snapcam.action.CLOSE_FLASHLIGHT";

    private final CameraManager mCameraManager;
    /** Call {@link #ensureHandler()} before using */
    private Handler mHandler;