This commit is contained in:
ligi 2015-11-17 03:35:21 +01:00
parent 586c0fd97a
commit dd8e3d475a
3 changed files with 15 additions and 4 deletions

View file

@ -54,6 +54,7 @@ public class TestModule {
Settings provideSettings() { Settings provideSettings() {
final Settings mock = mock(Settings.class); final Settings mock = mock(Settings.class);
when(mock.getSortOrder()).thenReturn(PassStore.SortOrder.DATE); when(mock.getSortOrder()).thenReturn(PassStore.SortOrder.DATE);
when(mock.doTraceDroidEmailSend()).thenReturn(false);
return mock; return mock;
} }

View file

@ -28,4 +28,9 @@ public class Settings {
} }
return PassStore.SortOrder.DATE; return PassStore.SortOrder.DATE;
} }
public boolean doTraceDroidEmailSend() {
// will be overridden in test-module
return true;
}
} }

View file

@ -16,14 +16,13 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import android.widget.TextView; import android.widget.TextView;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.squareup.otto.Bus; import com.squareup.otto.Bus;
import com.squareup.otto.Subscribe; import com.squareup.otto.Subscribe;
import net.i2p.android.ext.floatingactionbutton.FloatingActionButton; import net.i2p.android.ext.floatingactionbutton.FloatingActionButton;
import net.i2p.android.ext.floatingactionbutton.FloatingActionsMenu; import net.i2p.android.ext.floatingactionbutton.FloatingActionsMenu;
import org.ligi.axt.AXT; import org.ligi.axt.AXT;
import org.ligi.passandroid.App; import org.ligi.passandroid.App;
import org.ligi.passandroid.R; import org.ligi.passandroid.R;
@ -42,6 +41,10 @@ import org.ligi.tracedroid.sending.TraceDroidEmailSender;
import javax.inject.Inject; import javax.inject.Inject;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class PassListActivity extends AppCompatActivity { public class PassListActivity extends AppCompatActivity {
private static final int OPEN_FILE_READ_REQUEST_CODE = 1000; private static final int OPEN_FILE_READ_REQUEST_CODE = 1000;
@ -171,7 +174,9 @@ public class PassListActivity extends AppCompatActivity {
// don't want too many windows in worst case - so check for errors first // don't want too many windows in worst case - so check for errors first
if (TraceDroid.getStackTraceFiles().length > 0) { if (TraceDroid.getStackTraceFiles().length > 0) {
Tracker.get().trackEvent("ui_event", "send", "stacktraces", null); Tracker.get().trackEvent("ui_event", "send", "stacktraces", null);
TraceDroidEmailSender.sendStackTraces("ligi@ligi.de", this); if (settings.doTraceDroidEmailSend()) {
TraceDroidEmailSender.sendStackTraces("ligi@ligi.de", this);
}
} else { // if no error - check if there is a new version of the app } else { // if no error - check if there is a new version of the app
Tracker.get().trackEvent("ui_event", "processFile", "updatenotice", null); Tracker.get().trackEvent("ui_event", "processFile", "updatenotice", null);