Add directBoot support. Fixes #917

This commit is contained in:
Beqa Gozalishvili
2022-10-17 17:32:39 +04:00
parent 0ecdd33d18
commit f7f66429a3
10 changed files with 89 additions and 15 deletions
@@ -1,4 +1,5 @@
/*
* Copyright (C) 2022 Beka Gozalishvili
* Copyright (C) 2013 Reece H. Dunn
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,6 +21,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.preference.DialogPreference;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
@@ -113,6 +115,8 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
String text = Integer.toString(mProgress);
callChangeListener(text);
if (shouldCommit()) {
PreferenceManager preferenceManager = getPreferenceManager();
preferenceManager.setStorageDeviceProtected ();
SharedPreferences.Editor editor = getEditor();
editor.putString(getKey(), text);
editor.commit();