mirror of
https://gitlab.com/openlp/android.git
synced 2024-12-22 20:02:50 +00:00
Clean up Security messages
This commit is contained in:
parent
1efed76680
commit
0b5c570777
@ -22,9 +22,11 @@ package org.openlp.android2.common;
|
|||||||
import android.app.DialogFragment;
|
import android.app.DialogFragment;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
import com.loopj.android.http.AsyncHttpClient;
|
import com.loopj.android.http.AsyncHttpClient;
|
||||||
import com.loopj.android.http.TextHttpResponseHandler;
|
import com.loopj.android.http.TextHttpResponseHandler;
|
||||||
import org.apache.http.Header;
|
import org.apache.http.Header;
|
||||||
|
import org.openlp.android2.R;
|
||||||
import org.openlp.android2.api.Api;
|
import org.openlp.android2.api.Api;
|
||||||
|
|
||||||
|
|
||||||
@ -54,6 +56,11 @@ abstract public class OpenLPDialog extends DialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
|
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
|
||||||
// called when response HTTP status is "4XX" (eg. 401, 403, 404)
|
// called when response HTTP status is "4XX" (eg. 401, 403, 404)
|
||||||
|
if (statusCode == 401) {
|
||||||
|
Toast.makeText(context, R.string.httpreturn_unauthorised, Toast.LENGTH_LONG).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(context, R.string.unable, Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
errorDisplay(statusCode, responseString);
|
errorDisplay(statusCode, responseString);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -96,8 +96,8 @@ public class AlertDisplayDialog extends OpenLPDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void triggerRequest(String url) {
|
private void triggerRequest(String url) {
|
||||||
ExecuteHttpRequestTask task = new ExecuteHttpRequestTask();
|
//ExecuteHttpRequestTask task = new ExecuteHttpRequestTask();
|
||||||
task.execute(new String[]{url});
|
//task.execute(new String[]{url});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void populateDisplay(OpenLPHttpReturn response) {
|
public void populateDisplay(OpenLPHttpReturn response) {
|
||||||
|
@ -153,6 +153,5 @@ public class BlankDisplayDialog extends OpenLPDialog {
|
|||||||
theme.setEnabled(false);
|
theme.setEnabled(false);
|
||||||
desktop.setEnabled(false);
|
desktop.setEnabled(false);
|
||||||
reset.setEnabled(false);
|
reset.setEnabled(false);
|
||||||
Toast.makeText(context, R.string.unable, Toast.LENGTH_LONG).show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user