Further automating the log submission process for testers
This commit is contained in:
parent
436fd57609
commit
42019289c2
|
@ -60,6 +60,7 @@
|
|||
<string name="app_site">Homepage: http://reicast.com</string>
|
||||
<string name="beta_site">Betas: http://reicast.loungekatt.com</string>
|
||||
<string name="git_api">https://api.github.com/repos/reicast/reicast-emulator/commits</string>
|
||||
<string name="git_issues">https://github.com/reicast/reicast-emulator/issues/</string>
|
||||
|
||||
<string-array name="controllers">
|
||||
<item>Controller A</item>
|
||||
|
|
|
@ -378,12 +378,12 @@ public class ConfigureFragment extends Fragment {
|
|||
Toast.makeText(parentActivity,
|
||||
parentActivity.getString(R.string.platform),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
UploadLogs mUploadLogs = new UploadLogs(parentActivity);
|
||||
GenerateLogs mGenerateLogs = new GenerateLogs(parentActivity);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
mUploadLogs.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
|
||||
mGenerateLogs.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
|
||||
home_directory);
|
||||
} else {
|
||||
mUploadLogs.execute(home_directory);
|
||||
mGenerateLogs.execute(home_directory);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,249 @@
|
|||
package com.reicast.emulator;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.ResponseHandler;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
|
||||
import com.reicast.loungekatt.R;
|
||||
|
||||
public class GenerateLogs extends AsyncTask<String, Integer, String> {
|
||||
|
||||
public static final String build_model = android.os.Build.MODEL;
|
||||
public static final String build_device = android.os.Build.DEVICE;
|
||||
public static final String build_board = android.os.Build.BOARD;
|
||||
public static final int build_sdk = android.os.Build.VERSION.SDK_INT;
|
||||
|
||||
public static final String DN = "Donut";
|
||||
public static final String EC = "Eclair";
|
||||
public static final String FR = "Froyo";
|
||||
public static final String GB = "Gingerbread";
|
||||
public static final String HC = "Honeycomb";
|
||||
public static final String IC = "Ice Cream Sandwich";
|
||||
public static final String JB = "JellyBean";
|
||||
public static final String KK = "KitKat";
|
||||
public static final String NF = "Not Found";
|
||||
|
||||
private String unHandledIOE;
|
||||
|
||||
private Context mContext;
|
||||
private String currentTime;
|
||||
|
||||
public GenerateLogs(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
this.currentTime = String.valueOf(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
protected void onPreExecute() {
|
||||
|
||||
}
|
||||
|
||||
private String discoverCPUData() {
|
||||
String s = "MODEL: " + Build.MODEL;
|
||||
s += "\r\n";
|
||||
s += "DEVICE: " + build_device;
|
||||
s += "\r\n";
|
||||
s += "BOARD: " + build_board;
|
||||
s += "\r\n";
|
||||
if (String.valueOf(build_sdk) != null) {
|
||||
String build_version = NF;
|
||||
if (build_sdk >= 4 && build_sdk < 7) {
|
||||
build_version = DN;
|
||||
} else if (build_sdk == 7) {
|
||||
build_version = EC;
|
||||
} else if (build_sdk == 8) {
|
||||
build_version = FR;
|
||||
} else if (build_sdk >= 9 && build_sdk < 11) {
|
||||
build_version = GB;
|
||||
} else if (build_sdk >= 11 && build_sdk < 14) {
|
||||
build_version = HC;
|
||||
} else if (build_sdk >= 14 && build_sdk < 16) {
|
||||
build_version = IC;
|
||||
} else if (build_sdk >= 16 && build_sdk < 19) {
|
||||
build_version = JB;
|
||||
} else if (build_sdk >= 19) {
|
||||
build_version = KK;
|
||||
}
|
||||
s += build_version + " (" + build_sdk + ")";
|
||||
} else {
|
||||
String prop_build_version = "ro.build.version.release";
|
||||
String prop_sdk_version = "ro.build.version.sdk";
|
||||
String build_version = readOutput("/system/bin/getprop "
|
||||
+ prop_build_version);
|
||||
String sdk_version = readOutput("/system/bin/getprop "
|
||||
+ prop_sdk_version);
|
||||
s += build_version + " (" + sdk_version + ")";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static String readOutput(String command) {
|
||||
try {
|
||||
Process p = Runtime.getRuntime().exec(command);
|
||||
InputStream is = null;
|
||||
if (p.waitFor() == 0) {
|
||||
is = p.getInputStream();
|
||||
} else {
|
||||
is = p.getErrorStream();
|
||||
}
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is),
|
||||
2048);
|
||||
String line = br.readLine();
|
||||
br.close();
|
||||
return line;
|
||||
} catch (Exception ex) {
|
||||
return "ERROR: " + ex.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public void setUnhandled(String unHandledIOE) {
|
||||
this.unHandledIOE = unHandledIOE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(String... params) {
|
||||
String logOuput = params[0] + "/" + currentTime + ".txt";
|
||||
Process mLogcatProc = null;
|
||||
BufferedReader reader = null;
|
||||
final StringBuilder log = new StringBuilder();
|
||||
String separator = System.getProperty("line.separator");
|
||||
log.append(discoverCPUData());
|
||||
if (unHandledIOE != null) {
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Unhandled Exceptions");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append(unHandledIOE);
|
||||
}
|
||||
try {
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "AndroidRuntime:E *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
String line;
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("AndroidRuntime Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
int PID = android.os.Process.getUidForName("com.reicast.emulator");
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "|", "grep " + PID });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Application Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "reidc:V *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Native Interface Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "GL3JNIView:E *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Open GLES View Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "newdc:V *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Native Library Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
reader = null;
|
||||
File file = new File(logOuput);
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
||||
writer.write(log.toString());
|
||||
writer.flush();
|
||||
writer.close();
|
||||
return log.toString();
|
||||
} catch (IOException e) {
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String response) {
|
||||
if (response != null && !response.equals(null)) {
|
||||
UploadLogs mUploadLogs = new UploadLogs(mContext, currentTime);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
mUploadLogs.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
|
||||
response);
|
||||
} else {
|
||||
mUploadLogs.execute(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -62,13 +62,13 @@ public class MainActivity extends SlidingFragmentActivity implements
|
|||
Toast.makeText(MainActivity.this,
|
||||
getString(R.string.platform),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
UploadLogs mUploadLogs = new UploadLogs(MainActivity.this);
|
||||
mUploadLogs.setUnhandled(error.getMessage());
|
||||
GenerateLogs mGenerateLogs = new GenerateLogs(MainActivity.this);
|
||||
mGenerateLogs.setUnhandled(error.getMessage());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
mUploadLogs.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
|
||||
mGenerateLogs.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
|
||||
home_directory);
|
||||
} else {
|
||||
mUploadLogs.execute(home_directory);
|
||||
mGenerateLogs.execute(home_directory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,22 @@ import java.io.FileWriter;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.ResponseHandler;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
|
@ -15,229 +31,93 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
|
||||
public class UploadLogs extends AsyncTask<String, Integer, String> {
|
||||
|
||||
public static final String build_model = android.os.Build.MODEL;
|
||||
public static final String build_device = android.os.Build.DEVICE;
|
||||
public static final String build_board = android.os.Build.BOARD;
|
||||
public static final int build_sdk = android.os.Build.VERSION.SDK_INT;
|
||||
import com.reicast.loungekatt.R;
|
||||
|
||||
public static final String DN = "Donut";
|
||||
public static final String EC = "Eclair";
|
||||
public static final String FR = "Froyo";
|
||||
public static final String GB = "Gingerbread";
|
||||
public static final String HC = "Honeycomb";
|
||||
public static final String IC = "Ice Cream Sandwich";
|
||||
public static final String JB = "JellyBean";
|
||||
public static final String KK = "KitKat";
|
||||
public static final String NF = "Not Found";
|
||||
|
||||
private String unHandledIOE;
|
||||
public class UploadLogs extends AsyncTask<String, Integer, Object> {
|
||||
|
||||
private String currentTime;
|
||||
private String logUrl;
|
||||
private Context mContext;
|
||||
|
||||
public UploadLogs(Context mContext) {
|
||||
public UploadLogs(Context mContext, String currentTime) {
|
||||
this.mContext = mContext;
|
||||
this.currentTime = currentTime;
|
||||
}
|
||||
|
||||
public void setPostUrl(String logUrl) {
|
||||
this.logUrl = logUrl;
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
protected void onPreExecute() {
|
||||
|
||||
}
|
||||
|
||||
private String discoverCPUData() {
|
||||
String s = "MODEL: " + Build.MODEL;
|
||||
s += "\r\n";
|
||||
s += "DEVICE: " + build_device;
|
||||
s += "\r\n";
|
||||
s += "BOARD: " + build_board;
|
||||
s += "\r\n";
|
||||
if (String.valueOf(build_sdk) != null) {
|
||||
String build_version = NF;
|
||||
if (build_sdk >= 4 && build_sdk < 7) {
|
||||
build_version = DN;
|
||||
} else if (build_sdk == 7) {
|
||||
build_version = EC;
|
||||
} else if (build_sdk == 8) {
|
||||
build_version = FR;
|
||||
} else if (build_sdk >= 9 && build_sdk < 11) {
|
||||
build_version = GB;
|
||||
} else if (build_sdk >= 11 && build_sdk < 14) {
|
||||
build_version = HC;
|
||||
} else if (build_sdk >= 14 && build_sdk < 16) {
|
||||
build_version = IC;
|
||||
} else if (build_sdk >= 16 && build_sdk < 19) {
|
||||
build_version = JB;
|
||||
} else if (build_sdk >= 19) {
|
||||
build_version = KK;
|
||||
}
|
||||
s += build_version + " (" + build_sdk + ")";
|
||||
} else {
|
||||
String prop_build_version = "ro.build.version.release";
|
||||
String prop_sdk_version = "ro.build.version.sdk";
|
||||
String build_version = readOutput("/system/bin/getprop "
|
||||
+ prop_build_version);
|
||||
String sdk_version = readOutput("/system/bin/getprop "
|
||||
+ prop_sdk_version);
|
||||
s += build_version + " (" + sdk_version + ")";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static String readOutput(String command) {
|
||||
try {
|
||||
Process p = Runtime.getRuntime().exec(command);
|
||||
InputStream is = null;
|
||||
if (p.waitFor() == 0) {
|
||||
is = p.getInputStream();
|
||||
} else {
|
||||
is = p.getErrorStream();
|
||||
}
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is),
|
||||
2048);
|
||||
String line = br.readLine();
|
||||
br.close();
|
||||
return line;
|
||||
} catch (Exception ex) {
|
||||
return "ERROR: " + ex.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public void setUnhandled(String unHandledIOE) {
|
||||
this.unHandledIOE = unHandledIOE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(String... params) {
|
||||
String currentTime = String.valueOf(System.currentTimeMillis());
|
||||
String logOuput = params[0] + "/" + currentTime + ".txt";
|
||||
Process mLogcatProc = null;
|
||||
BufferedReader reader = null;
|
||||
final StringBuilder log = new StringBuilder();
|
||||
String separator = System.getProperty("line.separator");
|
||||
log.append(discoverCPUData());
|
||||
if (unHandledIOE != null) {
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Unhandled Exceptions");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append(unHandledIOE);
|
||||
protected Object doInBackground(String... params) {
|
||||
HttpClient client = new DefaultHttpClient();
|
||||
if (logUrl == null || logUrl.equals(null)) {
|
||||
logUrl = "http://twisted.dyndns.tv:3194/ReicastBot/report/submit.php";
|
||||
}
|
||||
HttpPost post = new HttpPost(logUrl);
|
||||
try {
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "AndroidRuntime:E *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
String line;
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("AndroidRuntime Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
ArrayList<NameValuePair> mPairs = new ArrayList<NameValuePair>();
|
||||
mPairs.add(new BasicNameValuePair("name", currentTime));
|
||||
mPairs.add(new BasicNameValuePair("issue", params[0]));
|
||||
post.setEntity(new UrlEncodedFormEntity(mPairs));
|
||||
HttpResponse getResponse = client.execute(post);
|
||||
final int statusCode = getResponse.getStatusLine().getStatusCode();
|
||||
if (statusCode != HttpStatus.SC_OK) {
|
||||
Header[] headers = getResponse.getHeaders("Location");
|
||||
if (headers != null && headers.length != 0) {
|
||||
UploadLogs mUploadLogs = new UploadLogs(mContext,
|
||||
currentTime);
|
||||
mUploadLogs.setPostUrl(headers[headers.length - 1]
|
||||
.getValue());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
mUploadLogs.executeOnExecutor(
|
||||
AsyncTask.THREAD_POOL_EXECUTOR, params[0]);
|
||||
} else {
|
||||
mUploadLogs.execute(params[0]);
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return EntityUtils.toString(getResponse.getEntity());
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
int PID = android.os.Process.getUidForName("com.reicast.emulator");
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "|", "grep " + PID });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Application Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "reidc:V *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Native Interface Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "GL3JNIView:E *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Open GLES View Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
mLogcatProc = null;
|
||||
reader = null;
|
||||
mLogcatProc = Runtime.getRuntime().exec(
|
||||
new String[] { "logcat", "-d", "newdc:V *:S" });
|
||||
reader = new BufferedReader(new InputStreamReader(
|
||||
mLogcatProc.getInputStream()));
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
log.append("Native Library Output");
|
||||
log.append(separator);
|
||||
log.append(separator);
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
}
|
||||
reader.close();
|
||||
reader = null;
|
||||
File file = new File(logOuput);
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
||||
writer.write(log.toString());
|
||||
writer.flush();
|
||||
writer.close();
|
||||
return log.toString();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
post.abort();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
post.abort();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post.abort();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String response) {
|
||||
protected void onPostExecute(Object response) {
|
||||
if (response != null && !response.equals(null)) {
|
||||
String logLink = "http://reicast.loungekatt.com/report/logs/"
|
||||
+ currentTime + ".txt";
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) mContext
|
||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
android.content.ClipData clip = android.content.ClipData
|
||||
.newPlainText("logcat", response.toString());
|
||||
.newPlainText("logcat", logLink);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
} else {
|
||||
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) mContext
|
||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clipboard.setText(response.toString());
|
||||
clipboard.setText(logLink);
|
||||
}
|
||||
Intent browserIntent = new Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("https://reicast.loungekatt.com/report"));
|
||||
// Intent browserIntent = new Intent(
|
||||
// Intent.ACTION_VIEW,
|
||||
// Uri.parse("https://github.com/reicast/reicast-emulator/issues/new"));
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW,
|
||||
Uri.parse(mContext.getString(R.string.git_issues)));
|
||||
mContext.startActivity(browserIntent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue