Commit Graph

2266 Commits

Author SHA1 Message Date
akwizgran
926fdd85a8 Merge branch '337-forum-avatars' into 'master'
Forum Avatars

These new forum avatars are using the first letter of the forum and calculate the background color from forum's group ID.

Closes #337

![device-2016-05-11-124106](/uploads/afe926066f4306500c6ee23bb93b5b5b/device-2016-05-11-124106.png)

See merge request !178
2016-05-11 16:01:56 +00:00
Torsten Grote
e87991ecac Forum Avatars using the first letter of the forum and color from group
Also prevents the snackbar from hiding the bottom of the list.

Closes #337
2016-05-11 12:47:54 -03:00
akwizgran
3193b73687 Merge branch 'start-plugins-async' into 'master'
Start plugins asynchronously

This prevents other services from getting stuck behind the plugin manager while the Tor plugin is starting, which takes several seconds. The plugin manager waits for each plugin to start before stopping it.

I've also added some canaries to plugins and services to ensure instances aren't started more than once.

See merge request !181
2016-05-11 14:46:55 +00:00
akwizgran
3680cad9b8 Merge branch 'poller-refactoring' into 'master'
Poller refactoring, replace Timer with ScheduledExecutorService

* Replace Timer with ScheduledExecutorService (closes #258)
* Move automatic connection logic from PluginManager to Poller
* Reschedule polling when connections are opened or closed, making the poller more responsive to reductions in the polling interval


See merge request !180
2016-05-11 14:45:50 +00:00
akwizgran
3d8dd899a0 Merge branch '328-report-primer' into 'master'
Collect dev report data on a thread with a looper

Closes #328.

See merge request !166
2016-05-11 14:42:12 +00:00
akwizgran
2f11f81582 Collect dev report data on a thread with a looper. #328 2016-05-11 15:41:22 +01:00
akwizgran
6873dbc493 UI code cleanup. 2016-05-11 13:52:40 +01:00
akwizgran
7a3bcc58ae Inject fragments. Fixes an NPE due to uninitialised fields. 2016-05-11 13:31:45 +01:00
akwizgran
2a980af69a Set border of author avatars to @color/briar_primary. 2016-05-11 11:54:40 +01:00
akwizgran
41e282f19a Merge branch '274-code-encapsulation' into 'master'
274 code encapsulation

The goal of this branch is to better compartmentalize, structure and simplify the code in the Android module. It does this via the following techniques:

* Extended use of Dagger by introducing a component for Activities that injects, among other things, SharedPreferences and Fragments. The latter makes it possible to mock fragments more easily and letting Dagger automatically handle its injections.
* Decouple Briar API code, from the activities and Fragments, and encapsulate in re-usable Controller classes
* Introduce a UI-thread App event bus that the Helper classes use to communicate with Activities & Fragments.
* Define the testing methods in the briar-android module per Robolectric and Mockito

NOTE! Don't be alarmed if you see the contact introduction message one more time, one of the changes was to purify UI shared preferences from the Briar shared preferences, which now only contain preferences related to the API and it's usage.

closes #274 



See merge request !130
2016-05-11 10:54:07 +00:00
Ernir Erlingsson
f81c8fcbd0 rebased with master 2016-05-11 12:22:53 +02:00
Ernir Erlingsson
c93e78f178 modifications based on Akwizgran's comments 2016-05-11 11:55:17 +02:00
Ernir Erlingsson
d4232b6a01 cleanup 2016-05-11 11:55:17 +02:00
Ernir Erlingsson
64d1e25ad7 cleanup 2016-05-11 11:55:16 +02:00
Ernir Erlingsson
f855c9ea28 Finished unit tests for SetupActivity and its Controller 2016-05-11 11:52:57 +02:00
Ernir Erlingsson
80f79d9ee0 finished Activity mock 2016-05-11 11:52:57 +02:00
Ernir Erlingsson
8bb1d444c6 interlude 2016-05-11 11:52:56 +02:00
Ernir Erlingsson
adb7d37f86 implementing robolectric and mockito 2016-05-11 11:52:56 +02:00
Ernir Erlingsson
aa3ef896f5 further polish 2016-05-11 11:52:56 +02:00
Ernir Erlingsson
da50c5dcc3 cleanup and minor refactoring 2016-05-11 11:52:56 +02:00
Ernir Erlingsson
e809aaa932 merge and update 2016-05-11 11:50:34 +02:00
Ernir Erlingsson
ef3b41dc1d comment & log cleanup 2016-05-11 11:50:34 +02:00
Ernir Erlingsson
604cfd5202 Fix transport update 2016-05-11 11:50:34 +02:00
Ernir Erlingsson
a14e981236 Switched AppBus for ResultHandler, Controller for Helper. Added the basics for LifecycleControllers and implemented it for BriarActivity and NavDrawerActivity 2016-05-11 11:50:34 +02:00
Ernir Erlingsson
27098db18f fix compile error 2016-05-11 11:50:34 +02:00
Ernir Erlingsson
8d021aab50 cleaning up 2016-05-11 11:50:34 +02:00
Ernir Erlingsson
5d8ba660c2 merge 2016-05-11 11:50:33 +02:00
Ernir Erlingsson
a9de12520d phase 2: helpers and app bus 2016-05-11 11:42:38 +02:00
Ernir Erlingsson
7b552bde1e phase 1: Activities and Fragments 2016-05-11 11:42:38 +02:00
akwizgran
1724fbe5a9 Merge branch '121-new-forum-sharing-ui' into 'master'
Forum Sharing Client UI

This changes `ShareForumActivity` to use two fragments to facilitate
forum sharing with the new Forum Sharing Client backend.

The `ContactSelectorFragment` allows the user to select a
number of contacts. If there is an ongoing sharing session or the forum
is already shared with the contact, it is disabled in the list. If there
is at least one contact selected, a button appears in the toolbar that
brings the user to the `ShareForumMessageFragment` where the user can
write an optional message to be send along with the invitation.

After sending an invitation, the user is brought back to the forum that
she shared and there is a snackbar showing up briefly to indicate the
successful invitation.

The invitation is shown along with the message within the private
conversation of each contact. The person who shares the forum also sees
the invitation and the message as outgoing messages that also display
the current status of the messages.

A notification is shown like for other private messages as well.

Please note that this commit does not include a way for users to respond
to invitations. This is in MR !172. Both MRs are based on the new backend in !170.

![device-2016-05-03-182928](/uploads/48499ca4c149a8e7f13f8b28a24537ad/device-2016-05-03-182928.png)
![device-2016-05-03-182855](/uploads/5f49c43bf8f39780862247848a5b9c27/device-2016-05-03-182855.png)

See merge request !171
2016-05-11 09:13:07 +00:00
akwizgran
5aa44f4c9f Merge branch '121-new-available-forums-ui' into 'master'
Modernize AvailableForumsActivity

Turn list of available forums into a `BriarRecyclerView` with XML layout.
Allow to respond to forum invitations from the list of available forums.
The user can either accept or decline an invitation.

![device-2016-05-03-141150](/uploads/0998877d47fb7a3eafe3a90f917d8716/device-2016-05-03-141150.png)

See merge request !172
2016-05-11 08:57:56 +00:00
Torsten Grote
3a9d66a85f Forum Sharing Client UI
This changes `ShareForumActivity` to use two fragments to facilitate
forum sharing with the new Forum Sharing Client backend.

The `ContactSelectorFragment` allows the user to select a
number of contacts. If there is an ongoing sharing session or the forum
is already shared with the contact, it is disabled in the list. If there
is at least one contact selected, a button appears in the toolbar that
brings the user to the `ShareForumMessageFragment` where the user can
write an optional message to be send along with the invitation.

After sending an invitation, the user is brought back to the forum that
she shared and there is a snackbar showing up briefly to indicate the
successful invitation.

The invitation is shown along with the message within the private
conversation of each contact. The person who shares the forum also sees
the invitation and the message as outgoing messages that also display
the current status of the messages.

A notification is shown like for other private messages as well.

Please note that this commit does not include a way for users to respond
to invitations.
2016-05-10 21:04:08 -03:00
Torsten Grote
bcfdd848a4 Modernize AvailableForumsActivity
Turn list of available forums into a BriarRecyclerView with XML layout.
Allow to respond to forum invitations from the list of available forums.
The user can either accept or decline an invitation.
2016-05-10 20:07:42 -03:00
akwizgran
2cc621ed1b Bumped DB schema version.
Prevent old forum sharing messages from causing spurious exceptions.
2016-05-10 16:19:38 +01:00
akwizgran
0b3486536e Merge branch '305-new-forum-list' into 'master'
New List of Forums

The adapter of the `ForumListFragment` has been changed into a
`BriarRecyclerView` and all its code has been adapted and simplified
accordingly.

All UI of the forum list is now defined in XML layouts. This enabled me to move the snackbar into onCreate().

Before:

![device-2016-05-03-165331](/uploads/961cc2c043464f446584de4ae0ad527b/device-2016-05-03-165331.png)

After:

![device-2016-05-03-165117](/uploads/e22ede3e9a3330762b3ae84f86ca6ec5/device-2016-05-03-165117.png)


See merge request !175
2016-05-10 14:55:47 +00:00
akwizgran
1bd5c0b195 Merge branch 'aggressive-polling' into 'master'
Try harder to connect to contacts

* When an outgoing connection is lost, try to reconnect to the contact straight away
* Use periodic polling for Tor, regardless of whether our hidden service descriptor has been published
* Reduce polling intervals for all plugins (this can be reverted if we solve the connectivity issues)

Closes #262, #314. Hopefully helps with #361.

See merge request !177
2016-05-10 14:47:04 +00:00
akwizgran
d4abfe77a1 Merge branch '339-forum-sharing-integration-tests' into 'master'
Forum Sharing Integration Tests

This adds integration tests for these cases:
* normal invitation session where invitee accepts
* normal invitation session where invitee declines
* session where invitee leaves again after she joined
* session where sharer leaves after invitee has joined
* session where sharer leaves before invitee can respond
* sharer reuses the session ID of the previous session
* after accepting the invitation, the invitee invites the sharer to the same forum
* after session contacts delete each other and session states get cleaned up

Closes #339

See merge request !173
2016-05-10 14:46:02 +00:00
akwizgran
f22ea85222 Merge branch '322-forum-sharing-client' into 'master'
Forum Sharing Client Backend

This MR replaces the old `ForumSharingManagerImpl` with a new one
which is based on state machines and the `ProtocolEngine`.

There is a `SharerEngine` and a `InviteeEngine` that take care of state
transitions, messages, events and trigger actions to be carried out by
the `ForumSharingManagerImpl`. This is all very similar to the
Introduction Client.

The general sharing paradigm has been changed from sharing as a state to
sharing as an action. Now the UI can allow users to invite contacts to
forums. The contacts can accept or decline the invitation. Also, the
Forum Sharing Manager is notified when users leave a forum.

Please note that you will need the UI to actually test this. It is coming up soon in another MR.

Closes #322

See merge request !170
2016-05-09 16:30:21 +00:00
akwizgran
2b64d2328a Merge branch '302-lan-plugin-privacy' into 'master'
Store a fixed number of recent IP addresses, padded with fakes

Closes #302

See merge request !159
2016-05-06 16:00:36 +00:00
str4d
0dfc735288 Store a limited number of recent LAN IP addresses 2016-05-06 16:44:52 +01:00
str4d
b81a567468 First part of BQP UI improvements.
Includes parallel improvements to Bluetooth key exchange UI.
2016-05-06 13:57:30 +01:00
akwizgran
ef19f2ec48 Start plugins asynchronously.
This allows the lifecycle manager to continue starting other services while plugins are starting, and allows the plugin manager to stop each plugin as soon as it has started.
2016-05-06 12:14:47 +01:00
akwizgran
86f409d0bf Don't send dev reports until transport is enabled. 2016-05-06 12:14:47 +01:00
akwizgran
e36d1c8954 Fixed possible NPE from uninitialised control connection. 2016-05-06 12:14:47 +01:00
akwizgran
2ecccc66d1 Ensure that Plugin instances aren't reused. 2016-05-06 12:14:38 +01:00
akwizgran
69f23ead9b Ensure that Service instances aren't reused. 2016-05-06 12:14:37 +01:00
akwizgran
57be439f08 Code cleanup and logging. 2016-05-06 12:11:40 +01:00
akwizgran
e3bf20aed5 Reschedule polling when connections are opened or closed. 2016-05-06 12:11:40 +01:00
akwizgran
1bdd7ca761 Removed empty Poller interface. 2016-05-06 12:11:39 +01:00
akwizgran
5044f34ba9 Moved all automatic connection logic into poller. 2016-05-06 12:11:39 +01:00