Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae4cd3df authored by Eric Erfanian's avatar Eric Erfanian
Browse files

Add assisted dialing feature propogation to call log.

Adds the mapping between the connection property and the call feature.

Test: None.

Unfortunately there doesn't look like a good way to stub
connection properties.

Bug: 35963245
Merged-In: I078a4cdcdce0455dbdbf825c89008b24bbb1b22b
Change-Id: I7db23c82754862bbcb44e636cd69d7b00022c0c3
parent 32c3dd46
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.Looper;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.PersistableBundle;
import android.os.PersistableBundle;
import android.provider.CallLog.Calls;
import android.provider.CallLog.Calls;
import android.telecom.Connection;
import android.telecom.DisconnectCause;
import android.telecom.DisconnectCause;
import android.telecom.Log;
import android.telecom.Log;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccount;
@@ -226,7 +227,9 @@ public final class CallLogManager extends CallsManagerListenerBase {
                call.getCallDataUsage();
                call.getCallDataUsage();


        int callFeatures = getCallFeatures(call.getVideoStateHistory(),
        int callFeatures = getCallFeatures(call.getVideoStateHistory(),
                call.getDisconnectCause().getCode() == DisconnectCause.CALL_PULLED);
                call.getDisconnectCause().getCode() == DisconnectCause.CALL_PULLED,
                (call.getConnectionProperties() & Connection.PROPERTY_ASSISTED_DIALING_USED) ==
                        Connection.PROPERTY_ASSISTED_DIALING_USED);
        logCall(call.getCallerInfo(), logNumber, call.getPostDialDigits(), formattedViaNumber,
        logCall(call.getCallerInfo(), logNumber, call.getPostDialDigits(), formattedViaNumber,
                call.getHandlePresentation(), callLogType, callFeatures, accountHandle,
                call.getHandlePresentation(), callLogType, callFeatures, accountHandle,
                creationTime, age, callDataUsage, call.isEmergencyCall(), call.getInitiatingUser(),
                creationTime, age, callDataUsage, call.isEmergencyCall(), call.getInitiatingUser(),
@@ -303,7 +306,8 @@ public final class CallLogManager extends CallsManagerListenerBase {
     * @param isPulledCall {@code true} if this call was pulled to another device.
     * @param isPulledCall {@code true} if this call was pulled to another device.
     * @return The call features.
     * @return The call features.
     */
     */
    private static int getCallFeatures(int videoState, boolean isPulledCall) {
    private static int getCallFeatures(int videoState, boolean isPulledCall,
                                       boolean isUsingAssistedDialing) {
        int features = 0;
        int features = 0;
        if (VideoProfile.isVideo(videoState)) {
        if (VideoProfile.isVideo(videoState)) {
            features |= Calls.FEATURES_VIDEO;
            features |= Calls.FEATURES_VIDEO;
@@ -311,6 +315,9 @@ public final class CallLogManager extends CallsManagerListenerBase {
        if (isPulledCall) {
        if (isPulledCall) {
            features |= Calls.FEATURES_PULLED_EXTERNALLY;
            features |= Calls.FEATURES_PULLED_EXTERNALLY;
        }
        }
        if (isUsingAssistedDialing) {
            features |= Calls.FEATURES_ASSISTED_DIALING_USED;
        }
        return features;
        return features;
    }
    }


+4 −1
Original line number Original line Diff line number Diff line
@@ -336,7 +336,10 @@ public class ParcelableCallUtils {
        android.telecom.Call.Details.PROPERTY_HAS_CDMA_VOICE_PRIVACY,
        android.telecom.Call.Details.PROPERTY_HAS_CDMA_VOICE_PRIVACY,


        Connection.PROPERTY_SELF_MANAGED,
        Connection.PROPERTY_SELF_MANAGED,
        android.telecom.Call.Details.PROPERTY_SELF_MANAGED
        android.telecom.Call.Details.PROPERTY_SELF_MANAGED,

        Connection.PROPERTY_ASSISTED_DIALING_USED,
        android.telecom.Call.Details.PROPERTY_ASSISTED_DIALING_USED
    };
    };


    private static int convertConnectionToCallProperties(int connectionProperties) {
    private static int convertConnectionToCallProperties(int connectionProperties) {