Commit Graph

694 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
1ae98ef2b5 Reduced polling intervals to improve connectivity. 2016-05-06 12:09:30 +01:00
akwizgran
e5547a5a12 Removed extra logging for Tor connection failures. 2016-05-06 12:09:30 +01:00
akwizgran
fbb3c0f9f2 Use exponential backoff for Tor polling. #314 2016-05-06 12:09:25 +01:00
str4d
84cdbb877d Use control port to create and set up the Tor hidden service 2016-05-06 12:03:39 +01:00
akwizgran
33c1f16356 Merge branch '370-nav-drawer-remember-fragment' into 'master'
Remember the selected fragment from the NavDrawer

and stay in it when configuration changes

Closes #370

See merge request !176
2016-05-06 09:20:06 +00:00
Torsten Grote
271e390b9d 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.
2016-05-04 18:07:12 -03:00
Torsten Grote
9bef114c35 Forum Sharing Client backend
This commit 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 invitiation. Also, the
Forum Sharing Manger is notified when users leave a forum.

Closes #322
2016-05-04 17:02:22 -03:00
Torsten Grote
6f1360c398 Remember the selected fragment from the NavDrawer
and stay in it when configuration changes

Closes #370
2016-05-04 11:25:05 -03:00
akwizgran
5a84e0fe5c Added "Touch to open Briar" to ongoing notification. 2016-05-04 09:32:47 +01:00
akwizgran
5fab9c383d Updated forum toasts and renamed delete icon. 2016-05-03 16:21:26 +01:00
akwizgran
da60e567e0 Merge branch '305-remove-forum' into 'master'
Move forum removal action from long press menu to action bar

This is part of the UI changes for #305 

See merge request !164
2016-05-03 15:02:01 +00:00
Torsten Grote
684898ef09 Move forum removal action from long press menu to action bar
part of UI changes for #305
2016-05-03 12:00:09 -03:00
akwizgran
3b65144ff6 Merge branch '154-ongoing-notification' into 'master'
Set ongoing notification to minimum priority

Setting the priority of the ongoing notification to PRIORITY_MIN prevents it from being shown in the status bar on Android 4.1 and later. The service still runs in the foreground.

Thanks to @str4d for finding the solution. Closes #154.

See merge request !169
2016-05-03 14:59:19 +00:00
akwizgran
a655df7317 Merge branch '322-prepare-new-forum-sharing' into 'master'
Prepare for new Forum Sharing Client

Methods for creating, adding and removing forums have been moved to the
`ForumManager`. In order to still handle removing forums properly, a
`RemoveForumHook` has been introduced.

Methods for sharing forums with all current and future contacts have
been removed along with the localGroup where this information was saved.

The `ShareForumActivity` now has the proper label.

The `SessionId` and the `ProtocolEngine` have been moved to the
`clients` package.

This addresses part of #322 and part of what has been discussed in #320.

See merge request !156
2016-05-03 14:54:43 +00:00
Torsten Grote
9f9a216305 Prepare for new Forum Sharing Client
Methods for creating, adding and removing forums have been moved to the
`ForumManager`. In order to still handle removing forums properly, a
`RemoveForumHook` has been introduced.

Methods for sharing forums with all current and future contacts have
been removed along with the localGroup where this information was saved.

The `ShareForumActivity` now has the proper label.

The `SessionId` and the `ProtocolEngine` have been moved to the
`clients` package.

This addresses part of #322 and part of what has been discussed in #320.
2016-05-03 11:48:45 -03:00
akwizgran
bba999478f Merge branch '314-tor-sleep' into 'master'
Hold a wake lock while Tor is connected to the internet

This is a partial fix for #314. As noted on that ticket, if a Tor connection is lost for any reason other than the device sleeping, the plugin won't try to replace the lost connection. I'm leaving the ticket open until that more general issue is solved.

The Tor plugin uses several variables to keep track of its connectivity status. This patch refactors those variables into an inner class to improve readability and ensure they're accessed atomically. However, it's still possible for the plugin's state to become inconsistent with the state of the Tor process. For example, calls to updateConnectionStatus() may run concurrently on the IO executor, so their calls to enableNetwork() may be interleaved. As usual, locking would solve this problem but create the potential for deadlock, so I won't try to solve it in this patch.

See merge request !168
2016-05-03 14:45:42 +00:00
akwizgran
400a11e3b0 Renamed circuit status method. 2016-05-03 15:41:59 +01:00
akwizgran
189efe8d97 Merge branch '316-mobile-data-setting' into 'master'
Fix name of Tor mobile data setting

Closes #316.

See merge request !167
2016-05-03 14:39:22 +00:00
akwizgran
b57b65e803 Merge branch '331-viewfinder' into 'master'
Reinitialise viewfinder when camera view is shown

Thanks to @str4d for finding the cause of the bug. Closes #331.

See merge request !165
2016-05-03 14:38:37 +00:00
akwizgran
160adca198 Merge branch 'use-android-executor' into 'master'
Use Android executor for background API calls

Some Android API calls need to be made from a thread with a message queue, but to keep the UI responsive they shouldn't be made from the UI thread.

This patch gives AndroidExecutor a captive thread with a message queue to execute tasks, and converts various background tasks from creating their own threads to using AndroidExecutor and IoExecutor.

This allows us to upgrade the support library to 23.2.1. Fixes #332.

See merge request !161
2016-05-03 14:34:49 +00:00
akwizgran
3d4abee1a4 Merge branch '305-forum-list-snackbar' into 'master'
Add Snackbar and Toolbar Button to Forum List

This MR is a small change that replaces the custom UI elements in
the forum list with a Snackbar and a Toolbar menu.

It also fixes a background color that was still present with fragment from the NavDrawer.

Before:

![before](/uploads/6dcc545827c035dcffcdf7863893753e/before.png)

After:

![after](/uploads/427de01d8bec779ee81e6ebded3fcd2b/after.png)

It addresses one part (2b) of #305 and is part of #121.


See merge request !163
2016-05-03 13:51:44 +00:00
akwizgran
25b165ac1e Set ongoing notification to minimum priority. #154 2016-05-03 14:14:15 +01:00