Refactored invitation code to allow the UI to save & restore its state.
Android UI elements can be destroyed and recreated at any time, and they can only store serialisable state, so references to long-running tasks have to take the form of serialisable handles. This is pretty ugly - it's easy to create memory leaks if you don't clean up stale handle/reference mappings - but it's less ugly than the common solution of using static variables to hold references.
Showing
- lint.xml 4 additions, 0 deletionslint.xml
- src/net/sf/briar/android/invitation/AddContactActivity.java 122 additions, 25 deletionssrc/net/sf/briar/android/invitation/AddContactActivity.java
- src/net/sf/briar/android/invitation/CodesDoNotMatchView.java 1 addition, 1 deletionsrc/net/sf/briar/android/invitation/CodesDoNotMatchView.java
- src/net/sf/briar/android/invitation/ConnectionFailedView.java 1 addition, 1 deletion...net/sf/briar/android/invitation/ConnectionFailedView.java
- src/net/sf/briar/android/invitation/ContactAddedView.java 1 addition, 1 deletionsrc/net/sf/briar/android/invitation/ContactAddedView.java
- src/net/sf/briar/android/invitation/InvitationCodeView.java 1 addition, 7 deletionssrc/net/sf/briar/android/invitation/InvitationCodeView.java
- src/net/sf/briar/api/invitation/ConfirmationCallback.java 0 additions, 14 deletionssrc/net/sf/briar/api/invitation/ConfirmationCallback.java
- src/net/sf/briar/api/invitation/ConnectionCallback.java 0 additions, 18 deletionssrc/net/sf/briar/api/invitation/ConnectionCallback.java
- src/net/sf/briar/api/invitation/InvitationListener.java 26 additions, 0 deletionssrc/net/sf/briar/api/invitation/InvitationListener.java
- src/net/sf/briar/api/invitation/InvitationManager.java 10 additions, 10 deletionssrc/net/sf/briar/api/invitation/InvitationManager.java
- src/net/sf/briar/api/invitation/InvitationState.java 62 additions, 0 deletionssrc/net/sf/briar/api/invitation/InvitationState.java
- src/net/sf/briar/api/invitation/InvitationTask.java 32 additions, 0 deletionssrc/net/sf/briar/api/invitation/InvitationTask.java
- src/net/sf/briar/api/plugins/InvitationConstants.java 3 additions, 1 deletionsrc/net/sf/briar/api/plugins/InvitationConstants.java
- src/net/sf/briar/invitation/AliceConnector.java 23 additions, 20 deletionssrc/net/sf/briar/invitation/AliceConnector.java
- src/net/sf/briar/invitation/BobConnector.java 28 additions, 19 deletionssrc/net/sf/briar/invitation/BobConnector.java
- src/net/sf/briar/invitation/Connector.java 20 additions, 38 deletionssrc/net/sf/briar/invitation/Connector.java
- src/net/sf/briar/invitation/ConnectorGroup.java 145 additions, 0 deletionssrc/net/sf/briar/invitation/ConnectorGroup.java
- src/net/sf/briar/invitation/FailureNotifier.java 0 additions, 42 deletionssrc/net/sf/briar/invitation/FailureNotifier.java
- src/net/sf/briar/invitation/InvitationManagerImpl.java 28 additions, 34 deletionssrc/net/sf/briar/invitation/InvitationManagerImpl.java
- src/net/sf/briar/invitation/InvitationModule.java 3 additions, 1 deletionsrc/net/sf/briar/invitation/InvitationModule.java
Loading
Please register or sign in to comment