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

Commit c9a0702a authored by Brad Ebinger's avatar Brad Ebinger Committed by Gerrit Code Review
Browse files

Merge "Expose ConnectionService Handler to remove flaky tests"

parents 63e2a95b 99f17ced
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.telecom.Logging.Session;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.SomeArgs;
import com.android.internal.telecom.IConnectionService;
import com.android.internal.telecom.IConnectionServiceAdapter;
@@ -2672,4 +2673,13 @@ public abstract class ConnectionService extends Service {
            return ++mId;
        }
    }

    /**
     * Returns this handler, ONLY FOR TESTING.
     * @hide
     */
    @VisibleForTesting
    public Handler getHandler() {
        return mHandler;
    }
}
+14 −0
Original line number Diff line number Diff line
@@ -391,6 +391,20 @@ public class SessionManager {
        return mCurrentThreadId.get();
    }

    /**
     * @return A String representation of the active sessions at the time that this method is
     * called.
     */
    @VisibleForTesting
    public synchronized String printActiveSessions() {
        StringBuilder message = new StringBuilder();
        for (ConcurrentHashMap.Entry<Integer, Session> entry : mSessionMapper.entrySet()) {
            message.append(entry.getValue().printFullSessionTree());
            message.append("\n");
        }
        return message.toString();
    }

    @VisibleForTesting
    public synchronized void cleanupStaleSessions(long timeoutMs) {
        String logMessage = "Stale Sessions Cleaned:\n";