Commit graph

71 commits

Author SHA1 Message Date
Michael Kirk 64a0c4bfaa auto-migrate to Swift5 2019-04-04 13:44:42 -06:00
Michael Kirk 1bfe691895 In app notifications for iOS10+
Extract shared notification presention/response

Implement adapters which use that logic for modern UNUserNotification and
legacy UINotifications
2019-02-01 17:44:13 -07:00
Michael Kirk ac3bbe26ba rename CallNotificationsAdapter->NotificationsAdapter 2019-02-01 17:44:13 -07:00
Michael Kirk 24f97f1229 compiler warning: discard result explicitly 2018-11-12 09:54:42 -06:00
Michael Kirk ce9ca1bdaa audio player type 2018-10-24 07:46:27 -06:00
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 b8485b19bd Merge tag '2.21.0.15' into release/2.22.0 2018-03-09 10:00:00 -05:00
Michael Kirk c5fc671c31 Fix lost call transactions after rebuilding callUIAdapter
// FREEBIE
2018-03-08 16:21:34 -05:00
Matthew Chen d6f4db1523 Rename TSStorageManager to OWSPrimaryStorage. 2018-03-06 17:12:13 -03:00
Michael Kirk 658b8c3223 CR: typos and doc changes
// FREEBIE
2018-02-26 15:19:52 -05:00
Michael Kirk 5959cdf070 Simplify call privacy settings
We've long allowed users to configure what shows up in message
notifications:

- name: content (by default)
- just name (no content)
- generic notification (no name nor content)

Now we're dual purposing that setting to apply to calls. If someone
doesn't want to show names in the message notifications, presumably also
don't want that name showing up in the call log.

Also, since the earlier CallKit/iCloud issues had been addressed before
iOS11, we upgrade all iOS11 users to the more intuitive CallKit
interface.

Also: introduce "use system call logs" toggle when available. It will be
enabled by default, but we disable it for legacy users who'd explicitly
opted *out* of CallKit.

// FREEBIE
2018-02-26 15:19:52 -05:00
Matthew Chen 5b9ab0cf5d Auto-disable CallKit privacy in iOS 11 and later. 2018-02-26 15:19:25 -05:00
Matthew Chen 32b87d0e58 Remove custom ringtones. 2018-02-26 14:47:57 -05:00
Michael Kirk e8c5509f3a Respect system contact ringtones
If CallKit privacy is enabled, we'll always use the system default
ringer.

If CallKit privacy is *not* enabled we'll use any ringtone specified in
the for that contact in the address book, else fall back to the default

// FREEBIE
2018-02-23 13:43:23 -05:00
Matthew Chen 5e8f3086de Update call sounds. 2018-02-23 12:53:43 -05:00
Matthew Chen a0f4723fa2 Update call sounds. 2018-02-23 12:53:43 -05:00
Michael Kirk 6eb1951ee6 Don't stop audio until after CallKit audio session is deactivated
// FREEBIE
2018-02-18 15:35:37 -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 b4e8df79da Migrate environment to SignalMessaging. 2017-12-05 10:29:29 -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 abb57f2a15 App icon for system call screen
On iOS10 there was a default "..." button, but now we need our own.

// FREEBIE
2017-11-20 14:04:04 -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 c4139b0f3e Callkit ringer uses profile name
Also presents formatted number instead of e164

// FREEBIE
2017-09-11 10:01:21 -04:00
Michael Kirk c6069376d8 more logging
// FREEBIE
2017-08-02 19:13:06 -04:00
Matthew Chen d639d6557e Add owsFail free function for swift.
// FREEBIE
2017-07-11 16:20:20 -04:00
Michael Kirk 2ec893d315 Ensure we're retaining all promises to completion
// FREEBIE
2017-05-04 15:15:14 -04:00
Matthew Chen f920300f28 Improve handling of call service edge cases.
// FREEBIE
2017-04-19 10:09:40 -04:00
Michael Kirk eb0399f040 Fix "Call failed" due to deadlock when immediately terminating call
It's not clear why we were ever dispatching `sync` here.

Before this:

Place a call
See "connecting..."
Hang up
UI hangs for ~5 seconds
See "call failed" on CallKit screen
Press "cancel" on CallKit screen
returned to responsive app.

// FREEBIE
2017-03-22 10:48:37 -04:00
Matthew Chen c35c118dcd Respond to CR.
// FREEBIE
2017-02-24 23:02:17 -05:00
Matthew Chen 01d2582074 Add and honor the “CallKit Privacy” setting.
// FREEBIE
2017-02-24 23:01:09 -05:00
Matthew Chen f5004b27ab Add and honor the “CallKit Privacy” setting.
// FREEBIE
2017-02-24 23:01:09 -05:00
Matthew Chen 065d383c15 Add and honor the “CallKit Privacy” setting.
// FREEBIE
2017-02-24 23:01:09 -05:00
Michael Kirk 3ab65a2c88 Prevent CallKit timeout when placing outgoing call
More fallout from the outbound call timeout which was causing all
CallKit calls not promptly answered to show "Call Failed"

Inserting the timeout exacerbated an existing issue: We can't wait for
long before choosing to fulfill/fail an action without CallKit falling
over and assuming the call failed.

We don't actually need to consider the case where we "fail to initiate"
the outgoing call. Instead we say it started "successfully, and if there
is an error, the existing promise error handling will fail the call at
that time.

// FREEBIE
2017-02-08 16:25:27 -05:00
Michael Kirk c087c56b0c Fix call timeout
- Previously only incoming calls had their timeout promise fulfilled
- Previously we'd stop the timeout once ringing started, but we
should continue the timeout clock until the users are speaking.

// FREEBIE
2017-02-08 14:25:05 -05:00
Michael Kirk 43e7defa28 Stop any lingering audio session if provider resets.
I've never actually seen this happen, but I think it makes sense.

// FREEBIE
2017-02-03 10:23:19 -05:00
Matthew Chen 0893930485 Handle “busy signal” appropriately.
// FREEBIE
2017-02-02 18:19:38 -05:00
Matthew Chen d4ba4c446b Respond to CR.
// FREEBIE
2017-02-01 14:43:47 -05:00