mirror of
https://gitlab.com/openlp/android.git
synced 2024-12-22 03:42:48 +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.content.Context;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
import com.loopj.android.http.AsyncHttpClient;
|
||||
import com.loopj.android.http.TextHttpResponseHandler;
|
||||
import org.apache.http.Header;
|
||||
import org.openlp.android2.R;
|
||||
import org.openlp.android2.api.Api;
|
||||
|
||||
|
||||
@ -38,7 +40,7 @@ abstract public class OpenLPDialog extends DialogFragment {
|
||||
private static AsyncHttpClient client = new AsyncHttpClient();
|
||||
|
||||
protected void populateDisplay(String responseString) {}
|
||||
protected void processUpdate(String responseString) {}
|
||||
protected void processUpdate(String responseString) {}
|
||||
protected void errorDisplay(int statusCode, String responseString) {}
|
||||
|
||||
protected void triggerTextRequest(String url) {
|
||||
@ -54,6 +56,11 @@ abstract public class OpenLPDialog extends DialogFragment {
|
||||
@Override
|
||||
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
|
@ -96,8 +96,8 @@ public class AlertDisplayDialog extends OpenLPDialog {
|
||||
}
|
||||
|
||||
private void triggerRequest(String url) {
|
||||
ExecuteHttpRequestTask task = new ExecuteHttpRequestTask();
|
||||
task.execute(new String[]{url});
|
||||
//ExecuteHttpRequestTask task = new ExecuteHttpRequestTask();
|
||||
//task.execute(new String[]{url});
|
||||
}
|
||||
|
||||
public void populateDisplay(OpenLPHttpReturn response) {
|
||||
|
@ -153,6 +153,5 @@ public class BlankDisplayDialog extends OpenLPDialog {
|
||||
theme.setEnabled(false);
|
||||
desktop.setEnabled(false);
|
||||
reset.setEnabled(false);
|
||||
Toast.makeText(context, R.string.unable, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user