Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
briar
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
579
Issues
579
List
Boards
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
briar
briar
Commits
bb5a6c02
Verified
Commit
bb5a6c02
authored
Mar 29, 2019
by
Torsten Grote
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[android] Add assertions to TextAttachmentController
parent
70d29af2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
TextAttachmentController.java
...rproject/briar/android/view/TextAttachmentController.java
+5
-0
No files found.
briar-android/src/main/java/org/briarproject/briar/android/view/TextAttachmentController.java
View file @
bb5a6c02
...
...
@@ -94,6 +94,7 @@ public class TextAttachmentController extends TextSendController
@Override
public
void
onSendEvent
()
{
if
(
canSend
())
{
if
(
loadingUris
)
throw
new
AssertionError
();
listener
.
onSendClick
(
textInput
.
getText
(),
attachmentManager
.
getAttachmentHeaders
());
reset
();
...
...
@@ -139,6 +140,7 @@ public class TextAttachmentController extends TextSendController
public
void
onImageReceived
(
@Nullable
Intent
resultData
)
{
if
(
resultData
==
null
)
return
;
if
(
loadingUris
)
throw
new
AssertionError
();
if
(
resultData
.
getData
()
!=
null
)
{
imageUris
=
new
ArrayList
<>(
1
);
imageUris
.
add
(
resultData
.
getData
());
...
...
@@ -155,6 +157,7 @@ public class TextAttachmentController extends TextSendController
private
void
onNewUris
()
{
if
(
imageUris
.
isEmpty
())
return
;
if
(
loadingUris
||
urisLoaded
!=
0
)
throw
new
AssertionError
();
loadingUris
=
true
;
updateViewState
();
textInput
.
setHint
(
R
.
string
.
image_caption_hint
);
...
...
@@ -169,6 +172,7 @@ public class TextAttachmentController extends TextSendController
}
private
void
onAttachmentResultReceived
(
AttachmentResult
result
)
{
if
(!
loadingUris
)
return
;
// if this is false, the user cancelled
if
(
result
.
isError
()
||
result
.
getUri
()
==
null
)
{
onError
(
result
.
getErrorMsg
());
}
else
{
...
...
@@ -227,6 +231,7 @@ public class TextAttachmentController extends TextSendController
}
private
void
checkAllUrisLoaded
()
{
if
(!
loadingUris
)
throw
new
AssertionError
();
if
(
urisLoaded
==
imageUris
.
size
())
{
loadingUris
=
false
;
// all images were turned into attachments
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment