Commit Graph

3169 Commits

Author SHA1 Message Date
Torsten Grote 51c3528efa Add log statements to MessageQueueManagerImpl in order to find bug #272 2016-03-30 13:36:13 -03:00
akwizgran 9fbebe2226 Merge branch '272-message-queue-flow-control' into 'master'
Save queue state before delivering message. #272

Another attempt to fix #272...

See merge request !125
2016-03-30 16:35:36 +00:00
akwizgran 89d25d35d2 Save queue state before delivering message. #272 2016-03-30 17:15:45 +01:00
akwizgran e78ba2e806 Key derivation fixes, renamed a key derivation method. 2016-03-30 12:02:49 +01:00
akwizgran eeaa7e3813 Merge branch '272-transaction-isolation' into 'master'
Transaction isolation. #272

When client transactions were implemented the DB's read-write lock was removed, exposing H2's transaction isolation semantics. The default isolation level is "read committed", which allows concurrent transactions to overwrite each other's updates. This was the cause of #272. Changing H2's isolation level to "serialisable" would have caused other problems.

The solution is to reintroduce the DB's read-write lock. The lock is acquired when starting a transaction and released when committing or rolling back a transaction. (We already use try/finally blocks to ensure every transaction is committed or rolled back.) Read-only transactions can share the lock. To avoid deadlock, transactions must not be started while holding other locks.

This patch adapts the key manager to the new locking rules. The rest of the code was already compliant. Transports are now added to the DB during the startup phase, which allows TransportAddedEvent and TransportRemovedEvent to be deleted.

Fixes #269, fixes #272.

See merge request !124
2016-03-30 09:40:33 +00:00
akwizgran a8fa6339fb Don't disable Bluetooth, always reuse the connection. 2016-03-30 10:38:38 +01:00
akwizgran ed6c3fb1e3 Expect runtime exceptions from camera API methods. 2016-03-29 17:22:59 +01:00
akwizgran 1cdba02752 Updated javadocs for database methods. 2016-03-29 16:10:40 +01:00
akwizgran e58ca00979 Don't start transactions while holding locks. #272 2016-03-29 15:21:46 +01:00
akwizgran 685a864b43 Unit tests for transaction isolation. #272 2016-03-28 13:52:54 +01:00
akwizgran 1855dbbd2d Use a lock to ensure transaction isolation. #272 2016-03-28 13:52:12 +01:00
akwizgran 9714713d73 Add transports to DB during startup. #269 2016-03-28 13:47:23 +01:00
akwizgran 0417639410 Merge duplex and simplex plugin config classes. 2016-03-28 11:28:46 +01:00
str4d 0f7131b83b Replace BT introduction activity with BQP QR code activity 2016-03-26 15:53:13 +13:00
str4d 8cacc73bef Implement BQP Android UI using QR codes 2016-03-26 15:53:09 +13:00
str4d 701cfdba48 Extract contact exchange protocol from BT introduction protocol 2016-03-26 15:53:02 +13:00
str4d d7c7a72710 Factor out loading screen activity XML 2016-03-26 15:53:02 +13:00
str4d 5ff7adcebf Test BQP implementation 2016-03-26 15:53:02 +13:00
str4d c3997fb06f Implement BQP API 2016-03-26 15:53:02 +13:00
str4d ce7c189923 Create BQP API 2016-03-26 15:53:02 +13:00
str4d d2d8d9d46e Implement BQP transport descriptors 2016-03-26 15:52:58 +13:00
akwizgran 65316414ea Added toString() method to TransportId. 2016-03-22 16:07:20 +00:00
akwizgran 31f6c0bf50 More logging for MessageQueueManagerImpl. #272 2016-03-22 13:46:27 +00:00
akwizgran f20a1e8dfe Fix merge problems in TransportPropertyValidatorTest. 2016-03-16 15:37:54 +00:00
akwizgran 89ca0e5a26 Merge branch 'property-validator-test' into 'master'
TransportPropertyValidatorTest

Tests for the TransportPropertyValidator ValidateMessage call.

See merge request !110
2016-03-16 14:53:00 +00:00
akwizgran e39a74bd40 Finish SplashScreenActivity when starting next activity.
Fixes #270.
2016-03-15 20:58:57 +00:00
akwizgran d605e1cae4 Reverted text colour to black.
@color/briar_text_primary is used in a lot of places other than the settings screen - if we want to use grey text in the settings screen we'll need to find another way.

Also fixed some misspelled resource names and included the colours from the Briar palette in color.xml.
2016-03-15 20:46:24 +00:00
akwizgran 3d57516258 Fixed merge issues. 2016-03-15 20:26:50 +00:00
akwizgran c2a1cc1e4e Merge branch '247-dagger-2' into 'master'
247 dagger 2

This MR in a nutshell replaces Guice and Roboguice with Dagger 2, which offers a lot more possibilities than is implemented in this branch, such as using lazy injections for performance purposes. With Dagger 2 all the magic happens at compile time, so no need to worry about unfulfilled injections at runtime, but due to restrictions I was forced to put injected test code into an Android module. We therefore have a new test module, `android-test`.

A consequence of using Dagger 2 is that we no longer have a view injector and I therefore had to replace those with manual references. 

Closes #247 

See merge request !118
2016-03-15 20:02:14 +00:00
Ernir Erlingsson 11bfa212cc minor tweaks 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 85c66417b5 branch cleanup 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 686729b045 refactor with master and fixed files that were accidentally clobbered 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 4da63b3800 Modified the project structure, removed module extension and went instead for a non-complete core dependency graph 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 7670bc48ea Removed unecessary module 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 6f233070fe Semi-encapsulated the core/api dependency graphs and created a proper structure to load eager singletons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 10764d727b rebased with master 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 9af3ce123a Added eager singletons and made some fixes 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 5aba1d79f1 Fixes after comments, also removed the CryptoComoponent from the IdentIcons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 95d89553d5 merged with master 2016-03-14 21:02:51 +01:00
Ernir Erlingsson ac5d68df81 Added dependency verifications and removed Splash header 2016-03-14 21:01:21 +01:00
Ernir Erlingsson 25324697ac cleanup and added missing desktop modules 2016-03-14 21:01:21 +01:00
Ernir Erlingsson 1be400eb84 Switched Roboguice/Guice out for Dagger 2 2016-03-14 21:01:21 +01:00
akwizgran e5d7038195 Merge branch '206-settings-prefs-alt' into 'master'
Material design settings - alternative

Closes #206.

Alternative to !77 that does not rely on an additional external library. The two alternatives should be compared for backwards-compatibility specifically regarding the ringtone selector.

Includes code from https://github.com/consp1racy/android-support-preference
License: Apache License v2.0

See merge request !78
2016-03-14 16:20:35 +00:00
Torsten Grote e8ad11210c Merge branch '266-message-queues' into 'master'
Message queues. #266

A message queue is a group shared by two devices that delivers messages from each device to the other in order. The first 64 bits of the message body contain a sequence number that's incremented for each message sent in a given direction. The incoming and outgoing sequence numbers and information about any messages received out of order and waiting to be delivered are stored in the group metadata.

See merge request !121
2016-03-14 14:56:43 +00:00
Santiago Torres 24f733ed05 WIP: Adds Transport properly validator test 2016-03-13 20:42:09 -04:00
str4d 770d9ddc5f Migrate settings to PreferenceFragmentCompat
Includes code from https://github.com/consp1racy/android-support-preference
License: Apache License v2.0
2016-03-11 21:06:06 +00:00
akwizgran 02eca8ec38 Unit tests for MessageQueueManagerImpl. 2016-03-11 17:18:10 +00:00
akwizgran e458853f34 Extra logging to track down Tor connection problems. 2016-03-11 15:21:26 +00:00
akwizgran 4afcf2e4a4 Added logging to track down deletion bug. 2016-03-11 10:13:35 +00:00
akwizgran c615dd1ed1 Merge branch 'bluetooth-race' into 'master'
Fix race condition when closing redundant Bluetooth sockets

The Bluetooth invitation code has a race condition: if Alice and Bob connect to each other at roughly the same time, they each consider their outgoing socket to be redundant and close it, resulting in both sockets being closed. This can be triggered pretty reliably by using two phones of the same model and pressing 'Continue' at the same time on both phones.

When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks, which Bob can detect by trying to read from both sockets.

Hopefully the Bluetooth invitation code will be retired when #117 is merged, but I'm putting this up for review in case we need to keep Bluetooth as a fallback method.

See merge request !120
2016-03-09 10:12:05 +00:00