CAS: Add openSessionDefault

Add support for openSession with no arguments.

Bug: 266169861
Test: atest CtsMediaMiscTestCases

Change-Id: I4e321aa77735eaa019a74ce75f25cd3fe6b79f9b
This commit is contained in:
Venkatarama Avadhani
2023-01-30 11:21:07 +05:30
committed by Yixiao Luo
parent 248dd8cce8
commit 46720e796c

View File

@@ -1126,7 +1126,17 @@ public final class MediaCas implements AutoCloseable {
int sessionResourceHandle = getSessionResourceHandle();
try {
if (mICasHidl != null) {
if (mICas != null) {
byte[] sessionId = mICas.openSessionDefault();
Session session = createFromSessionId(sessionId);
Log.d(TAG, "Write Stats Log for succeed to Open Session.");
FrameworkStatsLog.write(
FrameworkStatsLog.TV_CAS_SESSION_OPEN_STATUS,
mUserId,
mCasSystemId,
FrameworkStatsLog.TV_CAS_SESSION_OPEN_STATUS__STATE__SUCCEEDED);
return session;
} else if (mICasHidl != null) {
OpenSessionCallback cb = new OpenSessionCallback();
mICasHidl.openSession(cb);
MediaCasException.throwExceptionIfNeeded(cb.mStatus);