Debug info on error

pull/146/head
M66B 7 years ago
parent 6a81e064bf
commit 3505ea6b8f

@ -370,6 +370,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if ("unified".equals(action)) if ("unified".equals(action))
getSupportFragmentManager().popBackStack("unified", 0); getSupportFragmentManager().popBackStack("unified", 0);
else if ("error".equals(action))
onDebugInfo();
else if (action.startsWith("thread")) { else if (action.startsWith("thread")) {
ViewModelMessages model = ViewModelProviders.of(this).get(ViewModelMessages.class); ViewModelMessages model = ViewModelProviders.of(this).get(ViewModelMessages.class);
model.setMessages(null); model.setMessages(null);

@ -611,12 +611,14 @@ public class ServiceSynchronize extends LifecycleService {
} }
private Notification.Builder getNotificationError(String action, Throwable ex) { private Notification.Builder getNotificationError(String action, Throwable ex) {
return getNotificationError(action, new Date().getTime(), ex); return getNotificationError(action, new Date().getTime(), ex, true);
} }
private Notification.Builder getNotificationError(String action, long when, Throwable ex) { private Notification.Builder getNotificationError(String action, long when, Throwable ex, boolean debug) {
// Build pending intent // Build pending intent
Intent intent = new Intent(this, ActivitySetup.class); Intent intent = new Intent(this, ActivitySetup.class);
if (debug)
intent.setAction("error");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pi = PendingIntent.getActivity( PendingIntent pi = PendingIntent.getActivity(
this, ActivitySetup.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT); this, ActivitySetup.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT);
@ -832,7 +834,7 @@ public class ServiceSynchronize extends LifecycleService {
if (now - account.last_connected > ACCOUNT_ERROR_AFTER * 60 * 1000L) { if (now - account.last_connected > ACCOUNT_ERROR_AFTER * 60 * 1000L) {
NotificationManager nm = getSystemService(NotificationManager.class); NotificationManager nm = getSystemService(NotificationManager.class);
nm.notify("receive", account.id.intValue(), nm.notify("receive", account.id.intValue(),
getNotificationError(account.name, account.last_connected, ex).build()); getNotificationError(account.name, account.last_connected, ex, false).build());
} }
} }

Loading…
Cancel
Save