Loading telephony/java/com/android/internal/telephony/CallManager.java +17 −3 Original line number Diff line number Diff line Loading @@ -197,10 +197,12 @@ public final class CallManager { Phone.State s = Phone.State.IDLE; for (Phone phone : mPhones) { if (phone.getState() == Phone.State.RINGING) { return Phone.State.RINGING; if (phone.getState() == Phone.State.ANSWERING) { return Phone.State.ANSWERING; } else if (phone.getState() == Phone.State.RINGING) { s = Phone.State.RINGING; } else if (phone.getState() == Phone.State.OFFHOOK) { s = Phone.State.OFFHOOK; if (s == Phone.State.IDLE) s = Phone.State.OFFHOOK; } } return s; Loading Loading @@ -289,6 +291,18 @@ public final class CallManager { return getFirstActiveRingingCall().getPhone(); } /** * @return the first answering call */ public Call getFirstAnsweringCall() { for (Phone phone : mPhones) { if (phone.getState() == Phone.State.ANSWERING) { return phone.getForegroundCall(); } } return null; } /** * unregister phone from CallManager * @param phone Loading telephony/java/com/android/internal/telephony/Phone.java +3 −1 Original line number Diff line number Diff line Loading @@ -53,10 +53,12 @@ public interface Phone { * <li>OFFHOOK = The phone is off hook. At least one call * exists that is dialing, active or holding and no calls are * ringing or waiting.</li> * <li>ANSWERING = The incoming call is picked up but the * call is not established yet.</li> * </ul> */ enum State { IDLE, RINGING, OFFHOOK; IDLE, RINGING, OFFHOOK, ANSWERING; }; /** Loading telephony/java/com/android/internal/telephony/sip/SipPhone.java +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ public class SipPhone extends SipPhoneBase { } else { throw new CallStateException("phone not ringing"); } updatePhoneState(); } } Loading telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java +2 −0 Original line number Diff line number Diff line Loading @@ -549,6 +549,8 @@ abstract class SipPhoneBase extends PhoneBase { if (getRingingCall().isRinging()) { state = State.RINGING; } else if (getForegroundCall().isRinging()) { state = State.ANSWERING; } else if (getForegroundCall().isIdle() && getBackgroundCall().isIdle()) { state = State.IDLE; Loading Loading
telephony/java/com/android/internal/telephony/CallManager.java +17 −3 Original line number Diff line number Diff line Loading @@ -197,10 +197,12 @@ public final class CallManager { Phone.State s = Phone.State.IDLE; for (Phone phone : mPhones) { if (phone.getState() == Phone.State.RINGING) { return Phone.State.RINGING; if (phone.getState() == Phone.State.ANSWERING) { return Phone.State.ANSWERING; } else if (phone.getState() == Phone.State.RINGING) { s = Phone.State.RINGING; } else if (phone.getState() == Phone.State.OFFHOOK) { s = Phone.State.OFFHOOK; if (s == Phone.State.IDLE) s = Phone.State.OFFHOOK; } } return s; Loading Loading @@ -289,6 +291,18 @@ public final class CallManager { return getFirstActiveRingingCall().getPhone(); } /** * @return the first answering call */ public Call getFirstAnsweringCall() { for (Phone phone : mPhones) { if (phone.getState() == Phone.State.ANSWERING) { return phone.getForegroundCall(); } } return null; } /** * unregister phone from CallManager * @param phone Loading
telephony/java/com/android/internal/telephony/Phone.java +3 −1 Original line number Diff line number Diff line Loading @@ -53,10 +53,12 @@ public interface Phone { * <li>OFFHOOK = The phone is off hook. At least one call * exists that is dialing, active or holding and no calls are * ringing or waiting.</li> * <li>ANSWERING = The incoming call is picked up but the * call is not established yet.</li> * </ul> */ enum State { IDLE, RINGING, OFFHOOK; IDLE, RINGING, OFFHOOK, ANSWERING; }; /** Loading
telephony/java/com/android/internal/telephony/sip/SipPhone.java +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ public class SipPhone extends SipPhoneBase { } else { throw new CallStateException("phone not ringing"); } updatePhoneState(); } } Loading
telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java +2 −0 Original line number Diff line number Diff line Loading @@ -549,6 +549,8 @@ abstract class SipPhoneBase extends PhoneBase { if (getRingingCall().isRinging()) { state = State.RINGING; } else if (getForegroundCall().isRinging()) { state = State.ANSWERING; } else if (getForegroundCall().isIdle() && getBackgroundCall().isIdle()) { state = State.IDLE; Loading