CallIncoming: fix bug on call acceptance due to invalid order

This commit is contained in:
Gautier Pelloux-Prayer 2016-01-22 10:24:05 +01:00
parent 06be92c325
commit 723dd16516
4 changed files with 64 additions and 80 deletions

View file

@ -512,6 +512,68 @@
<rect key="frame" x="0.0" y="1185" width="800" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<view tag="56" contentMode="scaleToFill" id="8q9-3P-Fz0" userLabel="lowerBar">
<rect key="frame" x="0.0" y="0.0" width="400" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" tag="57" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="SRu-dB-r3e" userLabel="numpadButton" customClass="UIToggleButton">
<rect key="frame" x="0.0" y="0.0" width="100" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Back"/>
<state key="normal" image="footer_dialer_default.png" backgroundImage="color_C.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="footer_dialer_disabled.png"/>
<state key="selected" image="dialer_alt_back.png"/>
<state key="highlighted" backgroundImage="color_A.png"/>
<connections>
<action selector="onNumpadClick:" destination="-1" eventType="touchUpInside" id="pFD-jh-GhK"/>
</connections>
</button>
<button opaque="NO" tag="58" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Xpw-A4-BZO" userLabel="hangupButton" customClass="UIHangUpButton">
<rect key="frame" x="100" y="0.0" width="200" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Hangup"/>
<state key="normal" image="call_hangup_default.png" backgroundImage="color_D.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" backgroundImage="color_I.png"/>
</button>
<button opaque="NO" tag="59" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="t7u-65-OPV" userLabel="chatButton" customClass="UIIconButton">
<rect key="frame" x="300" y="0.0" width="100" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Hangup"/>
<state key="normal" image="footer_chat_default.png" backgroundImage="color_C.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" backgroundImage="color_A.png"/>
<connections>
<action selector="onChatClick:" destination="-1" eventType="touchUpInside" id="Jdk-1s-UnN"/>
</connections>
</button>
<view hidden="YES" autoresizesSubviews="NO" userInteractionEnabled="NO" tag="70" contentMode="scaleToFill" id="d9Y-2a-CDI" userLabel="chatNotificationView" customClass="UIBouncingView">
<rect key="frame" x="353" y="8" width="44" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="71" contentMode="scaleAspectFit" image="history_chat_indicator.png" id="nPO-PM-4zJ" userLabel="chatNotificationImage">
<rect key="frame" x="0.0" y="0.0" width="21" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="72" contentMode="left" text="99" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" id="Saa-p5-chV" userLabel="chatNotificationLabel">
<rect key="frame" x="0.0" y="0.0" width="21" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Missed message(s)">
<accessibilityTraits key="traits" none="YES"/>
</accessibility>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</subviews>
</view>
<view tag="48" contentMode="scaleToFill" id="OIH-ek-VgL" userLabel="higherBar">
<rect key="frame" x="400" y="0.0" width="400" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -595,68 +657,6 @@
</button>
</subviews>
</view>
<view tag="56" contentMode="scaleToFill" id="8q9-3P-Fz0" userLabel="lowerBar">
<rect key="frame" x="0.0" y="0.0" width="400" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" tag="57" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="SRu-dB-r3e" userLabel="numpadButton" customClass="UIToggleButton">
<rect key="frame" x="0.0" y="0.0" width="100" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Back"/>
<state key="normal" image="footer_dialer_default.png" backgroundImage="color_C.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="footer_dialer_disabled.png"/>
<state key="selected" image="dialer_alt_back.png"/>
<state key="highlighted" backgroundImage="color_A.png"/>
<connections>
<action selector="onNumpadClick:" destination="-1" eventType="touchUpInside" id="pFD-jh-GhK"/>
</connections>
</button>
<button opaque="NO" tag="58" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Xpw-A4-BZO" userLabel="hangupButton" customClass="UIHangUpButton">
<rect key="frame" x="100" y="0.0" width="200" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Hangup"/>
<state key="normal" image="call_hangup_default.png" backgroundImage="color_D.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" backgroundImage="color_I.png"/>
</button>
<button opaque="NO" tag="59" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="t7u-65-OPV" userLabel="chatButton" customClass="UIIconButton">
<rect key="frame" x="300" y="0.0" width="100" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Hangup"/>
<state key="normal" image="footer_chat_default.png" backgroundImage="color_C.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" backgroundImage="color_A.png"/>
<connections>
<action selector="onChatClick:" destination="-1" eventType="touchUpInside" id="Jdk-1s-UnN"/>
</connections>
</button>
<view hidden="YES" autoresizesSubviews="NO" userInteractionEnabled="NO" tag="70" contentMode="scaleToFill" id="d9Y-2a-CDI" userLabel="chatNotificationView" customClass="UIBouncingView">
<rect key="frame" x="353" y="8" width="44" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="71" contentMode="scaleAspectFit" image="history_chat_indicator.png" id="nPO-PM-4zJ" userLabel="chatNotificationImage">
<rect key="frame" x="0.0" y="0.0" width="21" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="72" contentMode="left" text="99" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" id="Saa-p5-chV" userLabel="chatNotificationLabel">
<rect key="frame" x="0.0" y="0.0" width="21" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Missed message(s)">
<accessibilityTraits key="traits" none="YES"/>
</accessibility>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</subviews>
</view>
</subviews>
</view>
</subviews>
@ -833,7 +833,7 @@
<color key="backgroundColor" red="0.2666666667" green="0.2666666667" blue="0.2666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<tableView clipsSubviews="YES" tag="23" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="grouped" allowsSelection="NO" rowHeight="50" sectionHeaderHeight="1" sectionFooterHeight="1" id="Yha-y8-ihb" userLabel="pausedCallsTableView">
<rect key="frame" x="0.0" y="645" width="646" height="50"/>
<rect key="frame" x="0.0" y="645" width="400" height="50"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="separatorColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>

View file

@ -82,7 +82,6 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)callUpdate:(LinphoneCall *)acall state:(LinphoneCallState)astate {
if (_call == acall && (astate == LinphoneCallEnd || astate == LinphoneCallError)) {
[_delegate incomingCallAborted:_call];
[self dismiss];
} else if ([LinphoneManager.instance lpConfigBoolForKey:@"auto_answer"]) {
LinphoneCallState state = linphone_call_get_state(_call);
if (state == LinphoneCallIncomingReceived) {
@ -94,12 +93,6 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark -
- (void)dismiss {
if ([[PhoneMainView.instance currentView] equal:CallIncomingView.compositeViewDescription]) {
[PhoneMainView.instance popCurrentView];
}
}
- (void)update {
const LinphoneAddress *addr = linphone_call_get_remote_address(_call);
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
@ -123,17 +116,14 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - Action Functions
- (IBAction)onAcceptClick:(id)event {
[self dismiss];
[_delegate incomingCallAccepted:_call evenWithVideo:YES];
}
- (IBAction)onDeclineClick:(id)event {
[self dismiss];
[_delegate incomingCallDeclined:_call];
}
- (IBAction)onAcceptAudioOnlyClick:(id)sender {
[self dismiss];
[_delegate incomingCallAccepted:_call evenWithVideo:NO];
}

View file

@ -303,12 +303,6 @@ static RootViewManager *rootViewManagerInstance = nil;
LinphoneCallState state = [[notif.userInfo objectForKey:@"state"] intValue];
NSString *message = [notif.userInfo objectForKey:@"message"];
// Don't handle call state during incoming call view
if ([[self currentView] equal:CallIncomingView.compositeViewDescription] && state != LinphoneCallError &&
state != LinphoneCallEnd) {
return;
}
switch (state) {
case LinphoneCallIncomingReceived:
case LinphoneCallIncomingEarlyMedia: {

@ -1 +1 @@
Subproject commit ba58c9f03851e8381d781a38d93911d025bf9271
Subproject commit d3fb4b4046faae660378af9370db0c6f64b3cfce