Commit graph

38 commits

Author SHA1 Message Date
Michael Kirk 3b4188f34b hoist audio session singleton to Environment 2018-10-24 07:46:25 -06:00
Michael Kirk d6a6024f37 Update PromiseKit 2018-10-13 16:04:20 -06:00
Matthew Chen 5b50e81b4f Rename fail macros in Swift. 2018-08-27 10:27:48 -04:00
Matthew Chen cf6f3841a8 Apply new Swift logging. 2018-08-27 10:02:28 -04:00
Michael Kirk 82e559d11b Use swift macros for main thread assert 2018-08-23 10:29:49 -06:00
Matthew Chen 26001e49d1 Unify log tags. 2018-08-15 10:24:29 -04:00
Matthew Chen 6caa5b87b6 Add more asserts around thread in SAE. 2018-04-13 14:59:38 -04:00
Michael Kirk ec9538a3e4 Fix 2fa registration screen layout
Don't obscure message text on smaller form factors

Also, disable overzealous assert with non-callkit adapters. The adapter
is not a singleton, it gets rebuilt whenever call related privacy
settings are triggered.

// FREEBIE
2018-03-07 11:55:57 -05:00
Michael Kirk 707ab5f5a8 Minimize changes around call audio activity
// FREEBIE
2018-02-16 14:00:15 -08:00
Michael Kirk 4dd1c7813a Instrument calls to ensure audio session is maintained
// FREEBIE
2018-02-16 14:00:15 -08:00
Michael Kirk abb51b565a Don't de-activate audio sesion when other audio activities are happening
// FREEBIE
2018-02-16 14:00:15 -08:00
Michael Kirk c646f76335 Garther audio concerns, clean up session when done
- sync speakerphone state manipulated from system call screen
  - Revert audio session after call failure, ensures media plays out of
    speaker after placing a failing call.
  - Replace notification with delegate pattern since we're already using
    delegate pattern here.
- Fixes voiceover accessibility after voice memo
- Avoid audio blip after pressing hangup
- Rename CallAudioSession -> OWSAudioSession
  Going to start using it for other non-call things since we want to
  gather all our audio session concerns.
- Resume background audio when done playing video
  - Extract OWSVideoPlayer which ensures audio is in proper state before
    playback
  - Move recording session logic to shared OWSAudioSession
  - Deactivate audio session when complete

// FREEBIE
2018-02-06 18:45:51 -08:00
Matthew Chen 7a1e47cd26 Add asserts around Swift singletons. 2017-12-07 13:57:45 -05:00
Matthew Chen 8cc33b3de1 Refine loading view of share extension. 2017-12-01 10:48:18 -05:00
Michael Kirk a11d83187b WIP: Framework-friendly - compiles but crashes on launch
// FREEBIE
2017-11-29 13:58:27 -08:00
Michael Kirk 30b50e1489 Activate audio at the proper time
// FREEBIE
2017-11-20 14:35:16 -05:00
Michael Kirk b77e331732 Unify Mute/Hold audio handling
// FREEBIE
2017-11-02 08:49:46 -04:00
Michael Kirk c7642cc628 Fix volume burst when call connects
By centralizing AudioSession management onto the AudioService, we can
avoid enabling the RTCAudioSession while we're mid-ring.

Also allows us to centralize and remove redundant audio session logic.

// FREEBIE
2017-11-02 08:49:46 -04:00
Michael Kirk 81d7f28253 Timer to ensure call screen shown
// FREEBIE
2017-08-02 19:13:46 -04:00
Matthew Chen d639d6557e Add owsFail free function for swift.
// FREEBIE
2017-07-11 16:20:20 -04:00
Michael Kirk 36c09aeb84 cleanup ahead of PR
// FREEBIE
2017-06-20 16:24:59 -04:00
Michael Kirk ff93732ed7 WIP: fix call from contacts when signal hasn't been launched yet 2017-06-20 16:17:37 -04:00
Michael Kirk 2ec893d315 Ensure we're retaining all promises to completion
// FREEBIE
2017-05-04 15:15:14 -04:00
Matthew Chen 0893930485 Handle “busy signal” appropriately.
// FREEBIE
2017-02-02 18:19:38 -05:00
Matthew Chen af289145b5 Rework concurrency in the signaling logic.
// FREEBIE
2017-02-01 09:43:16 -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 d560aa022a Reworked call view’s remote video mode. 2017-01-27 11:11:33 -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 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
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 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 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 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