Loading src/com/android/server/telecom/Call.java +10 −0 Original line number Diff line number Diff line Loading @@ -399,6 +399,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, private boolean mIsConference = false; private boolean mHadChildren = false; private final boolean mShouldAttachToExistingConnection; private Call mParentCall = null; Loading Loading @@ -1011,6 +1013,13 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, return mIsConference; } /** * @return {@code true} if this call had children at some point, {@code false} otherwise. */ public boolean hadChildren() { return mHadChildren; } public Uri getHandle() { return mHandle; } Loading Loading @@ -2476,6 +2485,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, private void addChildCall(Call call) { if (!mChildCalls.contains(call)) { mHadChildren = true; // Set the pseudo-active call to the latest child added to the conference. // See definition of mConferenceLevelActiveCall for more detail. mConferenceLevelActiveCall = call; Loading src/com/android/server/telecom/CallLogManager.java +27 −18 Original line number Diff line number Diff line Loading @@ -182,44 +182,53 @@ public final class CallLogManager extends CallsManagerListenerBase { /** * Log newly disconnected calls only if all of below conditions are met: * 1) Call was NOT in the "choose account" phase when disconnected * 2) Call is NOT a conference call * 3) Call is NOT simulating a single party conference. * 4) Call was NOT explicitly canceled, except for disconnecting from a conference. * 5) Call is NOT an external call * 6) Call is NOT disconnected because of merging into a conference. * 7) Call is NOT a self-managed call OR call is a self-managed call which has indicated it * Call was NOT in the "choose account" phase when disconnected * Call is NOT a conference call which had children (unless it was remotely hosted). * Call is NOT a child call from a conference which was remotely hosted. * Call is NOT simulating a single party conference. * Call was NOT explicitly canceled, except for disconnecting from a conference. * Call is NOT an external call * Call is NOT disconnected because of merging into a conference. * Call is NOT a self-managed call OR call is a self-managed call which has indicated it * should be logged in its PhoneAccount */ private boolean shouldLogDisconnectedCall(Call call, int oldState, boolean isCallCanceled) { // 1) "Choose account" phase when disconnected @VisibleForTesting public boolean shouldLogDisconnectedCall(Call call, int oldState, boolean isCallCanceled) { // "Choose account" phase when disconnected if (oldState == CallState.SELECT_PHONE_ACCOUNT) { return false; } // 2) A conference call if (call.isConference()) { // A conference call which had children should not be logged, unless it was remotely hosted. if (call.isConference() && call.hadChildren() && !call.hasProperty(Connection.PROPERTY_REMOTELY_HOSTED)) { return false; } // A child call of a conference which was remotely hosted; these didn't originate on this // device and should not be logged. if (call.getParentCall() != null && call.hasProperty(Connection.PROPERTY_REMOTELY_HOSTED)) { return false; } DisconnectCause cause = call.getDisconnectCause(); if (isCallCanceled) { // 3) No log when disconnecting to simulate a single party conference. // No log when disconnecting to simulate a single party conference. if (cause != null && DisconnectCause.REASON_EMULATING_SINGLE_CALL.equals(cause.getReason())) { return false; } // 4) Explicitly canceled // Explicitly canceled // Conference children connections only have CAPABILITY_DISCONNECT_FROM_CONFERENCE. // Log them when they are disconnected from conference. return Connection.can(call.getConnectionCapabilities(), Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE); } // 5) An external call // An external call if (call.isExternalCall()) { return false; } // 6) Call merged into conferences. // Call merged into conferences. if (cause != null && android.telephony.DisconnectCause.toString( android.telephony.DisconnectCause.IMS_MERGED_SUCCESSFULLY) .equals(cause.getReason())) { Loading @@ -229,7 +238,7 @@ public final class CallLogManager extends CallsManagerListenerBase { boolean shouldCallSelfManagedLogged = call.isLoggedSelfManaged() && (call.getHandoverState() == HandoverState.HANDOVER_NONE || call.getHandoverState() == HandoverState.HANDOVER_COMPLETE); // 7) Call is NOT a self-managed call OR call is a self-managed call which has indicated it // Call is NOT a self-managed call OR call is a self-managed call which has indicated it // should be logged in its PhoneAccount return !call.isSelfManaged() || shouldCallSelfManagedLogged; } Loading src/com/android/server/telecom/CallsManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -2814,6 +2814,8 @@ public class CallsManager extends Call.ListenerBase setCallState(call, Call.getStateFromConnectionState(parcelableConference.getState()), "new conference call"); call.setHandle(parcelableConference.getHandle(), parcelableConference.getHandlePresentation()); call.setConnectionCapabilities(parcelableConference.getConnectionCapabilities()); call.setConnectionProperties(parcelableConference.getConnectionProperties()); call.setVideoState(parcelableConference.getVideoState()); Loading src/com/android/server/telecom/DefaultDialerCache.java +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.IndentingPrintWriter; import java.util.Objects; import java.util.concurrent.Executor; import java.util.function.IntConsumer; public class DefaultDialerCache { public interface DefaultDialerManagerAdapter { Loading Loading @@ -192,6 +194,10 @@ public class DefaultDialerCache { return getDefaultDialerApplication(mContext.getUserId()); } public void observeDefaultDialerApplication(Executor executor, IntConsumer observer) { mRoleManagerAdapter.observeDefaultDialerApp(executor, observer); } public boolean isDefaultOrSystemDialer(String packageName, int userId) { String defaultDialer = getDefaultDialerApplication(userId); return Objects.equals(packageName, defaultDialer) Loading src/com/android/server/telecom/PhoneAccountRegistrar.java +20 −5 Original line number Diff line number Diff line Loading @@ -472,17 +472,32 @@ public class PhoneAccountRegistrar { if (userHandle == null) { userHandle = call.getTargetPhoneAccount().getUserHandle(); } int subId = getSubscriptionIdForPhoneAccount(call.getTargetPhoneAccount()); PhoneAccountHandle targetPhoneAccount = call.getTargetPhoneAccount(); Log.d(this, "getSimCallManagerFromCall: callId=%s, targetPhac=%s", call.getId(), targetPhoneAccount); return getSimCallManagerFromHandle(targetPhoneAccount,userHandle); } /** * Given a target phone account and user, determines the sim call manager (if any) which is * associated with that {@link PhoneAccountHandle}. * @param targetPhoneAccount The target phone account to check. * @param userHandle The user handle. * @return The {@link PhoneAccountHandle} of the connection manager. */ public PhoneAccountHandle getSimCallManagerFromHandle(PhoneAccountHandle targetPhoneAccount, UserHandle userHandle) { int subId = getSubscriptionIdForPhoneAccount(targetPhoneAccount); if (SubscriptionManager.isValidSubscriptionId(subId) && subId != SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) { PhoneAccountHandle callManagerHandle = getSimCallManager(subId, userHandle); Log.d(this, "getSimCallManagerFromCall: callId=%s, targetPhac=%s, subId=%d, scm=%s", call.getId(), call.getTargetPhoneAccount(), subId, callManagerHandle); Log.d(this, "getSimCallManagerFromHandle: targetPhac=%s, subId=%d, scm=%s", targetPhoneAccount, subId, callManagerHandle); return callManagerHandle; } else { PhoneAccountHandle callManagerHandle = getSimCallManager(userHandle); Log.d(this, "getSimCallManagerFromCall: callId=%s, targetPhac=%s, subId(d)=%d, scm=%s", call.getId(), call.getTargetPhoneAccount(), subId, callManagerHandle); Log.d(this, "getSimCallManagerFromHandle: targetPhac=%s, subId(d)=%d, scm=%s", targetPhoneAccount, subId, callManagerHandle); return callManagerHandle; } } Loading Loading
src/com/android/server/telecom/Call.java +10 −0 Original line number Diff line number Diff line Loading @@ -399,6 +399,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, private boolean mIsConference = false; private boolean mHadChildren = false; private final boolean mShouldAttachToExistingConnection; private Call mParentCall = null; Loading Loading @@ -1011,6 +1013,13 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, return mIsConference; } /** * @return {@code true} if this call had children at some point, {@code false} otherwise. */ public boolean hadChildren() { return mHadChildren; } public Uri getHandle() { return mHandle; } Loading Loading @@ -2476,6 +2485,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, private void addChildCall(Call call) { if (!mChildCalls.contains(call)) { mHadChildren = true; // Set the pseudo-active call to the latest child added to the conference. // See definition of mConferenceLevelActiveCall for more detail. mConferenceLevelActiveCall = call; Loading
src/com/android/server/telecom/CallLogManager.java +27 −18 Original line number Diff line number Diff line Loading @@ -182,44 +182,53 @@ public final class CallLogManager extends CallsManagerListenerBase { /** * Log newly disconnected calls only if all of below conditions are met: * 1) Call was NOT in the "choose account" phase when disconnected * 2) Call is NOT a conference call * 3) Call is NOT simulating a single party conference. * 4) Call was NOT explicitly canceled, except for disconnecting from a conference. * 5) Call is NOT an external call * 6) Call is NOT disconnected because of merging into a conference. * 7) Call is NOT a self-managed call OR call is a self-managed call which has indicated it * Call was NOT in the "choose account" phase when disconnected * Call is NOT a conference call which had children (unless it was remotely hosted). * Call is NOT a child call from a conference which was remotely hosted. * Call is NOT simulating a single party conference. * Call was NOT explicitly canceled, except for disconnecting from a conference. * Call is NOT an external call * Call is NOT disconnected because of merging into a conference. * Call is NOT a self-managed call OR call is a self-managed call which has indicated it * should be logged in its PhoneAccount */ private boolean shouldLogDisconnectedCall(Call call, int oldState, boolean isCallCanceled) { // 1) "Choose account" phase when disconnected @VisibleForTesting public boolean shouldLogDisconnectedCall(Call call, int oldState, boolean isCallCanceled) { // "Choose account" phase when disconnected if (oldState == CallState.SELECT_PHONE_ACCOUNT) { return false; } // 2) A conference call if (call.isConference()) { // A conference call which had children should not be logged, unless it was remotely hosted. if (call.isConference() && call.hadChildren() && !call.hasProperty(Connection.PROPERTY_REMOTELY_HOSTED)) { return false; } // A child call of a conference which was remotely hosted; these didn't originate on this // device and should not be logged. if (call.getParentCall() != null && call.hasProperty(Connection.PROPERTY_REMOTELY_HOSTED)) { return false; } DisconnectCause cause = call.getDisconnectCause(); if (isCallCanceled) { // 3) No log when disconnecting to simulate a single party conference. // No log when disconnecting to simulate a single party conference. if (cause != null && DisconnectCause.REASON_EMULATING_SINGLE_CALL.equals(cause.getReason())) { return false; } // 4) Explicitly canceled // Explicitly canceled // Conference children connections only have CAPABILITY_DISCONNECT_FROM_CONFERENCE. // Log them when they are disconnected from conference. return Connection.can(call.getConnectionCapabilities(), Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE); } // 5) An external call // An external call if (call.isExternalCall()) { return false; } // 6) Call merged into conferences. // Call merged into conferences. if (cause != null && android.telephony.DisconnectCause.toString( android.telephony.DisconnectCause.IMS_MERGED_SUCCESSFULLY) .equals(cause.getReason())) { Loading @@ -229,7 +238,7 @@ public final class CallLogManager extends CallsManagerListenerBase { boolean shouldCallSelfManagedLogged = call.isLoggedSelfManaged() && (call.getHandoverState() == HandoverState.HANDOVER_NONE || call.getHandoverState() == HandoverState.HANDOVER_COMPLETE); // 7) Call is NOT a self-managed call OR call is a self-managed call which has indicated it // Call is NOT a self-managed call OR call is a self-managed call which has indicated it // should be logged in its PhoneAccount return !call.isSelfManaged() || shouldCallSelfManagedLogged; } Loading
src/com/android/server/telecom/CallsManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -2814,6 +2814,8 @@ public class CallsManager extends Call.ListenerBase setCallState(call, Call.getStateFromConnectionState(parcelableConference.getState()), "new conference call"); call.setHandle(parcelableConference.getHandle(), parcelableConference.getHandlePresentation()); call.setConnectionCapabilities(parcelableConference.getConnectionCapabilities()); call.setConnectionProperties(parcelableConference.getConnectionProperties()); call.setVideoState(parcelableConference.getVideoState()); Loading
src/com/android/server/telecom/DefaultDialerCache.java +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.IndentingPrintWriter; import java.util.Objects; import java.util.concurrent.Executor; import java.util.function.IntConsumer; public class DefaultDialerCache { public interface DefaultDialerManagerAdapter { Loading Loading @@ -192,6 +194,10 @@ public class DefaultDialerCache { return getDefaultDialerApplication(mContext.getUserId()); } public void observeDefaultDialerApplication(Executor executor, IntConsumer observer) { mRoleManagerAdapter.observeDefaultDialerApp(executor, observer); } public boolean isDefaultOrSystemDialer(String packageName, int userId) { String defaultDialer = getDefaultDialerApplication(userId); return Objects.equals(packageName, defaultDialer) Loading
src/com/android/server/telecom/PhoneAccountRegistrar.java +20 −5 Original line number Diff line number Diff line Loading @@ -472,17 +472,32 @@ public class PhoneAccountRegistrar { if (userHandle == null) { userHandle = call.getTargetPhoneAccount().getUserHandle(); } int subId = getSubscriptionIdForPhoneAccount(call.getTargetPhoneAccount()); PhoneAccountHandle targetPhoneAccount = call.getTargetPhoneAccount(); Log.d(this, "getSimCallManagerFromCall: callId=%s, targetPhac=%s", call.getId(), targetPhoneAccount); return getSimCallManagerFromHandle(targetPhoneAccount,userHandle); } /** * Given a target phone account and user, determines the sim call manager (if any) which is * associated with that {@link PhoneAccountHandle}. * @param targetPhoneAccount The target phone account to check. * @param userHandle The user handle. * @return The {@link PhoneAccountHandle} of the connection manager. */ public PhoneAccountHandle getSimCallManagerFromHandle(PhoneAccountHandle targetPhoneAccount, UserHandle userHandle) { int subId = getSubscriptionIdForPhoneAccount(targetPhoneAccount); if (SubscriptionManager.isValidSubscriptionId(subId) && subId != SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) { PhoneAccountHandle callManagerHandle = getSimCallManager(subId, userHandle); Log.d(this, "getSimCallManagerFromCall: callId=%s, targetPhac=%s, subId=%d, scm=%s", call.getId(), call.getTargetPhoneAccount(), subId, callManagerHandle); Log.d(this, "getSimCallManagerFromHandle: targetPhac=%s, subId=%d, scm=%s", targetPhoneAccount, subId, callManagerHandle); return callManagerHandle; } else { PhoneAccountHandle callManagerHandle = getSimCallManager(userHandle); Log.d(this, "getSimCallManagerFromCall: callId=%s, targetPhac=%s, subId(d)=%d, scm=%s", call.getId(), call.getTargetPhoneAccount(), subId, callManagerHandle); Log.d(this, "getSimCallManagerFromHandle: targetPhac=%s, subId(d)=%d, scm=%s", targetPhoneAccount, subId, callManagerHandle); return callManagerHandle; } } Loading