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

Commit 9205276c authored by Mark Harman's avatar Mark Harman
Browse files

Fix crash for devices with no antibanding, should remove from preferences!

parent c45054b8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@
<pre>
Version 1.43.1 (Work in progress)

FIXED   Crash when selecting antibanding setting on devices with no support for antibanding; this
        option is now removed on such devices.
FIXED   Fixed some crashes.

Version 1.43 (2018/04/10)
+9 −0
Original line number Diff line number Diff line
@@ -109,13 +109,22 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
		//readFromBundle(bundle, "isos", Preview.getISOPreferenceKey(), "auto", "preference_category_camera_effects");
		//readFromBundle(bundle, "exposures", "preference_exposure", "0", "preference_category_camera_effects");

		boolean has_antibanding = false;
		String [] antibanding_values = bundle.getStringArray("antibanding");
		if( antibanding_values != null && antibanding_values.length > 0 ) {
			String [] antibanding_entries = bundle.getStringArray("antibanding_entries");
			if( antibanding_entries != null && antibanding_entries.length == antibanding_values.length ) { // should always be true here, but just in case
				readFromBundle(antibanding_values, antibanding_entries, PreferenceKeys.AntiBandingPreferenceKey, CameraController.ANTIBANDING_DEFAULT, "preference_category_camera_quality");
				has_antibanding = true;
			}
		}
		if( MyDebug.LOG )
			Log.d(TAG, "has_antibanding?: " + has_antibanding);
		if( !has_antibanding ) {
			Preference pref = findPreference("preference_antibanding");
			PreferenceGroup pg = (PreferenceGroup)this.findPreference("preference_category_camera_quality");
        	pg.removePreference(pref);
		}

		final boolean supports_face_detection = bundle.getBoolean("supports_face_detection");
		if( MyDebug.LOG )
+1 −0
Original line number Diff line number Diff line
@@ -855,6 +855,7 @@
		    
	    </PreferenceScreen>

        <!--  if we move this to another PreferenceGroup, we should update code for the findPreference() call -->
        <!--  if we move this to another PreferenceGroup, we should update code for the readFromIntent() call -->
	    <ListPreference
	        android:key="preference_antibanding"