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

Commit a5f530a9 authored by Henry Fang's avatar Henry Fang Committed by Automerger Merge Worker
Browse files

Merge "Add java doc to explain the return for insufficient resource." into rvc-dev am: 9fa94145

Change-Id: I2a1e12695af14bcba93e46b3aa4442b34739d23b
parents ed40673c 9fa94145
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -870,16 +870,17 @@ public final class MediaCas implements AutoCloseable {
    private int getSessionResourceId() throws MediaCasException {
        validateInternalStates();

        int[] sessionResourceId = new int[1];
        sessionResourceId[0] = -1;
        int[] sessionResourceHandle = new int[1];
        sessionResourceHandle[0] = -1;
        if (mTunerResourceManager != null) {
            CasSessionRequest casSessionRequest = new CasSessionRequest(mClientId, mCasSystemId);
            if (!mTunerResourceManager.requestCasSession(casSessionRequest, sessionResourceId)) {
                throw new MediaCasException.ResourceBusyException(
            if (!mTunerResourceManager
                    .requestCasSession(casSessionRequest, sessionResourceHandle)) {
                throw new MediaCasException.InsufficientResourceException(
                    "insufficient resource to Open Session");
            }
        }
        return  sessionResourceId[0];
        return  sessionResourceHandle[0];
    }

    private void addSessionToResourceMap(Session session, int sessionResourceId) {
@@ -905,6 +906,10 @@ public final class MediaCas implements AutoCloseable {
     * Open a session to descramble one or more streams scrambled by the
     * conditional access system.
     *
     * <p>Tuner resource manager (TRM) uses the client priority value to decide whether it is able
     * to get cas session resource if cas session resources is limited. If the client can't get the
     * resource, this call returns {@link MediaCasException.InsufficientResourceException }.
     *
     * @return session the newly opened session.
     *
     * @throws IllegalStateException if the MediaCas instance is not valid.
@@ -930,6 +935,10 @@ public final class MediaCas implements AutoCloseable {
     * Open a session with usage and scrambling information, so that descrambler can be configured
     * to descramble one or more streams scrambled by the conditional access system.
     *
     * <p>Tuner resource manager (TRM) uses the client priority value to decide whether it is able
     * to get cas session resource if cas session resources is limited. If the client can't get the
     * resource, this call returns {@link MediaCasException.InsufficientResourceException}.
     *
     * @param sessionUsage used for the created session.
     * @param scramblingMode used for the created session.
     *
+4 −0
Original line number Diff line number Diff line
@@ -453,6 +453,10 @@ public class Tuner implements AutoCloseable {
    /**
     * Tunes the frontend to using the settings given.
     *
     * <p>Tuner resource manager (TRM) uses the client priority value to decide whether it is able
     * to get frontend resource. If the client can't get the resource, this call returns {@link
     * Result#RESULT_UNAVAILABLE}.
     *
     * <p>
     * This locks the frontend to a frequency by providing signal
     * delivery information. If previous tuning isn't completed, this stop the previous tuning, and