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

Commit cde96f04 authored by Yixiao Luo's avatar Yixiao Luo Committed by Android (Google) Code Review
Browse files

Merge "ResourceHandle : Refactor resourceHandle data type to long" into main

parents 8c41dfdb d83e076c
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -131,7 +131,7 @@ public final class MediaCas implements AutoCloseable {
    private int mCasSystemId;
    private int mCasSystemId;
    private int mUserId;
    private int mUserId;
    private TunerResourceManager mTunerResourceManager = null;
    private TunerResourceManager mTunerResourceManager = null;
    private final Map<Session, Integer> mSessionMap = new HashMap<>();
    private final Map<Session, Long> mSessionMap = new HashMap<>();


    /**
    /**
     * Scrambling modes used to open cas sessions.
     * Scrambling modes used to open cas sessions.
@@ -1126,10 +1126,10 @@ public final class MediaCas implements AutoCloseable {
        }
        }
    }
    }


    private int getSessionResourceHandle() throws MediaCasException {
    private long getSessionResourceHandle() throws MediaCasException {
        validateInternalStates();
        validateInternalStates();


        int[] sessionResourceHandle = new int[1];
        long[] sessionResourceHandle = new long[1];
        sessionResourceHandle[0] = -1;
        sessionResourceHandle[0] = -1;
        if (mTunerResourceManager != null) {
        if (mTunerResourceManager != null) {
            CasSessionRequest casSessionRequest = new CasSessionRequest();
            CasSessionRequest casSessionRequest = new CasSessionRequest();
@@ -1144,8 +1144,7 @@ public final class MediaCas implements AutoCloseable {
        return sessionResourceHandle[0];
        return sessionResourceHandle[0];
    }
    }


    private void addSessionToResourceMap(Session session, int sessionResourceHandle) {
    private void addSessionToResourceMap(Session session, long sessionResourceHandle) {

        if (sessionResourceHandle != TunerResourceManager.INVALID_RESOURCE_HANDLE) {
        if (sessionResourceHandle != TunerResourceManager.INVALID_RESOURCE_HANDLE) {
            synchronized (mSessionMap) {
            synchronized (mSessionMap) {
                mSessionMap.put(session, sessionResourceHandle);
                mSessionMap.put(session, sessionResourceHandle);
@@ -1178,13 +1177,14 @@ public final class MediaCas implements AutoCloseable {
     * @throws MediaCasStateException for CAS-specific state exceptions.
     * @throws MediaCasStateException for CAS-specific state exceptions.
     */
     */
    public Session openSession() throws MediaCasException {
    public Session openSession() throws MediaCasException {
        int sessionResourceHandle = getSessionResourceHandle();
        long sessionResourceHandle = getSessionResourceHandle();


        try {
        try {
            if (mICas != null) {
            if (mICas != null) {
                try {
                try {
                    byte[] sessionId = mICas.openSessionDefault();
                    byte[] sessionId = mICas.openSessionDefault();
                    Session session = createFromSessionId(sessionId);
                    Session session = createFromSessionId(sessionId);
                    addSessionToResourceMap(session, sessionResourceHandle);
                    Log.d(TAG, "Write Stats Log for succeed to Open Session.");
                    Log.d(TAG, "Write Stats Log for succeed to Open Session.");
                    FrameworkStatsLog.write(
                    FrameworkStatsLog.write(
                            FrameworkStatsLog.TV_CAS_SESSION_OPEN_STATUS,
                            FrameworkStatsLog.TV_CAS_SESSION_OPEN_STATUS,
@@ -1238,7 +1238,7 @@ public final class MediaCas implements AutoCloseable {
    @Nullable
    @Nullable
    public Session openSession(@SessionUsage int sessionUsage, @ScramblingMode int scramblingMode)
    public Session openSession(@SessionUsage int sessionUsage, @ScramblingMode int scramblingMode)
            throws MediaCasException {
            throws MediaCasException {
        int sessionResourceHandle = getSessionResourceHandle();
        long sessionResourceHandle = getSessionResourceHandle();


        if (mICas != null) {
        if (mICas != null) {
            try {
            try {
+19 −19
Original line number Original line Diff line number Diff line
@@ -293,13 +293,13 @@ public class Tuner implements AutoCloseable {
    private EventHandler mHandler;
    private EventHandler mHandler;
    @Nullable
    @Nullable
    private FrontendInfo mFrontendInfo;
    private FrontendInfo mFrontendInfo;
    private Integer mFrontendHandle;
    private Long mFrontendHandle;
    private Tuner mFeOwnerTuner = null;
    private Tuner mFeOwnerTuner = null;
    private int mFrontendType = FrontendSettings.TYPE_UNDEFINED;
    private int mFrontendType = FrontendSettings.TYPE_UNDEFINED;
    private Integer mDesiredFrontendId = null;
    private Integer mDesiredFrontendId = null;
    private int mUserId;
    private int mUserId;
    private Lnb mLnb;
    private Lnb mLnb;
    private Integer mLnbHandle;
    private Long mLnbHandle;
    @Nullable
    @Nullable
    private OnTuneEventListener mOnTuneEventListener;
    private OnTuneEventListener mOnTuneEventListener;
    @Nullable
    @Nullable
@@ -322,10 +322,10 @@ public class Tuner implements AutoCloseable {
    private final ReentrantLock mDemuxLock = new ReentrantLock();
    private final ReentrantLock mDemuxLock = new ReentrantLock();
    private int mRequestedCiCamId;
    private int mRequestedCiCamId;


    private Integer mDemuxHandle;
    private Long mDemuxHandle;
    private Integer mFrontendCiCamHandle;
    private Long mFrontendCiCamHandle;
    private Integer mFrontendCiCamId;
    private Integer mFrontendCiCamId;
    private Map<Integer, WeakReference<Descrambler>> mDescramblers = new HashMap<>();
    private Map<Long, WeakReference<Descrambler>> mDescramblers = new HashMap<>();
    private List<WeakReference<Filter>> mFilters = new ArrayList<WeakReference<Filter>>();
    private List<WeakReference<Filter>> mFilters = new ArrayList<WeakReference<Filter>>();


    private final TunerResourceManager.ResourcesReclaimListener mResourceListener =
    private final TunerResourceManager.ResourcesReclaimListener mResourceListener =
@@ -947,7 +947,7 @@ public class Tuner implements AutoCloseable {
    private void releaseDescramblers() {
    private void releaseDescramblers() {
        synchronized (mDescramblers) {
        synchronized (mDescramblers) {
            if (!mDescramblers.isEmpty()) {
            if (!mDescramblers.isEmpty()) {
                for (Map.Entry<Integer, WeakReference<Descrambler>> d : mDescramblers.entrySet()) {
                for (Map.Entry<Long, WeakReference<Descrambler>> d : mDescramblers.entrySet()) {
                    Descrambler descrambler = d.getValue().get();
                    Descrambler descrambler = d.getValue().get();
                    if (descrambler != null) {
                    if (descrambler != null) {
                        descrambler.close();
                        descrambler.close();
@@ -1008,7 +1008,7 @@ public class Tuner implements AutoCloseable {
    /**
    /**
     * Native method to open frontend of the given ID.
     * Native method to open frontend of the given ID.
     */
     */
    private native Frontend nativeOpenFrontendByHandle(int handle);
    private native Frontend nativeOpenFrontendByHandle(long handle);
    private native int nativeShareFrontend(int id);
    private native int nativeShareFrontend(int id);
    private native int nativeUnshareFrontend();
    private native int nativeUnshareFrontend();
    private native void nativeRegisterFeCbListener(long nativeContext);
    private native void nativeRegisterFeCbListener(long nativeContext);
@@ -1037,21 +1037,21 @@ public class Tuner implements AutoCloseable {
    private native int nativeSetMaxNumberOfFrontends(int frontendType, int maxNumber);
    private native int nativeSetMaxNumberOfFrontends(int frontendType, int maxNumber);
    private native int nativeGetMaxNumberOfFrontends(int frontendType);
    private native int nativeGetMaxNumberOfFrontends(int frontendType);
    private native int nativeRemoveOutputPid(int pid);
    private native int nativeRemoveOutputPid(int pid);
    private native Lnb nativeOpenLnbByHandle(int handle);
    private native Lnb nativeOpenLnbByHandle(long handle);
    private native Lnb nativeOpenLnbByName(String name);
    private native Lnb nativeOpenLnbByName(String name);
    private native FrontendStatusReadiness[] nativeGetFrontendStatusReadiness(int[] statusTypes);
    private native FrontendStatusReadiness[] nativeGetFrontendStatusReadiness(int[] statusTypes);


    private native Descrambler nativeOpenDescramblerByHandle(int handle);
    private native Descrambler nativeOpenDescramblerByHandle(long handle);
    private native int nativeOpenDemuxByhandle(int handle);
    private native int nativeOpenDemuxByhandle(long handle);


    private native DvrRecorder nativeOpenDvrRecorder(long bufferSize);
    private native DvrRecorder nativeOpenDvrRecorder(long bufferSize);
    private native DvrPlayback nativeOpenDvrPlayback(long bufferSize);
    private native DvrPlayback nativeOpenDvrPlayback(long bufferSize);


    private native DemuxCapabilities nativeGetDemuxCapabilities();
    private native DemuxCapabilities nativeGetDemuxCapabilities();
    private native DemuxInfo nativeGetDemuxInfo(int demuxHandle);
    private native DemuxInfo nativeGetDemuxInfo(long demuxHandle);


    private native int nativeCloseDemux(int handle);
    private native int nativeCloseDemux(long handle);
    private native int nativeCloseFrontend(int handle);
    private native int nativeCloseFrontend(long handle);
    private native int nativeClose();
    private native int nativeClose();


    private static native SharedFilter nativeOpenSharedFilter(String token);
    private static native SharedFilter nativeOpenSharedFilter(String token);
@@ -1369,7 +1369,7 @@ public class Tuner implements AutoCloseable {
    }
    }


    private boolean requestFrontend() {
    private boolean requestFrontend() {
        int[] feHandle = new int[1];
        long[] feHandle = new long[1];
        boolean granted = false;
        boolean granted = false;
        try {
        try {
            TunerFrontendRequest request = new TunerFrontendRequest();
            TunerFrontendRequest request = new TunerFrontendRequest();
@@ -2377,7 +2377,7 @@ public class Tuner implements AutoCloseable {
    }
    }


    private boolean requestLnb() {
    private boolean requestLnb() {
        int[] lnbHandle = new int[1];
        long[] lnbHandle = new long[1];
        TunerLnbRequest request = new TunerLnbRequest();
        TunerLnbRequest request = new TunerLnbRequest();
        request.clientId = mClientId;
        request.clientId = mClientId;
        boolean granted = mTunerResourceManager.requestLnb(request, lnbHandle);
        boolean granted = mTunerResourceManager.requestLnb(request, lnbHandle);
@@ -2660,7 +2660,7 @@ public class Tuner implements AutoCloseable {
    }
    }


    private boolean requestDemux() {
    private boolean requestDemux() {
        int[] demuxHandle = new int[1];
        long[] demuxHandle = new long[1];
        TunerDemuxRequest request = new TunerDemuxRequest();
        TunerDemuxRequest request = new TunerDemuxRequest();
        request.clientId = mClientId;
        request.clientId = mClientId;
        request.desiredFilterTypes = mDesiredDemuxInfo.getFilterTypes();
        request.desiredFilterTypes = mDesiredDemuxInfo.getFilterTypes();
@@ -2673,14 +2673,14 @@ public class Tuner implements AutoCloseable {
    }
    }


    private Descrambler requestDescrambler() {
    private Descrambler requestDescrambler() {
        int[] descramblerHandle = new int[1];
        long[] descramblerHandle = new long[1];
        TunerDescramblerRequest request = new TunerDescramblerRequest();
        TunerDescramblerRequest request = new TunerDescramblerRequest();
        request.clientId = mClientId;
        request.clientId = mClientId;
        boolean granted = mTunerResourceManager.requestDescrambler(request, descramblerHandle);
        boolean granted = mTunerResourceManager.requestDescrambler(request, descramblerHandle);
        if (!granted) {
        if (!granted) {
            return null;
            return null;
        }
        }
        int handle = descramblerHandle[0];
        long handle = descramblerHandle[0];
        Descrambler descrambler = nativeOpenDescramblerByHandle(handle);
        Descrambler descrambler = nativeOpenDescramblerByHandle(handle);
        if (descrambler != null) {
        if (descrambler != null) {
            synchronized (mDescramblers) {
            synchronized (mDescramblers) {
@@ -2694,7 +2694,7 @@ public class Tuner implements AutoCloseable {
    }
    }


    private boolean requestFrontendCiCam(int ciCamId) {
    private boolean requestFrontendCiCam(int ciCamId) {
        int[] ciCamHandle = new int[1];
        long[] ciCamHandle = new long[1];
        TunerCiCamRequest request = new TunerCiCamRequest();
        TunerCiCamRequest request = new TunerCiCamRequest();
        request.clientId = mClientId;
        request.clientId = mClientId;
        request.ciCamId = ciCamId;
        request.ciCamId = ciCamId;
+20 −20
Original line number Original line Diff line number Diff line
@@ -66,7 +66,7 @@ public class TunerResourceManager {
    private static final String TAG = "TunerResourceManager";
    private static final String TAG = "TunerResourceManager";
    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);


    public static final int INVALID_RESOURCE_HANDLE = -1;
    public static final long INVALID_RESOURCE_HANDLE = -1;
    public static final int INVALID_OWNER_ID = -1;
    public static final int INVALID_OWNER_ID = -1;
    /**
    /**
     * Tuner resource type to help generate resource handle
     * Tuner resource type to help generate resource handle
@@ -275,7 +275,7 @@ public class TunerResourceManager {
     * Updates the current TRM of the TunerHAL Frontend information.
     * Updates the current TRM of the TunerHAL Frontend information.
     *
     *
     * <p><strong>Note:</strong> This update must happen before the first
     * <p><strong>Note:</strong> This update must happen before the first
     * {@link #requestFrontend(TunerFrontendRequest, int[])} and
     * {@link #requestFrontend(TunerFrontendRequest, long[])} and
     * {@link #releaseFrontend(int, int)} call.
     * {@link #releaseFrontend(int, int)} call.
     *
     *
     * @param infos an array of the available {@link TunerFrontendInfo} information.
     * @param infos an array of the available {@link TunerFrontendInfo} information.
@@ -331,7 +331,7 @@ public class TunerResourceManager {
     *
     *
     * @param lnbIds ids of the updating lnbs.
     * @param lnbIds ids of the updating lnbs.
     */
     */
    public void setLnbInfoList(int[] lnbIds) {
    public void setLnbInfoList(long[] lnbIds) {
        try {
        try {
            mService.setLnbInfoList(lnbIds);
            mService.setLnbInfoList(lnbIds);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
@@ -406,8 +406,8 @@ public class TunerResourceManager {
     *
     *
     * @return true if there is frontend granted.
     * @return true if there is frontend granted.
     */
     */
    public boolean requestFrontend(@NonNull TunerFrontendRequest request,
    public boolean requestFrontend(
                @Nullable int[] frontendHandle) {
            @NonNull TunerFrontendRequest request, @Nullable long[] frontendHandle) {
        boolean result = false;
        boolean result = false;
        try {
        try {
            result = mService.requestFrontend(request, frontendHandle);
            result = mService.requestFrontend(request, frontendHandle);
@@ -511,7 +511,7 @@ public class TunerResourceManager {
     *
     *
     * @return true if there is Demux granted.
     * @return true if there is Demux granted.
     */
     */
    public boolean requestDemux(@NonNull TunerDemuxRequest request, @NonNull int[] demuxHandle) {
    public boolean requestDemux(@NonNull TunerDemuxRequest request, @NonNull long[] demuxHandle) {
        boolean result = false;
        boolean result = false;
        try {
        try {
            result = mService.requestDemux(request, demuxHandle);
            result = mService.requestDemux(request, demuxHandle);
@@ -544,8 +544,8 @@ public class TunerResourceManager {
     *
     *
     * @return true if there is Descrambler granted.
     * @return true if there is Descrambler granted.
     */
     */
    public boolean requestDescrambler(@NonNull TunerDescramblerRequest request,
    public boolean requestDescrambler(
                @NonNull int[] descramblerHandle) {
            @NonNull TunerDescramblerRequest request, @NonNull long[] descramblerHandle) {
        boolean result = false;
        boolean result = false;
        try {
        try {
            result = mService.requestDescrambler(request, descramblerHandle);
            result = mService.requestDescrambler(request, descramblerHandle);
@@ -577,8 +577,8 @@ public class TunerResourceManager {
     *
     *
     * @return true if there is CAS session granted.
     * @return true if there is CAS session granted.
     */
     */
    public boolean requestCasSession(@NonNull CasSessionRequest request,
    public boolean requestCasSession(
                @NonNull int[] casSessionHandle) {
            @NonNull CasSessionRequest request, @NonNull long[] casSessionHandle) {
        boolean result = false;
        boolean result = false;
        try {
        try {
            result = mService.requestCasSession(request, casSessionHandle);
            result = mService.requestCasSession(request, casSessionHandle);
@@ -610,7 +610,7 @@ public class TunerResourceManager {
     *
     *
     * @return true if there is ciCam granted.
     * @return true if there is ciCam granted.
     */
     */
    public boolean requestCiCam(TunerCiCamRequest request, int[] ciCamHandle) {
    public boolean requestCiCam(TunerCiCamRequest request, long[] ciCamHandle) {
        boolean result = false;
        boolean result = false;
        try {
        try {
            result = mService.requestCiCam(request, ciCamHandle);
            result = mService.requestCiCam(request, ciCamHandle);
@@ -635,7 +635,7 @@ public class TunerResourceManager {
     * <li>If no Lnb system can be granted, the API would return false.
     * <li>If no Lnb system can be granted, the API would return false.
     * <ul>
     * <ul>
     *
     *
     * <p><strong>Note:</strong> {@link #setLnbInfoList(int[])} must be called before this request.
     * <p><strong>Note:</strong> {@link #setLnbInfoList(long[])} must be called before this request.
     *
     *
     * @param request {@link TunerLnbRequest} information of the current request.
     * @param request {@link TunerLnbRequest} information of the current request.
     * @param lnbHandle a one-element array to return the granted Lnb handle.
     * @param lnbHandle a one-element array to return the granted Lnb handle.
@@ -643,7 +643,7 @@ public class TunerResourceManager {
     *
     *
     * @return true if there is Lnb granted.
     * @return true if there is Lnb granted.
     */
     */
    public boolean requestLnb(@NonNull TunerLnbRequest request, @NonNull int[] lnbHandle) {
    public boolean requestLnb(@NonNull TunerLnbRequest request, @NonNull long[] lnbHandle) {
        boolean result = false;
        boolean result = false;
        try {
        try {
            result = mService.requestLnb(request, lnbHandle);
            result = mService.requestLnb(request, lnbHandle);
@@ -664,7 +664,7 @@ public class TunerResourceManager {
     * @param frontendHandle the handle of the released frontend.
     * @param frontendHandle the handle of the released frontend.
     * @param clientId the id of the client that is releasing the frontend.
     * @param clientId the id of the client that is releasing the frontend.
     */
     */
    public void releaseFrontend(int frontendHandle, int clientId) {
    public void releaseFrontend(long frontendHandle, int clientId) {
        try {
        try {
            mService.releaseFrontend(frontendHandle, clientId);
            mService.releaseFrontend(frontendHandle, clientId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
@@ -680,7 +680,7 @@ public class TunerResourceManager {
     * @param demuxHandle the handle of the released Tuner Demux.
     * @param demuxHandle the handle of the released Tuner Demux.
     * @param clientId the id of the client that is releasing the demux.
     * @param clientId the id of the client that is releasing the demux.
     */
     */
    public void releaseDemux(int demuxHandle, int clientId) {
    public void releaseDemux(long demuxHandle, int clientId) {
        try {
        try {
            mService.releaseDemux(demuxHandle, clientId);
            mService.releaseDemux(demuxHandle, clientId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
@@ -696,7 +696,7 @@ public class TunerResourceManager {
     * @param descramblerHandle the handle of the released Tuner Descrambler.
     * @param descramblerHandle the handle of the released Tuner Descrambler.
     * @param clientId the id of the client that is releasing the descrambler.
     * @param clientId the id of the client that is releasing the descrambler.
     */
     */
    public void releaseDescrambler(int descramblerHandle, int clientId) {
    public void releaseDescrambler(long descramblerHandle, int clientId) {
        try {
        try {
            mService.releaseDescrambler(descramblerHandle, clientId);
            mService.releaseDescrambler(descramblerHandle, clientId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
@@ -715,7 +715,7 @@ public class TunerResourceManager {
     * @param casSessionHandle the handle of the released CAS session.
     * @param casSessionHandle the handle of the released CAS session.
     * @param clientId the id of the client that is releasing the cas session.
     * @param clientId the id of the client that is releasing the cas session.
     */
     */
    public void releaseCasSession(int casSessionHandle, int clientId) {
    public void releaseCasSession(long casSessionHandle, int clientId) {
        try {
        try {
            mService.releaseCasSession(casSessionHandle, clientId);
            mService.releaseCasSession(casSessionHandle, clientId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
@@ -734,7 +734,7 @@ public class TunerResourceManager {
     * @param ciCamHandle the handle of the releasing CiCam.
     * @param ciCamHandle the handle of the releasing CiCam.
     * @param clientId the id of the client that is releasing the CiCam.
     * @param clientId the id of the client that is releasing the CiCam.
     */
     */
    public void releaseCiCam(int ciCamHandle, int clientId) {
    public void releaseCiCam(long ciCamHandle, int clientId) {
        try {
        try {
            mService.releaseCiCam(ciCamHandle, clientId);
            mService.releaseCiCam(ciCamHandle, clientId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
@@ -747,12 +747,12 @@ public class TunerResourceManager {
     *
     *
     * <p>Client must call this whenever it releases an Lnb.
     * <p>Client must call this whenever it releases an Lnb.
     *
     *
     * <p><strong>Note:</strong> {@link #setLnbInfoList(int[])} must be called before this release.
     * <p><strong>Note:</strong> {@link #setLnbInfoList(long[])} must be called before this release.
     *
     *
     * @param lnbHandle the handle of the released Tuner Lnb.
     * @param lnbHandle the handle of the released Tuner Lnb.
     * @param clientId the id of the client that is releasing the lnb.
     * @param clientId the id of the client that is releasing the lnb.
     */
     */
    public void releaseLnb(int lnbHandle, int clientId) {
    public void releaseLnb(long lnbHandle, int clientId) {
        try {
        try {
            mService.releaseLnb(lnbHandle, clientId);
            mService.releaseLnb(lnbHandle, clientId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
+13 −13
Original line number Original line Diff line number Diff line
@@ -149,7 +149,7 @@ interface ITunerResourceManager {
     *
     *
     * @param lnbIds ids of the updating lnbs.
     * @param lnbIds ids of the updating lnbs.
     */
     */
    void setLnbInfoList(in int[] lnbIds);
    void setLnbInfoList(in long[] lnbIds);


    /*
    /*
     * This API is used by the Tuner framework to request a frontend from the TunerHAL.
     * This API is used by the Tuner framework to request a frontend from the TunerHAL.
@@ -185,7 +185,7 @@ interface ITunerResourceManager {
     *
     *
     * @return true if there is frontend granted.
     * @return true if there is frontend granted.
     */
     */
    boolean requestFrontend(in TunerFrontendRequest request, out int[] frontendHandle);
    boolean requestFrontend(in TunerFrontendRequest request, out long[] frontendHandle);


    /*
    /*
     * Sets the maximum usable frontends number of a given frontend type. It is used to enable or
     * Sets the maximum usable frontends number of a given frontend type. It is used to enable or
@@ -253,7 +253,7 @@ interface ITunerResourceManager {
     *
     *
     * @return true if there is demux granted.
     * @return true if there is demux granted.
     */
     */
    boolean requestDemux(in TunerDemuxRequest request, out int[] demuxHandle);
    boolean requestDemux(in TunerDemuxRequest request, out long[] demuxHandle);


    /*
    /*
     * This API is used by the Tuner framework to request an available descrambler from the
     * This API is used by the Tuner framework to request an available descrambler from the
@@ -277,7 +277,7 @@ interface ITunerResourceManager {
     *
     *
     * @return true if there is Descrambler granted.
     * @return true if there is Descrambler granted.
     */
     */
    boolean requestDescrambler(in TunerDescramblerRequest request, out int[] descramblerHandle);
    boolean requestDescrambler(in TunerDescramblerRequest request, out long[] descramblerHandle);


    /*
    /*
     * This API is used by the Tuner framework to request an available Cas session. This session
     * This API is used by the Tuner framework to request an available Cas session. This session
@@ -303,7 +303,7 @@ interface ITunerResourceManager {
     *
     *
     * @return true if there is CAS session granted.
     * @return true if there is CAS session granted.
     */
     */
    boolean requestCasSession(in CasSessionRequest request, out int[] casSessionHandle);
    boolean requestCasSession(in CasSessionRequest request, out long[] casSessionHandle);


    /*
    /*
     * This API is used by the Tuner framework to request an available CuCam.
     * This API is used by the Tuner framework to request an available CuCam.
@@ -328,7 +328,7 @@ interface ITunerResourceManager {
     *
     *
     * @return true if there is CiCam granted.
     * @return true if there is CiCam granted.
     */
     */
    boolean requestCiCam(in TunerCiCamRequest request, out int[] ciCamHandle);
    boolean requestCiCam(in TunerCiCamRequest request, out long[] ciCamHandle);


    /*
    /*
     * This API is used by the Tuner framework to request an available Lnb from the TunerHAL.
     * This API is used by the Tuner framework to request an available Lnb from the TunerHAL.
@@ -352,7 +352,7 @@ interface ITunerResourceManager {
     *
     *
     * @return true if there is Lnb granted.
     * @return true if there is Lnb granted.
     */
     */
    boolean requestLnb(in TunerLnbRequest request, out int[] lnbHandle);
    boolean requestLnb(in TunerLnbRequest request, out long[] lnbHandle);


    /*
    /*
     * Notifies the TRM that the given frontend has been released.
     * Notifies the TRM that the given frontend has been released.
@@ -365,7 +365,7 @@ interface ITunerResourceManager {
     * @param frontendHandle the handle of the released frontend.
     * @param frontendHandle the handle of the released frontend.
     * @param clientId the id of the client that is releasing the frontend.
     * @param clientId the id of the client that is releasing the frontend.
     */
     */
    void releaseFrontend(in int frontendHandle, int clientId);
    void releaseFrontend(in long frontendHandle, int clientId);


    /*
    /*
     * Notifies the TRM that the Demux with the given handle was released.
     * Notifies the TRM that the Demux with the given handle was released.
@@ -375,7 +375,7 @@ interface ITunerResourceManager {
     * @param demuxHandle the handle of the released Tuner Demux.
     * @param demuxHandle the handle of the released Tuner Demux.
     * @param clientId the id of the client that is releasing the demux.
     * @param clientId the id of the client that is releasing the demux.
     */
     */
    void releaseDemux(in int demuxHandle, int clientId);
    void releaseDemux(in long demuxHandle, int clientId);


    /*
    /*
     * Notifies the TRM that the Descrambler with the given handle was released.
     * Notifies the TRM that the Descrambler with the given handle was released.
@@ -385,7 +385,7 @@ interface ITunerResourceManager {
     * @param descramblerHandle the handle of the released Tuner Descrambler.
     * @param descramblerHandle the handle of the released Tuner Descrambler.
     * @param clientId the id of the client that is releasing the descrambler.
     * @param clientId the id of the client that is releasing the descrambler.
     */
     */
    void releaseDescrambler(in int descramblerHandle, int clientId);
    void releaseDescrambler(in long descramblerHandle, int clientId);


    /*
    /*
     * Notifies the TRM that the given Cas session has been released.
     * Notifies the TRM that the given Cas session has been released.
@@ -397,7 +397,7 @@ interface ITunerResourceManager {
     * @param casSessionHandle the handle of the released CAS session.
     * @param casSessionHandle the handle of the released CAS session.
     * @param clientId the id of the client that is releasing the cas session.
     * @param clientId the id of the client that is releasing the cas session.
     */
     */
    void releaseCasSession(in int casSessionHandle, int clientId);
    void releaseCasSession(in long casSessionHandle, int clientId);


    /**
    /**
     * Notifies the TRM that the given CiCam has been released.
     * Notifies the TRM that the given CiCam has been released.
@@ -410,7 +410,7 @@ interface ITunerResourceManager {
     * @param ciCamHandle the handle of the releasing CiCam.
     * @param ciCamHandle the handle of the releasing CiCam.
     * @param clientId the id of the client that is releasing the CiCam.
     * @param clientId the id of the client that is releasing the CiCam.
     */
     */
    void releaseCiCam(in int ciCamHandle, int clientId);
    void releaseCiCam(in long ciCamHandle, int clientId);


    /*
    /*
     * Notifies the TRM that the Lnb with the given handle was released.
     * Notifies the TRM that the Lnb with the given handle was released.
@@ -422,7 +422,7 @@ interface ITunerResourceManager {
     * @param lnbHandle the handle of the released Tuner Lnb.
     * @param lnbHandle the handle of the released Tuner Lnb.
     * @param clientId the id of the client that is releasing the lnb.
     * @param clientId the id of the client that is releasing the lnb.
     */
     */
    void releaseLnb(in int lnbHandle, int clientId);
    void releaseLnb(in long lnbHandle, int clientId);


    /*
    /*
     * Compare two clients' priority.
     * Compare two clients' priority.
+1 −1
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ parcelable TunerDemuxInfo {
    /**
    /**
     * Demux handle
     * Demux handle
     */
     */
    int handle;
    long handle;


    /**
    /**
     * Supported filter types (defined in {@link android.media.tv.tuner.filter.Filter})
     * Supported filter types (defined in {@link android.media.tv.tuner.filter.Filter})
Loading