|
|
|
@ -2424,8 +2424,8 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
if (ex instanceof IllegalStateException) {
|
|
|
|
|
Snackbar snackbar = Snackbar.make(view, new ThrowableWrapper(ex).getSafeMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
Snackbar snackbar = Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, new ThrowableWrapper(ex).getSafeMessage(), Snackbar.LENGTH_LONG));
|
|
|
|
|
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -2436,8 +2436,9 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
});
|
|
|
|
|
snackbar.show();
|
|
|
|
|
} else if (ex instanceof IllegalArgumentException)
|
|
|
|
|
Snackbar.make(view, new ThrowableWrapper(ex).getSafeMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, new ThrowableWrapper(ex).getSafeMessage(), Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
else
|
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
|
}
|
|
|
|
@ -3749,8 +3750,9 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
if (ex instanceof IllegalArgumentException)
|
|
|
|
|
Snackbar.make(view, new ThrowableWrapper(ex).getSafeMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, new ThrowableWrapper(ex).getSafeMessage(), Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
else
|
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
|
}
|
|
|
|
@ -4177,8 +4179,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
protected void onExecuted(Bundle args, List<EntityAnswer> answers) {
|
|
|
|
|
final Context context = getContext();
|
|
|
|
|
if (answers == null || answers.size() == 0) {
|
|
|
|
|
Snackbar snackbar = Snackbar.make(view, R.string.title_no_answers, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_no_answers, Snackbar.LENGTH_LONG));
|
|
|
|
|
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -5635,8 +5636,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
if (!redmi_note)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view, R.string.app_data_loss, Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.app_data_loss, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -5666,10 +5666,9 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
if (AlarmManagerCompatEx.canScheduleExactAlarms(context))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view,
|
|
|
|
|
R.string.title_setup_alarm_12,
|
|
|
|
|
Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view,
|
|
|
|
|
R.string.title_setup_alarm_12,
|
|
|
|
|
Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -5691,8 +5690,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
prefs.getBoolean("crash_reports_asked", false))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view, R.string.title_ask_help, Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_ask_help, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -5739,8 +5737,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view, R.string.title_ask_review, Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_ask_review, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -5767,8 +5764,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
if (prefs.getBoolean("third_party_notified", false))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view, R.string.title_third_party, Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_third_party, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -5846,8 +5842,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
final int resid = (passwd > 0
|
|
|
|
|
? R.string.title_check_gmail_password
|
|
|
|
|
: R.string.title_check_gmail_oauth);
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view, resid, Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, resid, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -5936,8 +5931,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
final int resid = (passwd > 0
|
|
|
|
|
? R.string.title_check_outlook_password
|
|
|
|
|
: R.string.title_check_outlook_oauth);
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view, resid, Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, resid, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -7259,8 +7253,8 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
|
|
|
if (ex instanceof IllegalStateException) {
|
|
|
|
|
// No internet connection
|
|
|
|
|
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
Snackbar snackbar = Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG));
|
|
|
|
|
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -8193,8 +8187,9 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
if (ex instanceof IllegalArgumentException)
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
else
|
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
|
}
|
|
|
|
@ -8851,8 +8846,8 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
Helper.openAdvanced(context, create);
|
|
|
|
|
PackageManager pm = context.getPackageManager();
|
|
|
|
|
if (create.resolveActivity(pm) == null) // system whitelisted
|
|
|
|
|
Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
else
|
|
|
|
|
startActivityForResult(Helper.getChooser(context, create), REQUEST_RAW);
|
|
|
|
|
}
|
|
|
|
@ -8910,8 +8905,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onNothingSelected() {
|
|
|
|
|
Snackbar snackbar = Snackbar.make(view, R.string.title_no_key, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_no_key, Snackbar.LENGTH_LONG));
|
|
|
|
|
final Intent intent = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R
|
|
|
|
|
? KeyChain.createInstallIntent()
|
|
|
|
|
: new Intent(Settings.ACTION_SECURITY_SETTINGS));
|
|
|
|
@ -9156,15 +9150,16 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
Snackbar.make(view, R.string.title_raw_saved, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_raw_saved, Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
if (ex instanceof IllegalArgumentException || ex instanceof FileNotFoundException)
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
else if (!(ex instanceof MessageRemovedException))
|
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
|
}
|
|
|
|
@ -9495,8 +9490,8 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
protected void onExecuted(Bundle args, PendingIntent pi) {
|
|
|
|
|
if (args.containsKey("sigresult")) {
|
|
|
|
|
String text = args.getString("sigresult");
|
|
|
|
|
Snackbar sb = Snackbar.make(view, text, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
Snackbar sb = Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, text, Snackbar.LENGTH_LONG));
|
|
|
|
|
Helper.setSnackbarLines(sb, 7);
|
|
|
|
|
sb.show();
|
|
|
|
|
}
|
|
|
|
@ -9523,11 +9518,11 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
|
|
|
|
|
if (ex instanceof IllegalArgumentException) {
|
|
|
|
|
Log.i(ex);
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
} else if (ex instanceof OperationCanceledException) {
|
|
|
|
|
Snackbar snackbar = Snackbar.make(view, R.string.title_no_openpgp, Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_no_openpgp, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -9906,8 +9901,9 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
message = getString(R.string.title_signature_invalid);
|
|
|
|
|
else
|
|
|
|
|
message = getString(R.string.title_signature_invalid_reason, reason);
|
|
|
|
|
Snackbar.make(view, message, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, message, Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
} else
|
|
|
|
|
try {
|
|
|
|
|
boolean auto = args.getBoolean("auto");
|
|
|
|
@ -9932,8 +9928,8 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (known && !record.isExpired(time) && match && valid)
|
|
|
|
|
Snackbar.make(view, R.string.title_signature_valid, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_signature_valid, Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
else if (!auto) {
|
|
|
|
|
LayoutInflater inflator = LayoutInflater.from(getContext());
|
|
|
|
|
View dview = inflator.inflate(R.layout.dialog_certificate, null);
|
|
|
|
@ -10043,14 +10039,16 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
builder.show();
|
|
|
|
|
}
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Snackbar.make(view, Log.formatThrowable(ex), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, Log.formatThrowable(ex), Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
}
|
|
|
|
|
} else if (EntityMessage.SMIME_SIGNENCRYPT.equals(type)) {
|
|
|
|
|
String algo = args.getString("algo");
|
|
|
|
|
if (!TextUtils.isEmpty(algo))
|
|
|
|
|
Snackbar.make(view, algo, Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, algo, Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -10062,8 +10060,9 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
|
|
|
|
|
if (ex instanceof IllegalArgumentException ||
|
|
|
|
|
ex instanceof CMSException || ex instanceof KeyChainException)
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
|
|
|
|
|
.setGestureInsetBottomIgnored(true).show();
|
|
|
|
|
Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG))
|
|
|
|
|
.show();
|
|
|
|
|
else
|
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
|
}
|
|
|
|
@ -10444,8 +10443,8 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
if (ex instanceof IllegalArgumentException) {
|
|
|
|
|
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE)
|
|
|
|
|
.setGestureInsetBottomIgnored(true);
|
|
|
|
|
Snackbar snackbar = Helper.setSnackbarOptions(
|
|
|
|
|
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE));
|
|
|
|
|
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|