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

Commit abed49c0 authored by Thomas Stuart's avatar Thomas Stuart
Browse files

log info to help tracing in notifyNewRingingConnectionP

The notifyNewRingingConnectionP(Connection) method has
been updated to help debug an incoming call better.
The phoneId, Connetion, and mNewRingingConnectionRegistrants
objects are now logged out (at info level) whenever there
is a new incoming call.

bug: 210480181
Test: none
Change-Id: Ie5114c1c1e0a10cb60667cad5f548d370d5c21d8
parent 43a7fa17
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -3867,12 +3867,28 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * version scoped to their packages
     */
    public void notifyNewRingingConnectionP(Connection cn) {
        Rlog.i(LOG_TAG, String.format(
                "notifyNewRingingConnection: phoneId=[%d], connection=[%s], registrants=[%s]",
                getPhoneId(), cn, getNewRingingConnectionRegistrantsAsString()));
        if (!mIsVoiceCapable)
            return;
        AsyncResult ar = new AsyncResult(null, cn, null);
        mNewRingingConnectionRegistrants.notifyRegistrants(ar);
    }

    /**
     * helper for notifyNewRingingConnectionP(Connection) to create a string for a log message.
     *
     * @return a list of objects in mNewRingingConnectionRegistrants as a String
     */
    private String getNewRingingConnectionRegistrantsAsString() {
        List<String> registrants = new ArrayList<>();
        for (int i = 0; i < mNewRingingConnectionRegistrants.size(); i++) {
            registrants.add(mNewRingingConnectionRegistrants.get(i).toString());
        }
        return String.join(", ", registrants);
    }

    /**
     * Notify registrants of a new unknown connection.
     */