protected void onCreate(Bundle savedInstanceState) { | protected void onCreate(Bundle savedInstanceState) { | ||||
super.onCreate(savedInstanceState); | super.onCreate(savedInstanceState); | ||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected (); | |||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | |||||
{ | |||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected (); | |||||
} | |||||
// Migrate old eyes-free settings to the new settings: | // Migrate old eyes-free settings to the new settings: | ||||
storageContext = EspeakApp.getStorageContext(); | storageContext = EspeakApp.getStorageContext(); |
import android.content.Context; | import android.content.Context; | ||||
import android.content.DialogInterface; | import android.content.DialogInterface; | ||||
import android.content.SharedPreferences; | import android.content.SharedPreferences; | ||||
import android.os.Bundle; | |||||
import android.preference.DialogPreference; | import android.preference.DialogPreference; | ||||
import android.preference.PreferenceManager; | import android.preference.PreferenceManager; | ||||
import android.util.AttributeSet; | import android.util.AttributeSet; | ||||
String text = Integer.toString(mProgress); | String text = Integer.toString(mProgress); | ||||
callChangeListener(text); | callChangeListener(text); | ||||
if (shouldCommit()) { | if (shouldCommit()) { | ||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected (); | |||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | |||||
{ | |||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected (); | |||||
} | |||||
SharedPreferences.Editor editor = getEditor(); | SharedPreferences.Editor editor = getEditor(); | ||||
editor.putString(getKey(), text); | editor.putString(getKey(), text); | ||||
editor.commit(); | editor.commit(); |
import android.content.Context; | import android.content.Context; | ||||
import android.content.DialogInterface; | import android.content.DialogInterface; | ||||
import android.content.SharedPreferences; | import android.content.SharedPreferences; | ||||
import android.os.Bundle; | |||||
import android.preference.DialogPreference; | import android.preference.DialogPreference; | ||||
import android.preference.PreferenceManager; | import android.preference.PreferenceManager; | ||||
import android.text.Editable; | import android.text.Editable; | ||||
onDataChanged(level, characters); | onDataChanged(level, characters); | ||||
if (shouldCommit()) { | if (shouldCommit()) { | ||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected(); | |||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | |||||
{ | |||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected (); | |||||
} | |||||
SharedPreferences.Editor editor = getEditor(); | SharedPreferences.Editor editor = getEditor(); | ||||
if (editor != null) { | if (editor != null) { | ||||
editor.putString(VoiceSettings.PREF_PUNCTUATION_CHARACTERS, characters); | editor.putString(VoiceSettings.PREF_PUNCTUATION_CHARACTERS, characters); |
import android.content.Context; | import android.content.Context; | ||||
import android.content.DialogInterface; | import android.content.DialogInterface; | ||||
import android.content.SharedPreferences; | import android.content.SharedPreferences; | ||||
import android.os.Bundle; | |||||
import android.preference.DialogPreference; | import android.preference.DialogPreference; | ||||
import android.preference.PreferenceManager; | import android.preference.PreferenceManager; | ||||
import android.util.AttributeSet; | import android.util.AttributeSet; | ||||
case DialogInterface.BUTTON_POSITIVE: | case DialogInterface.BUTTON_POSITIVE: | ||||
onDataChanged(); | onDataChanged(); | ||||
if (shouldCommit()) { | if (shouldCommit()) { | ||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected(); | |||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | |||||
{ | |||||
PreferenceManager preferenceManager = getPreferenceManager(); | |||||
preferenceManager.setStorageDeviceProtected (); | |||||
} | |||||
SharedPreferences.Editor editor = getEditor(); | SharedPreferences.Editor editor = getEditor(); | ||||
if (editor != null) { | if (editor != null) { | ||||
VoiceVariant variant = variants[mCategoryIndex][mVariantIndex].getVariant(); | VoiceVariant variant = variants[mCategoryIndex][mVariantIndex].getVariant(); |