Add a friendly error message when no video traffic is received

This commit is contained in:
Cameron Gutman
2020-05-01 21:54:26 -07:00
parent ce9e91153e
commit 15aa7ecc2e
4 changed files with 19 additions and 3 deletions

View File

@@ -1538,9 +1538,21 @@ public class Game extends Activity implements SurfaceHolder.Callback,
// Display the error dialog if it was an unexpected termination.
// Otherwise, just finish the activity immediately.
if (errorCode != 0) {
if (errorCode != MoonBridge.ML_ERROR_GRACEFUL_TERMINATION) {
String message;
switch (errorCode) {
case MoonBridge.ML_ERROR_NO_VIDEO_TRAFFIC:
message = getResources().getString(R.string.no_video_received_error);
break;
default:
message = getResources().getString(R.string.conn_terminated_msg);
break;
}
Dialog.displayDialog(Game.this, getResources().getString(R.string.conn_terminated_title),
getResources().getString(R.string.conn_terminated_msg), true);
message, true);
}
else {
finish();