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

Commit d5725fae authored by Yorke Lee's avatar Yorke Lee
Browse files

Set number presentation in call log correctly

Bug: 17887770
Change-Id: I852a825580f0084ac45b4af7bc27d317089ee72e
parent 045b6c98
Loading
Loading
Loading
Loading
+2 −18
Original line number Diff line number Diff line
@@ -140,13 +140,12 @@ final class CallLogManager extends CallsManagerListenerBase {

        Log.d(TAG, "logNumber set to: %s", Log.pii(logNumber));

        final int presentation = getPresentation(call);
        final PhoneAccountHandle accountHandle = call.getTargetPhoneAccount();

        // TODO(vt): Once data usage is available, wire it up here.
        int callFeatures = getCallFeatures(call.getVideoStateHistory());
        logCall(call.getCallerInfo(), logNumber, presentation, callLogType, callFeatures,
                accountHandle, creationTime, age, null);
        logCall(call.getCallerInfo(), logNumber, call.getHandlePresentation(),
                callLogType, callFeatures, accountHandle, creationTime, age, null);
    }

    /**
@@ -231,21 +230,6 @@ final class CallLogManager extends CallsManagerListenerBase {
        return handleString;
    }

    /**
     * Gets the presentation from the {@link Call}.
     *
     * TODO: There needs to be a way to pass information from
     * Connection.getNumberPresentation() into a {@link Call} object. Until then, always return
     * PhoneConstants.PRESENTATION_ALLOWED. On top of that, we might need to introduce
     * getNumberPresentation to the ContactInfo object as well.
     *
     * @param call The call object to retrieve caller details from.
     * @return The number presentation constant to insert into the call logs.
     */
    private int getPresentation(Call call) {
        return PhoneConstants.PRESENTATION_ALLOWED;
    }

    /**
     * Adds the call defined by the parameters in the provided AddCallArgs to the CallLogProvider
     * using an AsyncTask to avoid blocking the main thread.