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

Commit 1632bbc8 authored by Mark Harman's avatar Mark Harman
Browse files

Fix Google Play crash due to null scene modes.

parent 5f7d8ae7
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1812,6 +1812,8 @@ public class CameraController2 extends CameraController {
		int [] values2 = characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES);
		boolean has_disabled = false;
		List<String> values = new ArrayList<>();
		if( values2 != null ) {
			// CONTROL_AVAILABLE_SCENE_MODES is supposed to always be available, but have had some (rare) crashes from Google Play due to being null
			for(int value2 : values2) {
				if( value2 == CameraMetadata.CONTROL_SCENE_MODE_DISABLED )
					has_disabled = true;
@@ -1820,6 +1822,7 @@ public class CameraController2 extends CameraController {
					values.add(this_value);
				}
			}
		}
		if( !has_disabled ) {
			values.add(0, SCENE_MODE_DEFAULT);
		}