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

Commit a0357152 authored by Mark Harman's avatar Mark Harman
Browse files

Fix crash when fragment is being recreated; also fix when video subtitles is enabled/disabled.

parent 19f09a75
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -47,6 +47,11 @@
<p>&lt; <small><a href="index.html">Main Page.</a></small></p>

<pre>
Version 1.53.1 (2024/06/03)

FIXED   Bug in 1.53 where video subtitles option was incorrectly disabled when SAF enabled, also
        fixed a related crash when recreating fragment.

Version 1.53 (2024/05/28)

FIXED   Device specific crashes when starting with Camera2 API (related to camera vendor
+15 −4
Original line number Diff line number Diff line
@@ -210,13 +210,24 @@ public class PreferenceSubVideo extends PreferenceSubScreen {
            // a dependency (and indeed can't use one, as the preference_using_saf won't exist here as a Preference)
            pref = (ListPreference)findPreference("preference_video_subtitle");
            if( pref != null ) {
                boolean using_saf = false;
                // n.b., not safe to call main_activity.getApplicationInterface().getStorageUtils().isUsingSAF() if fragment
                // is being recreated
                if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ) {
                    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this.getActivity());
                    if( sharedPreferences.getBoolean(PreferenceKeys.UsingSAFPreferenceKey, false) ) {
                        using_saf = true;
                    }
                }
                if( MyDebug.LOG )
                    Log.d(TAG, "using_saf: " + using_saf);

                //pref.setDependency("preference_using_saf");
                MainActivity main_activity = (MainActivity)this.getActivity();
				if( main_activity.getStorageUtils().isUsingSAF() ) {
                    pref.setEnabled(false);
                if( using_saf ) {
                    pref.setEnabled(true);
                }
                else {
                    pref.setEnabled(true);
                    pref.setEnabled(false);
                }
            }
        }