Skip to content

Commit 272b50c

Browse files
nadlabakQuarx2k
authored andcommitted
call rec: prevent start of new recording during disconnection
sometimes during disconnection, call state can change like: ACTIVE > DISCONNECTING > ACTIVE > DISCONNECTED prevent a new start of call recording in such case Change-Id: Ic8756278b599fba8f14bb10966752f22650af29e
1 parent e06b5c3 commit 272b50c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/com/android/phone/CallNotifier.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,12 +912,15 @@ private void onPhoneStateChanged(AsyncResult r) {
912912
mInCallRingbackTonePlayer = null;
913913
}
914914
if (PhoneUtils.PhoneSettings.callRecordingEnabled(mApplication)) {
915-
if (callState == Call.State.ACTIVE && callState != mLastCallState) {
915+
if (callState == Call.State.ACTIVE &&
916+
callState != mLastCallState &&
917+
mLastCallState != Call.State.DISCONNECTING) {
916918
log("onPhoneStateChanged: State ACTIVE - startRecording, last state was: " + mLastCallState);
917919
Call call = PhoneUtils.getCurrentCall(fgPhone);
918920
Connection c = PhoneUtils.getConnection(fgPhone, call);
919921
PhoneUtils.startRecording(c.getAddress(), c.isIncoming() ? "in":"out");
920-
} else if (callState != Call.State.ACTIVE && mLastCallState == Call.State.ACTIVE) {
922+
} else if (callState != Call.State.ACTIVE &&
923+
mLastCallState == Call.State.ACTIVE) {
921924
log("onPhoneStateChanged: State not ACTIVE - stopRecording");
922925
PhoneUtils.stopRecording();
923926
}

0 commit comments

Comments
 (0)