Commit graph

64 commits

Author SHA1 Message Date
Matthew Chen c8e5884087 Respond to CR.
// FREEBIE
2017-01-30 15:54:31 -05:00
Matthew Chen 9a0a7bb6b1 Show alert when user tries to activate local video without camera permissions.
// FREEBIE
2017-01-30 14:08:53 -05:00
Matthew Chen da53368bc2 Show alert when user tries to activate local video without camera permissions.
// FREEBIE
2017-01-30 14:08:53 -05:00
Matthew Chen 2ef80e569d Improve thread safety in call ui adapter and adatapees.
// FREEBIE
2017-01-30 14:08:53 -05:00
Matthew Chen 50addfa4e8 Remove camera constraints.
// FREEBIE
2017-01-30 14:08:32 -05:00
Matthew Chen 6ce33381a8 Prevent screen from dimming or device from locking during video call.
// FREEBIE
2017-01-30 14:08:08 -05:00
Michael Kirk 459d0d6012 Working around a bizarre crash on iOS 9
Without this, I get a SEGFAULT on iOS 9.3 device 1 in 3 calls when
accessing the RTC extern constants. Swift bug?

Currently using XCode 8.2

// FREEBIE
2017-01-30 13:35:39 -05:00
Michael Kirk fff061ff3f Make sure WebRTC preferences are synced *every* call
This slows the UI, but only for people who have locally opted into
WebRTC calls, and the alternative is that users are likely to have stale
settings the first time a pair of people opt-in.

// FREEBIE
2017-01-27 14:33:12 -05:00
Matthew Chen d560aa022a Reworked call view’s remote video mode. 2017-01-27 11:11:33 -05:00
Matthew Chen 204aeab69c Respond to CR.
// FREEBIE
2017-01-26 17:01:31 -05:00
Matthew Chen ec1f77c630 Polish video calls.
* Send and handle messages around video status.
* Fix handling of callee data channel.
* Fix layout of local video view.

// FREEBIE
2017-01-26 16:56:35 -05:00
Matthew Chen 48ca4fe865 Respond to CR.
// FREEBIE
2017-01-26 16:41:59 -05:00
Matthew Chen a65d3b7c4e Add video-related views.
// FREEBIE
2017-01-26 16:41:59 -05:00
Michael Kirk 814aec6cdd Recover CallKit state when remote client fails to hangup
Distinguish between localHangup, remoteHangup, and call failure.

This allows us to put CallKit in the proper state, ready to receive new
calls without having a backlog of phantom calls which haven't been
properly removed.

Note the "call error" occurs at the point ICE fails, which takes a
while. Anecdotally, like 10 seconds, which feels like a long to be
talking into the ether.

I briefly considered failing at 'disconnected', which happens much
sooner, but that's actually a recoverable state. E.g. if you toggle
airplane mode you can see that you bounce into `disconnected` and then
back to `connected`, so I don't think we'd want to fail the call as long
as WebRTC considers it "recoverable".

// FREEBIE
2017-01-26 13:18:06 -05:00
Michael Kirk 6c14f2f500 Fix "Answer" from iOS9 notification doesn't init audio
The removed code was from an older eon. CallService shouldn't be touched
except via the CallUIAdapter since only there is the omnipresent
distinction between CallKit vs. NonCallKit made.

i.e. when the RTCAudioSession get's started depends on the
CallUIAdaptee.

// FREEBIE
2017-01-25 12:32:36 -05:00
Michael Kirk 333fb6c60f assert on main thread
// FREEBIE
2017-01-24 14:13:29 -05:00
Michael Kirk b2091431dc Fix retain cycle
// FREEBIE
2017-01-24 14:13:29 -05:00
Michael Kirk 87ed662116 Persist AudioService if CallViewController is dismissed
...in response to CR, move the AudioService off of the CallViewController

Adopt multiple observer pattern vs. a singular delegate. Doing so
required implementing some machinery to address the ARC (see:
Weak.swift)

// FREEBIE
2017-01-24 14:13:29 -05:00
Michael Kirk 3ee94d57d9 Only NonCallKit adaptee uses manual ringing
- stop executing ringer code on CallKit which manages ringing for us.
- Organize ringing code more clearly.

// FREEBIE
2017-01-24 12:57:02 -05:00
Michael Kirk 4c23b5e23f Remove dependency on AppAudioManager
Implement speakerphone toggle directly. Previously we were using
AppAudioManager for several things, but this is that last lingering bit.
Much of the AppAudioManager code is based on RedPhone calling, so by
removing the dependency we pave the way to throw that code away.

// FREEBIE
2017-01-24 12:57:02 -05:00
Michael Kirk 4374e431a2 Respect silent switch in and out of app.
// FREEBIE
2017-01-24 12:57:02 -05:00
Matthew Chen d4dbe7f44f Disable unused CallKit buttons.
// FREEBIE
2017-01-24 10:04:37 -05:00
Matthew Chen 229d95ecbf Respond to CR.
// FREEBIE
2017-01-24 10:02:03 -05:00
Matthew Chen 9e739433c5 Start work on video.
// FREEBIE
2017-01-23 13:41:59 -05:00
Michael Kirk dbb29d7d7e Don't require recording permissions until call is ringing.
We do this by manually managing the RTCAudioSession.
Unfortunately to do this we have to include a couple of RTC headers not
exported by the default build of WebRTC.framework (see: Libraries/WebRTC)

// FREEBIE
2017-01-17 21:49:13 -05:00
Michael Kirk 0072ee3033 Ensure a stale peerConnectionClient doesn't call any methods on the CallService
Nil delegates when terminating call

// FREEBIE
2017-01-17 20:19:55 -05:00
Michael Kirk 32789bd960 Move RTCDataChannelDelegate to PeerConnectionClient
- minimizes CallService exposure to WebRTC

// FREEBIE
2017-01-17 20:14:33 -05:00
Michael Kirk 8998853aff Move RTCPeerConnectionDelegate to PeerConnectionClient
This makes sense as PeerConnectionClient is our interface to WebRTC

- Makes it easier to test PeerConnectionClient and CallService
- Allows us to shrink CallService class a bit (it's huge)

// FREEBIE
2017-01-17 20:14:33 -05:00
Michael Kirk bd65dc6ba7 Fallback TURN servers if we can't get them from the server for some reason
// FREEBIE
2017-01-17 20:14:32 -05:00
Matthew Chen ada6da9506 Fix merge.
The changes to SignalCall must have been lost as I tried to apply swift lint to them.

// FREEBIE
2017-01-17 17:42:03 -05:00
Matthew Chen 4a65a88512 Rework new call view.
// FREEBIE
2017-01-12 15:55:14 -05:00
Michael Kirk 469bff5734 Make call delegate weak
// FREEBIE
2017-01-12 13:27:46 -05:00
Michael Kirk 1ed39976ee make public protocol method implementations public
responding to CR

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk f6e6e6b787 CallViewController only accesses CallService via the CallUIAdapter
This is an effort to better define boundaries and simplify
relationships.

This also fixes a theoretical problem where CallKit was showing the in-app
call screen before the call was successfully answered, now we wait until
the action is fulfilled.

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk fc6da05259 remove some dead code
Related to an earlier failed attempt of reconciling CallKit audio
management with WebRTC's.

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk 947a637669 Sync "mute" controls between CallKit
In the process, extracted the CallDelegate to allow the
CAllViewController to observe useful call state properties (call.state
and call.isMuted)

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk c7449db289 remove stubbed audio manager implementation until it's clear what to do
with it.

// FREEBIE
2017-01-12 09:56:09 -05:00
Michael Kirk 9e248168b9 merge CallKitProviderDelegate into CallKitCallUIAdaptee
There was not a clear distinction in responsibilities and mostly the
Adaptee was just delegating to the CKProviderDelegate
2017-01-12 09:56:09 -05:00
Michael Kirk ce3780e44a Wip smashign providerdelgate into UIAdaptee 2017-01-12 09:56:08 -05:00
Michael Kirk 6eecef99ba Promise aware Message sender
As this could be used elsewhere, ideally it'd added to the actual class
definition, but MessageSender (SSK) doesn't use PromiseKit

// FREEBIE
2017-01-12 09:56:08 -05:00
Michael Kirk f9b44c8892 Added CallService documentation
// FREEBIE
2017-01-12 09:56:08 -05:00
Michael Kirk 57ad7a2808 cleanup 2017-01-12 09:56:08 -05:00
Michael Kirk 647b2b37e9 WIP: WebRTC calling
* Ensure NotificationsManager has dependencies
    Otherwise it's easy to mess up the order of the required dependencies.
* move AccountManager into Environment, it's heavy to construct

// FREEBIE
2017-01-12 09:56:05 -05:00
Michael Kirk 9f2bb5d2cc Fixes lingering interactions after removing thread (#1297)
Most of the work was done in SignalServiceKit 0.0.7, this adapts to
those changes.

Migration to clean any orphaned interactions/attachments.

- don't set new migration version until migration was successful.
- remove dead code from migrations

- rename message.attachments->message.attachmentIds
- Remove unused parameter from GroupModel
- formatting touched method/'s signatures

//FREEBIE
2016-07-31 15:25:07 -07:00
Michael Kirk 1e0f0157c1 namespace ContactsManager -> OWSContactsManager
rename test class ContactManager->OWSContact_s_Manager
update docs

// FREEBIE
2016-06-28 08:58:29 -07:00
Frederic Jacobs 4034baedb9 Adapting to renaming. 2016-04-08 09:47:41 +02:00
Frederic Jacobs c6d44e59e2 TextSecureKit Refactoring
- Using same clang format file for old and new files.
- Moving out all TextSecure code to allow other clients (OS X, iOS) to
  integrate easily TextSecure functionality.
- Use TextSecure API to signup.
2015-12-22 23:41:10 +01:00
Frederic Jacobs f6c0625c2c Removing unused imported classes.
//FREEBIE
2015-07-27 16:19:08 +02:00
Frederic Jacobs 57f86008d1 UX and Notifications fixes
- Removes large confusing UX bar and related assets. Replaced with UISwitch.
- Enhanced user experience for missed calls.
- Fixes issue where missed call would appear as incoming call in call log.
- Fixing issues where PushKit handler not called on launch.
2015-06-07 22:38:28 +02:00
Frederic Jacobs 13448bdb2d Notifications enhancements.
- Tap to reply to a message.
- Badges application with the number of unread messages.
- Pick up a phone call from lock screen, or decline it.
- Settings for notification sounds while app in foreground and text displayed on local notifications.
2015-04-28 02:15:37 +02:00