Merge "Expose ConnectionService Handler to remove flaky tests"
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user