@@ -87,6 +87,7 @@ public class PreferencesFragment extends PreferenceFragmentCompat {
87
87
private static final int CODE_BACKUPS = 8 ;
88
88
89
89
private Intent _result ;
90
+ private AegisApplication _app ;
90
91
private Preferences _prefs ;
91
92
private VaultManager _vault ;
92
93
@@ -112,9 +113,9 @@ public class PreferencesFragment extends PreferenceFragmentCompat {
112
113
public void onCreatePreferences (Bundle savedInstanceState , String rootKey ) {
113
114
addPreferencesFromResource (R .xml .preferences );
114
115
115
- AegisApplication app = (AegisApplication ) getActivity ().getApplication ();
116
- _prefs = app .getPreferences ();
117
- _vault = app .getVaultManager ();
116
+ _app = (AegisApplication ) getActivity ().getApplication ();
117
+ _prefs = _app .getPreferences ();
118
+ _vault = _app .getVaultManager ();
118
119
119
120
// set the result intent in advance
120
121
setResult (new Intent ());
@@ -190,6 +191,8 @@ public boolean onPreferenceClick(Preference preference) {
190
191
191
192
Intent intent = new Intent (Intent .ACTION_GET_CONTENT );
192
193
intent .setType ("*/*" );
194
+
195
+ _app .setBlockAutoLock (true );
193
196
startActivityForResult (intent , CODE_IMPORT );
194
197
});
195
198
return true ;
@@ -282,14 +285,14 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
282
285
});
283
286
284
287
Preference tapToRevealTimePreference = findPreference ("pref_tap_to_reveal_time" );
285
- tapToRevealTimePreference .setSummary (app .getPreferences ().getTapToRevealTime () + " seconds" );
288
+ tapToRevealTimePreference .setSummary (_app .getPreferences ().getTapToRevealTime () + " seconds" );
286
289
tapToRevealTimePreference .setOnPreferenceClickListener (new Preference .OnPreferenceClickListener () {
287
290
@ Override
288
291
public boolean onPreferenceClick (Preference preference ) {
289
292
Dialogs .showNumberPickerDialog (getActivity (), new Dialogs .NumberInputListener () {
290
293
@ Override
291
294
public void onNumberInputResult (int number ) {
292
- app .getPreferences ().setTapToRevealTime (number );
295
+ _app .getPreferences ().setTapToRevealTime (number );
293
296
tapToRevealTimePreference .setSummary (number + " seconds" );
294
297
_result .putExtra ("needsRefresh" , true );
295
298
}
@@ -735,6 +738,7 @@ public void onNothingSelected(AdapterView<?> parent) {
735
738
.setType (getExportMimeType (requestCode ))
736
739
.putExtra (Intent .EXTRA_TITLE , fileInfo .toString ());
737
740
741
+ _app .setBlockAutoLock (true );
738
742
startActivityForResult (intent , requestCode );
739
743
});
740
744
@@ -771,6 +775,8 @@ public void onNothingSelected(AdapterView<?> parent) {
771
775
.setType (getExportMimeType (requestCode ))
772
776
.putExtra (Intent .EXTRA_STREAM , uri );
773
777
Intent chooser = Intent .createChooser (intent , getString (R .string .pref_export_summary ));
778
+
779
+ _app .setBlockAutoLock (true );
774
780
startActivity (chooser );
775
781
});
776
782
});
@@ -1014,6 +1020,7 @@ private void selectBackupsLocation() {
1014
1020
| Intent .FLAG_GRANT_PERSISTABLE_URI_PERMISSION
1015
1021
| Intent .FLAG_GRANT_PREFIX_URI_PERMISSION );
1016
1022
1023
+ _app .setBlockAutoLock (true );
1017
1024
startActivityForResult (intent , CODE_BACKUPS );
1018
1025
}
1019
1026
0 commit comments