WIP
This commit is contained in:
parent
586c0fd97a
commit
dd8e3d475a
3 changed files with 15 additions and 4 deletions
|
@ -54,6 +54,7 @@ public class TestModule {
|
|||
Settings provideSettings() {
|
||||
final Settings mock = mock(Settings.class);
|
||||
when(mock.getSortOrder()).thenReturn(PassStore.SortOrder.DATE);
|
||||
when(mock.doTraceDroidEmailSend()).thenReturn(false);
|
||||
return mock;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,4 +28,9 @@ public class Settings {
|
|||
}
|
||||
return PassStore.SortOrder.DATE;
|
||||
}
|
||||
|
||||
public boolean doTraceDroidEmailSend() {
|
||||
// will be overridden in test-module
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,14 +16,13 @@ import android.view.MenuItem;
|
|||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.TextView;
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
import com.squareup.otto.Bus;
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import net.i2p.android.ext.floatingactionbutton.FloatingActionButton;
|
||||
import net.i2p.android.ext.floatingactionbutton.FloatingActionsMenu;
|
||||
|
||||
import org.ligi.axt.AXT;
|
||||
import org.ligi.passandroid.App;
|
||||
import org.ligi.passandroid.R;
|
||||
|
@ -42,6 +41,10 @@ import org.ligi.tracedroid.sending.TraceDroidEmailSender;
|
|||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
public class PassListActivity extends AppCompatActivity {
|
||||
|
||||
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
|
||||
if (TraceDroid.getStackTraceFiles().length > 0) {
|
||||
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
|
||||
Tracker.get().trackEvent("ui_event", "processFile", "updatenotice", null);
|
||||
|
||||
|
|
Loading…
Reference in a new issue