Skip to content

Commit

Permalink
Merge "Settings: Fix QrCamera crash on devices without flash" am: 68d…
Browse files Browse the repository at this point in the history
…db3a

am: 748ee16

Change-Id: Ic64d2c3a36939751891440639b5114a9df3fd184
  • Loading branch information
luk1337 authored and android-build-merger committed Oct 30, 2019
2 parents 54ef0fc + 748ee16 commit 9a07055
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/com/android/settings/wifi/qrcode/QrCamera.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ private void setCameraParameter() {
Size pictureSize = getBestPictureSize(mParameters);
mParameters.setPreviewSize(pictureSize.getWidth(), pictureSize.getHeight());

if (mParameters.getSupportedFlashModes().contains(Parameters.FLASH_MODE_OFF)) {
final List<String> supportedFlashModes = mParameters.getSupportedFlashModes();
if (supportedFlashModes != null &&
supportedFlashModes.contains(Parameters.FLASH_MODE_OFF)) {
mParameters.setFlashMode(Parameters.FLASH_MODE_OFF);
}

Expand Down

0 comments on commit 9a07055

Please sign in to comment.