Add ReportActivity and ReportInfo
This implements the framework to report info to users. This may include reporting failure or result of commands or any exceptions that are raised. The ReportInfo provides 5 fields: - userAction: The user action that was being processed for which the report was generated. - sender: The internal app component that sent the report. - title: The report title. - reportString: The markdown text for the report. - addReportAndDeviceDetails: If set to true, then report and device details will be added to the report. This should provide the basics parameters for showing a report to the user. The ReportActivity also allows user to copy and share the report. In future this can also be used to allow users to easily email or post crash reports to github for Termux app crashes instead of going through logcat.
This commit is contained in:
26
app/src/main/java/com/termux/models/ReportInfo.java
Normal file
26
app/src/main/java/com/termux/models/ReportInfo.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.termux.models;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ReportInfo implements Serializable {
|
||||
|
||||
/** The user action that was being processed for which the report was generated. */
|
||||
public UserAction userAction;
|
||||
/** The internal app component that sent the report. */
|
||||
public String sender;
|
||||
/** The report title. */
|
||||
public String reportTitle;
|
||||
/** The markdown text for the report. */
|
||||
public String reportString;
|
||||
/** If set to {@code true}, then report and device details will be added to the report. */
|
||||
public boolean addReportAndDeviceDetails;
|
||||
|
||||
public ReportInfo(UserAction userAction, String sender, String reportTitle, String reportString, boolean addReportAndDeviceDetails) {
|
||||
this.userAction = userAction;
|
||||
this.sender = sender;
|
||||
this.reportTitle = reportTitle;
|
||||
this.reportString = reportString;
|
||||
this.addReportAndDeviceDetails = addReportAndDeviceDetails;
|
||||
}
|
||||
|
||||
}
|
||||
17
app/src/main/java/com/termux/models/UserAction.java
Normal file
17
app/src/main/java/com/termux/models/UserAction.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.termux.models;
|
||||
|
||||
public enum UserAction {
|
||||
|
||||
PLUGIN_EXECUTION_COMMAND("plugin execution command");
|
||||
|
||||
private final String name;
|
||||
|
||||
UserAction(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user