Copy logs url into clipboard after successful upload
This commit is contained in:
parent
b2e904a6f9
commit
56be852dca
2 changed files with 16 additions and 3 deletions
|
@ -28,6 +28,8 @@ import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -1701,7 +1703,8 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
||||||
@Override
|
@Override
|
||||||
public void onEcCalibrationAudioUninit(Core lc) {}
|
public void onEcCalibrationAudioUninit(Core lc) {}
|
||||||
|
|
||||||
private void sendLogs(Context context, String info) {
|
private void sendLogs(String info) {
|
||||||
|
Context context = LinphoneActivity.instance();
|
||||||
final String appName = context.getString(R.string.app_name);
|
final String appName = context.getString(R.string.app_name);
|
||||||
|
|
||||||
Intent i = new Intent(Intent.ACTION_SEND);
|
Intent i = new Intent(Intent.ACTION_SEND);
|
||||||
|
@ -1713,7 +1716,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
||||||
i.setType("application/zip");
|
i.setType("application/zip");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LinphoneActivity.instance().startActivity(Intent.createChooser(i, "Send mail..."));
|
context.startActivity(Intent.createChooser(i, "Send mail..."));
|
||||||
} catch (android.content.ActivityNotFoundException ex) {
|
} catch (android.content.ActivityNotFoundException ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
}
|
}
|
||||||
|
@ -1724,7 +1727,16 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
||||||
Core linphoneCore, LogCollectionUploadState state, String info) {
|
Core linphoneCore, LogCollectionUploadState state, String info) {
|
||||||
Log.d("[Manager] Log upload state: " + state.toString() + ", info = " + info);
|
Log.d("[Manager] Log upload state: " + state.toString() + ", info = " + info);
|
||||||
if (state == LogCollectionUploadState.Delivered) {
|
if (state == LogCollectionUploadState.Delivered) {
|
||||||
sendLogs(LinphoneService.instance().getApplicationContext(), info);
|
ClipboardManager clipboard =
|
||||||
|
(ClipboardManager) mServiceContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
ClipData clip = ClipData.newPlainText("Logs url", info);
|
||||||
|
clipboard.setPrimaryClip(clip);
|
||||||
|
Toast.makeText(
|
||||||
|
LinphoneActivity.instance(),
|
||||||
|
getString(R.string.logs_url_copied_to_clipboard),
|
||||||
|
Toast.LENGTH_SHORT)
|
||||||
|
.show();
|
||||||
|
sendLogs(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
<string name="update_available">An update is available</string>
|
<string name="update_available">An update is available</string>
|
||||||
<string name="do_not_ask_again">Do not show again</string>
|
<string name="do_not_ask_again">Do not show again</string>
|
||||||
<string name="delete_contacts_text">Are you sure you want to delete these contacts?\nThey will be deleted from your phone as well!</string>
|
<string name="delete_contacts_text">Are you sure you want to delete these contacts?\nThey will be deleted from your phone as well!</string>
|
||||||
|
<string name="logs_url_copied_to_clipboard">Logs url copied into clipboard</string>
|
||||||
|
|
||||||
<!-- Launch screen -->
|
<!-- Launch screen -->
|
||||||
<string name="app_description">the <i>libre</i> SIP client</string>
|
<string name="app_description">the <i>libre</i> SIP client</string>
|
||||||
|
|
Loading…
Reference in a new issue