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

Commit 58bb107f authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Workaround for a database update callback that claims that the data doesn't exist.

It's probably some intermediate state when updating the volumes that's causing
the row to be missing.
parent b49d9af7
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -230,10 +230,14 @@ public class VolumePreference extends SeekBarPreference implements
            @Override
            public void onChange(boolean selfChange) {
                super.onChange(selfChange);
    
                if (mSeekBar != null) {
                    mSeekBar.setProgress(System.getInt(mContext.getContentResolver(),
                            System.VOLUME_SETTINGS[mStreamType], 0));
                    int volume = System.getInt(mContext.getContentResolver(),
                            System.VOLUME_SETTINGS[mStreamType], -1);
                    // Works around an atomicity problem with volume updates
                    // TODO: Fix the actual issue, probably in AudioService
                    if (volume >= 0) {
                        mSeekBar.setProgress(volume);
                    }
                }
            }
        };