Add reset log button
This commit is contained in:
parent
377e39175b
commit
589ab3b674
3 changed files with 21 additions and 4 deletions
|
@ -62,6 +62,13 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/menu_send_log"/>
|
android:text="@string/menu_send_log"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/reset_log"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_reset_log"
|
||||||
|
/>
|
||||||
|
|
||||||
<Button android:id="@+id/exit"
|
<Button android:id="@+id/exit"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -149,6 +149,7 @@
|
||||||
<string name="about_mailer_chooser_text">Send bug report with…</string>
|
<string name="about_mailer_chooser_text">Send bug report with…</string>
|
||||||
<string name="menu_about">About</string>
|
<string name="menu_about">About</string>
|
||||||
<string name="menu_send_log">Send log</string>
|
<string name="menu_send_log">Send log</string>
|
||||||
|
<string name="menu_reset_log">Reset log</string>
|
||||||
<string name="pref_audio">Audio</string>
|
<string name="pref_audio">Audio</string>
|
||||||
<string name="menu_exit">Exit</string>
|
<string name="menu_exit">Exit</string>
|
||||||
<string name="pref_prefix">Prefix</string>
|
<string name="pref_prefix">Prefix</string>
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class AboutFragment extends Fragment implements OnClickListener {
|
||||||
private FragmentsAvailable about = FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT;
|
private FragmentsAvailable about = FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT;
|
||||||
View exitButton = null;
|
View exitButton = null;
|
||||||
View sendLogButton = null;
|
View sendLogButton = null;
|
||||||
|
View resetLogButton = null;
|
||||||
private LinphoneCoreListenerBase mListener;
|
private LinphoneCoreListenerBase mListener;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,6 +62,10 @@ public class AboutFragment extends Fragment implements OnClickListener {
|
||||||
sendLogButton.setOnClickListener(this);
|
sendLogButton.setOnClickListener(this);
|
||||||
sendLogButton.setVisibility(LinphonePreferences.instance().isDebugEnabled() ? View.VISIBLE : View.GONE);
|
sendLogButton.setVisibility(LinphonePreferences.instance().isDebugEnabled() ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
|
resetLogButton = view.findViewById(R.id.reset_log);
|
||||||
|
resetLogButton.setOnClickListener(this);
|
||||||
|
resetLogButton.setVisibility(LinphonePreferences.instance().isDebugEnabled() ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
exitButton = view.findViewById(R.id.exit);
|
exitButton = view.findViewById(R.id.exit);
|
||||||
exitButton.setOnClickListener(this);
|
exitButton.setOnClickListener(this);
|
||||||
exitButton.setVisibility(View.VISIBLE);
|
exitButton.setVisibility(View.VISIBLE);
|
||||||
|
@ -118,12 +123,16 @@ public class AboutFragment extends Fragment implements OnClickListener {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
if (LinphoneActivity.isInstanciated()) {
|
||||||
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
if (v == sendLogButton) {
|
if (v == sendLogButton) {
|
||||||
//LinphoneUtils.collectLogs(LinphoneActivity.instance(), getString(R.string.about_bugreport_email));
|
//LinphoneUtils.collectLogs(LinphoneActivity.instance(), getString(R.string.about_bugreport_email));
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
|
||||||
if (lc != null) {
|
if (lc != null) {
|
||||||
lc.uploadLogCollection();
|
lc.uploadLogCollection();
|
||||||
}
|
}
|
||||||
|
} else if (v == resetLogButton) {
|
||||||
|
if (lc != null) {
|
||||||
|
lc.resetLogCollection();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LinphoneActivity.instance().exit();
|
LinphoneActivity.instance().exit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue