Commit graph

4476 commits

Author SHA1 Message Date
Greyson Parrelli
c015687951 Updated language translations. 2019-08-23 10:01:06 -04:00
Alan Evans
1bd1e9cc65 Read optional video display dimensions.
Add RequiresApi annotations.

Fixes #8982
2019-08-22 10:15:56 -04:00
Alan Evans
c4a4374465 RTL screen animations.
RTL fix Profile name in Settings.
2019-08-22 10:15:56 -04:00
Alan Evans
90681d47f8 Fix first item sticky header. 2019-08-22 10:15:56 -04:00
Alan Evans
936be693ce Enlarge some home touch targets and add search content description. 2019-08-22 10:15:56 -04:00
Alan Evans
a32b875587 Support disabled animations for accessibility. 2019-08-22 10:15:56 -04:00
Alan Evans
4e6798e38e Fix occasional double scroll bar on fast scroller. 2019-08-22 10:15:56 -04:00
Alan Evans
6352f7baf4 Update item design in contact selection. 2019-08-22 10:15:56 -04:00
Alan Evans
aac9725adc Move shared attachment job generation code to parent class. 2019-08-22 10:15:56 -04:00
Alan Evans
900371bb30 Call answer button listens to accessibility changes. 2019-08-22 10:15:56 -04:00
Alan Evans
a58f564d1e Escape string within Full Text Search.
Fixes #8975
2019-08-22 10:15:56 -04:00
Alan Evans
942154a61f Separate compression job. 2019-08-22 10:04:23 -04:00
Curt Brune
7f0a7b0c13 Add ringrtc support
Initial commit of the RingRTC Java interface implementation.

The implementation lives in an external .aar with the package
org.signal.ringrtc.

The package provides two high level objects of interest
=======================================================

org.signal.ringrtc.CallConnection -- represents the session of a call,
very similar to WebRTC's PeerConnection.

org.signal.ringrtc.CallConnectionFactory -- creates CallConnection
objects, very similar to WebRTC's PeerConnectionFactory.

The implementation interfaces with the Android application in a few
places:
==================================================================

src/org/thoughtcrime/securesms/ApplicationContext.java -- RingRTC
library initialization at application startup.

src/org/thoughtcrime/securesms/service/WebRtcCallService.java -- Call
creation and state machine.

src/org/thoughtcrime/securesms/ringrtc -- this package implements
interface classes needed by ringrtc and a CallConnectionWrapper helper
class.

The two interfaces needed so far are:

  ringrtc/Logger.java
  ringrtc/SignalMessageRecipient.java

The logger is self-explanatory, but SignalMessageRecipient is a little
more involved.  SignalMessageRecipient encapsulates the Signal-Android
notion of "Recipient" and the mechanism for sending Signal Messages
related to audio/video calling.

The CallConnectionWrapper class is clone of the original
org.thoughtcrime.securesms.webrtc.PeerConnectionWrapper, suitably
modified to match the CallConnection interface.

This class continues to handle the Camera switching APIs, with that
portion of the code remaining unmodified from the original.

CallConnectionFactory Details
=============================

The primary public methods:

initialize() -- initialize the WebRTC library and RingRTC library.
The WebRTC initialization is lifted from the original Signal-Android
code.

createCallConnectionFactory() -- creates a CallConnectionFactory
object.  Internally it creates a WebRTC PeerConnectionFactory object
and a RingRTC CallConnectionFactory object.

dispose() -- tears down the CallConnectionFactory object, including
the internal PeerConnectionFactory and RingRTC CallConnectionFactory.

createCallConnection() -- creates a CallConnection object, connecting
that with an application controlled CallConnection.Observer object.

This function takes a CallConnection.Configuration object to link the
CallConnection object with some application provided services, like
sending Signal protocol messages.

CallConnection Details
======================

This object is a subclass of WebRTC's PeerConnection class.

The primary public methods and objects:

CallConnection.Configuration
----------------------------

Configuration object used to parameterize a call.  Notable members:

- SignalServiceMessageSender messageSender
- long callId
- org.signal.SignalMessageRecipient recipient

The 'accountManager' is used to fetch public information from the Signal
service, specifically used here to obtain the public Signal TURN
server details.

The 'callId' is a 64-bit pseudo-random number generated when the call
is initiated, used to identify the call through out its lifetime.

The "recipient' is an implementation of the
org.signal.SignalMessageRecipient interface, which encapsulates the
sending of Signal service messages to a recipient (remote peer) using
existing Signal protocol data structures.

The native library needs to be able to send Signal messages via the
service, but it does not have a native implementation to do so.
Instead the native code calls out to the client for sending Signal
messages.  To accomplish this, the client implements the
org.signal.SignalMessageRecipient interface and passes an instance of
that in a CallConnection.Configuration object.

CallConnection
--------------

dispose() -- tears down the CallConnection object, including the
internal PeerConnection and RingRTC CallConnection.

sendOffer() -- initiates a call to a remote recipient.  This is the
beginning of an outbound call.

validateResponse() -- checks an offer response recipient against the
originating call details.

handleOfferAnswer() -- handles the receipt of answer, which was a
response from an originating offer.

acceptOffer() -- accept an offer from a remote participant.  This is
the begin of an incoming call.

answerCall() -- invoked when the call is completely established and
online.

hangUp() -- hang up the connection and shut things done.  This is the
end of the call.

sendBusy() -- send the remote side an indication that the local side
is already in a call and the line is busy.

sendVideoStatus() -- send the current state of the local camera video
stream to the remote side.

CallConnection.Observer
-----------------------

Observer object, used by the RingRTC library to notify the client
application of important events and status changes.  Similar in spirit
to WebRTC's PeerConnection.Observer.

Observer callbacks come in three flavors:

- state change notifications,
- on stream notifications
- errors conditions

For state notifications, the callback contains the callId, the
recipient and a CallConnection.CallEvent type.

For streams, the callback contains the callId, the
recipient and a org.webrtc.MediaStream.

For errors, the callback contains the callId, the recipient and an
exception type.  The currently thrown exceptions include:

- UntrustedIdentityException
- UnregisteredUserException
- IOException

Signed-off-by: Curt Brune <curt@signal.org>

Updates to support ringrtc-android version 0.1.0.

* simplify logging interface

It is no longer necessary for the application to specify a Log object
as the library can log via the NDK directly.

* improve error handling and notification

In a number of places where ringrtc errors could occur, no
notification was ever sent to the user, nor was the UI cleaned up.  It
would look like the app was in hung state.

This patch updates these situations to send the WebRtcViewModel a
NETWORK_FAILURE message.

* update handleIncomingCall() for lockManager and notification

During the conversion to RingRTC, the implementation of
handleIncomingCall() missed a couple of things:

-- updating the Phone state with the lockManager
-- sending a message to the viewModel

* log the callId in various handler methods

For debugging purposes it is very handy to have the callId present in
the log during the various call handler methods.

Signed-off-by: Curt Brune <curt@signal.org>
2019-08-22 10:04:23 -04:00
Alan Evans
37bcac40bb URL encoded scrubber.
* Replace scrubber and tests.

* Improves email regex performance.
2019-08-22 10:04:23 -04:00
Greyson Parrelli
02ea99254a Reset message receiver upon REST failure.
We've been seeing a lot of socket timeouts on REST requests under
certain conditions. The issue seems to be a problem with the OkHttp
client. Through testing, I've seen that resetting the receiver and
retrying again seems to resolve most issues.
2019-08-22 10:04:23 -04:00
Greyson Parrelli
3849b46f0a Refactor ApplicationDependencies. 2019-08-22 10:04:23 -04:00
Greyson Parrelli
116bd41c63 Use EmojiTextView in the sticker preview. 2019-08-22 10:04:23 -04:00
Greyson Parrelli
457ad4c607 Added a central system for message retrieval. 2019-08-22 10:04:23 -04:00
Greyson Parrelli
d0a9bd4c6d Create a new system for application-level migrations. 2019-08-22 10:04:23 -04:00
Greyson Parrelli
d3bed549f2 Switch back to storing incoming messages in PushDatabase.
On a Pixel 3, this adds ~30-40ms of delay, but it's going to be a
requirement for upcoming migrations.
2019-08-22 10:04:23 -04:00
Alan Evans
fe1aa016b9 Refactor group operations. 2019-08-22 10:04:17 -04:00
Greyson Parrelli
af55cb0c03 Bump version to 4.45.2 2019-08-05 15:48:22 -04:00
Greyson Parrelli
714eaa62a8 Updated language translations. 2019-08-05 15:48:22 -04:00
Greyson Parrelli
5038f49487 Fix issue with sticker preview sizing. 2019-08-05 15:48:22 -04:00
Greyson Parrelli
57835dc8f1 Update view-once message behavior. 2019-08-05 15:46:43 -04:00
Alan Evans
3439eb4536 Replace disk icon with download icon. 2019-08-05 12:13:15 -04:00
Alan Evans
929ee04814
Handle missing video duration.
On EncodingException, or no duration metadata found, when video < 100MB, continue with send.
2019-08-05 10:48:18 -04:00
Greyson Parrelli
9d98a779a8 Bump version to 4.45.1 2019-08-02 17:01:11 -04:00
Greyson Parrelli
5a23ddeaf4 Updated language translations. 2019-08-02 17:01:11 -04:00
Greyson Parrelli
7ae5159194 Downgrade some job exceptions.
Runtime exceptions were being thrown where it'd be safer to either
ignore it or throw a checked, failing exception.
2019-08-02 17:00:48 -04:00
Alan Evans
bdf93af3db
Clear outstanding glide requests.
Fixes #8967
2019-08-02 16:00:22 -04:00
Alan Evans
dcc147d994
Reduce frame timeout crashes. 2019-08-02 15:57:20 -04:00
Greyson Parrelli
19b2658414 Fix Job.Result logging. 2019-08-01 16:42:59 -04:00
Greyson Parrelli
1c4833f3b4 Bump version to 4.45.0 2019-08-01 10:40:52 -04:00
Greyson Parrelli
e8ca673bf8 Updated language translations. 2019-08-01 10:40:52 -04:00
Alan Evans
5a614faee1 Camera content descriptions and allow camera capture in talk back. 2019-08-01 10:40:52 -04:00
Greyson Parrelli
af8042c5f4 Use proper icon and theme for camera button. 2019-08-01 10:40:52 -04:00
Greyson Parrelli
a46e7541d0 Switch from contentUris to fileUris in the media gallery.
Android Q encounters massive slowdown when using contentUris for media.
Switching to fileUris (which we're already doing for the folder
thumbnail) gets us back to the expected performance level.
2019-08-01 10:40:37 -04:00
Alan Evans
a6890fc8dd Video playback on TextureView and DepthPageTransformer. 2019-08-01 08:45:29 -04:00
Alan Evans
0c0d7aeead Remove old pre-v9, pre-v11, and pre-v12 assets. 2019-08-01 08:45:29 -04:00
Ellen Poe
874697f6e5 Added content descriptions for some important controls.
Fixes #8728

Co-authored-by: Alan Evans <alan@signal.org>
2019-08-01 08:45:29 -04:00
Alan Evans
e0d1987445 Accessible call answering/rejecting and content descriptions. 2019-08-01 08:45:29 -04:00
Greyson Parrelli
17400020b7 Allow RuntimeExceptions thrown by Jobs to crash. 2019-07-31 09:54:46 -04:00
Alan Evans
e8e80e5d05 Transcode video during attachment upload. 2019-07-31 09:54:46 -04:00
Alan Evans
f9946083dd Video transcoding. 2019-07-30 14:09:33 -04:00
Greyson Parrelli
453f93a84f Bump version to 4.44.7 2019-07-28 10:20:38 -04:00
Greyson Parrelli
a8c47b5091 Guard media reads with a permissions check. 2019-07-28 10:20:04 -04:00
Greyson Parrelli
78a818eba6 Bump version to 4.44.6 2019-07-28 10:05:58 -04:00
Greyson Parrelli
4ca90374b9 Fix bug displaying an empty camera contacts search result. 2019-07-28 10:05:22 -04:00
Greyson Parrelli
a5fbcffa14 Bump version to 4.44.5 2019-07-26 15:38:10 -04:00