|
|
@ -89,6 +89,7 @@ public class FragmentOptionsEncryption extends FragmentBase
|
|
|
|
private SwitchCompat swEncryptAuto;
|
|
|
|
private SwitchCompat swEncryptAuto;
|
|
|
|
private SwitchCompat swAutoDecrypt;
|
|
|
|
private SwitchCompat swAutoDecrypt;
|
|
|
|
private SwitchCompat swAutoUndoDecrypt;
|
|
|
|
private SwitchCompat swAutoUndoDecrypt;
|
|
|
|
|
|
|
|
private Button btnReset;
|
|
|
|
|
|
|
|
|
|
|
|
private Spinner spOpenPgp;
|
|
|
|
private Spinner spOpenPgp;
|
|
|
|
private ImageButton ibOpenKeychain;
|
|
|
|
private ImageButton ibOpenKeychain;
|
|
|
@ -140,6 +141,7 @@ public class FragmentOptionsEncryption extends FragmentBase
|
|
|
|
swEncryptAuto = view.findViewById(R.id.swEncryptAuto);
|
|
|
|
swEncryptAuto = view.findViewById(R.id.swEncryptAuto);
|
|
|
|
swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt);
|
|
|
|
swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt);
|
|
|
|
swAutoUndoDecrypt = view.findViewById(R.id.swAutoUndoDecrypt);
|
|
|
|
swAutoUndoDecrypt = view.findViewById(R.id.swAutoUndoDecrypt);
|
|
|
|
|
|
|
|
btnReset = view.findViewById(R.id.btnReset);
|
|
|
|
|
|
|
|
|
|
|
|
spOpenPgp = view.findViewById(R.id.spOpenPgp);
|
|
|
|
spOpenPgp = view.findViewById(R.id.spOpenPgp);
|
|
|
|
ibOpenKeychain = view.findViewById(R.id.ibOpenKeychain);
|
|
|
|
ibOpenKeychain = view.findViewById(R.id.ibOpenKeychain);
|
|
|
@ -237,6 +239,30 @@ public class FragmentOptionsEncryption extends FragmentBase
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
btnReset.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
|
|
|
db.identity().clearIdentitySignKeyAliases();
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
ToastEx.makeText(v.getContext(), R.string.title_completed, Toast.LENGTH_LONG).show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.execute(FragmentOptionsEncryption.this, new Bundle(), "encryption:reset");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// PGP
|
|
|
|
// PGP
|
|
|
|
|
|
|
|
|
|
|
|
spOpenPgp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
spOpenPgp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|