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

Commit 51e69ad4 authored by Venkatarama Avadhani's avatar Venkatarama Avadhani
Browse files

Handle ServiceSpecificException in openSession

In MediaCas#openSession(int, int), the ServiceSpecificException is
caught and thrown as an IllegalStateException. This is inconsistent with
the documentation of the method. Correct it to throw a MediaCasException.

Bug: 409937172
Test: atest CtsMediaMiscTestCases
Flag: EXEMPT bugfix
Change-Id: I02cf600f16f9ee5839888cd6c1770fe462f21992
parent a0ed7d03
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1306,7 +1306,9 @@ public final class MediaCas implements AutoCloseable {
                        mCasSystemId,
                        FrameworkStatsLog.TV_CAS_SESSION_OPEN_STATUS__STATE__SUCCEEDED);
                return session;
            } catch (ServiceSpecificException | RemoteException e) {
            } catch (ServiceSpecificException se) {
                MediaCasException.throwExceptionIfNeeded(se.errorCode);
            } catch (RemoteException e) {
                cleanupAndRethrowIllegalState();
            }
        }