Repository: flutter
Issue: [camera] [android] Camera flash remains lit after taking a picture.
Labels: e: device-specific,platform-android,p: camera,package,has reproducible steps,P3,found in release: 2.8,found in release: 2.10,team-android,triaged-android

### Description
Once the camera flash is triggered by taking a photo (FlashMode auto or always), it will not turn off again. The flash LED stays lit like a torch, even when taking another picture with FlashMode.off.
It will stay lit untill you manually trigger something that turns it off.

Some ways of manually turning off the flash:
- First switching to FlashMode.torch and then to FlashMode.off
- Switch to a different camera (e.g front camera)
- Switch to video recording
- Close the app / dispose the widget containing the camera



<details>
  <summary>Video</summary>
  
Screen recording of Samsung Galaxy S20FE, Android 11

https://user-images.githubusercontent.com/11444698/151714431-1eaf33d4-a91e-4007-8fbb-eaef6e68c493.mp4

</details>

### Reproduction

I noticed this in a private project, but it is easy to replicate in the [camera example](https://github.com/flutter/plugins/tree/main/packages/camera/camera/example).

Setup:
- Flutter 2.8.1
- camera: 0.9.4+9
- [Camera example commit 72dff1b](https://github.com/flutter/plugins/tree/72dff1b4342676f3b4b6fc9a7fb810140dcf7477/packages/camera/camera/example)


1. Select FlashMode.always or FlashMode.auto (in a dark environment) using the flash buttons.
2. Take a picture with the camera button
3. The flash will now stay lit.

#### Expected result
The flash LED turns on for a short duration to brighten for the photo being taken.

#### Actual result
The flash turns on (likely too late for the photo being taken) and then stays lit. It will remain lit for future photos, even with FlashMode set to off.


### Devices
These were the devices I had around to test with. The S20FE was tested both before and after the Android 12 update, which did not make a difference.

| Device  | version  | affected |
| ------------ | ------------ | ------------ |
| Galaxy S20FE (SM G780G)  | Android 11  | yes|
| Galaxy S20FE (SM G780G)  | Android 12  | yes|
| Nokia 8.1  | Android 11  | yes|
| Galaxy Xcover 5  |  Android 11 | no |
| Galaxy S8 (SMG950F)  |  Android 9 | no |
| Galaxy J5 (SMJ500FN) |  Android 6.0.1 | no |
| WileyFox Swift  |  Android 7.1.2 | no |

[Update] Devices mentioned in the comments
| Device  | version  | affected |
| ------------ | ------------ | ------------ |
| Xiaomi k20 pro | Android 11 | yes |
| Pixel 4a | Android 12 | yes |
| Galaxy A52 5G | Android 12 | yes|

#### Log
<details>
  <summary>Flutter doctor -v</summary>

```
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19044.1466], locale en-NL)
    • Flutter version 2.8.1 at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1)
    • Android SDK at C:\Users\XXXXX\AppData\Local\Android\sdk
    • Platform android-31, build-tools 32.0.0-rc1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.63.2)
    • VS Code at C:\Users\XXXXX\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.32.0

[√] VS Code, 64-bit edition
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.32.0

[√] Connected device (3 available)
    • SM G780G (mobile) • RF8R8021WSR • android-arm64  • Android 11 (API 30)
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 94.0.4606.81
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 87.0.664.75

• No issues found!
```
</details>