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

Commit a933e6cc authored by Thomas Stuart's avatar Thomas Stuart Committed by Android (Google) Code Review
Browse files

Merge "log info to help tracing in notifyNewRingingConnectionP"

parents 33a386e7 abed49c0
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.
     */