Search in sources :

Example 1 with ITvInputSessionCallback

use of android.media.tv.ITvInputSessionCallback in project android_frameworks_base by DirtyUnicorns.

the class TvInputManagerService method createSessionInternalLocked.

private void createSessionInternalLocked(ITvInputService service, IBinder sessionToken, int userId) {
    UserState userState = getOrCreateUserStateLocked(userId);
    SessionState sessionState = userState.sessionStateMap.get(sessionToken);
    if (DEBUG) {
        Slog.d(TAG, "createSessionInternalLocked(inputId=" + sessionState.inputId + ")");
    }
    InputChannel[] channels = InputChannel.openInputChannelPair(sessionToken.toString());
    // Set up a callback to send the session token.
    ITvInputSessionCallback callback = new SessionCallback(sessionState, channels);
    // Create a session. When failed, send a null token immediately.
    try {
        if (sessionState.isRecordingSession) {
            service.createRecordingSession(callback, sessionState.inputId);
        } else {
            service.createSession(channels[1], callback, sessionState.inputId);
        }
    } catch (RemoteException e) {
        Slog.e(TAG, "error in createSession", e);
        removeSessionStateLocked(sessionToken, userId);
        sendSessionTokenToClientLocked(sessionState.client, sessionState.inputId, null, null, sessionState.seq);
    }
    channels[1].dispose();
}
Also used : InputChannel(android.view.InputChannel) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback) RemoteException(android.os.RemoteException) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback)

Example 2 with ITvInputSessionCallback

use of android.media.tv.ITvInputSessionCallback in project platform_frameworks_base by android.

the class TvInputManagerService method createSessionInternalLocked.

private void createSessionInternalLocked(ITvInputService service, IBinder sessionToken, int userId) {
    UserState userState = getOrCreateUserStateLocked(userId);
    SessionState sessionState = userState.sessionStateMap.get(sessionToken);
    if (DEBUG) {
        Slog.d(TAG, "createSessionInternalLocked(inputId=" + sessionState.inputId + ")");
    }
    InputChannel[] channels = InputChannel.openInputChannelPair(sessionToken.toString());
    // Set up a callback to send the session token.
    ITvInputSessionCallback callback = new SessionCallback(sessionState, channels);
    // Create a session. When failed, send a null token immediately.
    try {
        if (sessionState.isRecordingSession) {
            service.createRecordingSession(callback, sessionState.inputId);
        } else {
            service.createSession(channels[1], callback, sessionState.inputId);
        }
    } catch (RemoteException e) {
        Slog.e(TAG, "error in createSession", e);
        removeSessionStateLocked(sessionToken, userId);
        sendSessionTokenToClientLocked(sessionState.client, sessionState.inputId, null, null, sessionState.seq);
    }
    channels[1].dispose();
}
Also used : InputChannel(android.view.InputChannel) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback) RemoteException(android.os.RemoteException) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback)

Example 3 with ITvInputSessionCallback

use of android.media.tv.ITvInputSessionCallback in project android_frameworks_base by ResurrectionRemix.

the class TvInputManagerService method createSessionInternalLocked.

private void createSessionInternalLocked(ITvInputService service, IBinder sessionToken, int userId) {
    UserState userState = getOrCreateUserStateLocked(userId);
    SessionState sessionState = userState.sessionStateMap.get(sessionToken);
    if (DEBUG) {
        Slog.d(TAG, "createSessionInternalLocked(inputId=" + sessionState.inputId + ")");
    }
    InputChannel[] channels = InputChannel.openInputChannelPair(sessionToken.toString());
    // Set up a callback to send the session token.
    ITvInputSessionCallback callback = new SessionCallback(sessionState, channels);
    // Create a session. When failed, send a null token immediately.
    try {
        if (sessionState.isRecordingSession) {
            service.createRecordingSession(callback, sessionState.inputId);
        } else {
            service.createSession(channels[1], callback, sessionState.inputId);
        }
    } catch (RemoteException e) {
        Slog.e(TAG, "error in createSession", e);
        removeSessionStateLocked(sessionToken, userId);
        sendSessionTokenToClientLocked(sessionState.client, sessionState.inputId, null, null, sessionState.seq);
    }
    channels[1].dispose();
}
Also used : InputChannel(android.view.InputChannel) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback) RemoteException(android.os.RemoteException) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback)

Example 4 with ITvInputSessionCallback

use of android.media.tv.ITvInputSessionCallback in project android_frameworks_base by crdroidandroid.

the class TvInputManagerService method createSessionInternalLocked.

private void createSessionInternalLocked(ITvInputService service, IBinder sessionToken, int userId) {
    UserState userState = getOrCreateUserStateLocked(userId);
    SessionState sessionState = userState.sessionStateMap.get(sessionToken);
    if (DEBUG) {
        Slog.d(TAG, "createSessionInternalLocked(inputId=" + sessionState.inputId + ")");
    }
    InputChannel[] channels = InputChannel.openInputChannelPair(sessionToken.toString());
    // Set up a callback to send the session token.
    ITvInputSessionCallback callback = new SessionCallback(sessionState, channels);
    // Create a session. When failed, send a null token immediately.
    try {
        if (sessionState.isRecordingSession) {
            service.createRecordingSession(callback, sessionState.inputId);
        } else {
            service.createSession(channels[1], callback, sessionState.inputId);
        }
    } catch (RemoteException e) {
        Slog.e(TAG, "error in createSession", e);
        removeSessionStateLocked(sessionToken, userId);
        sendSessionTokenToClientLocked(sessionState.client, sessionState.inputId, null, null, sessionState.seq);
    }
    channels[1].dispose();
}
Also used : InputChannel(android.view.InputChannel) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback) RemoteException(android.os.RemoteException) ITvInputSessionCallback(android.media.tv.ITvInputSessionCallback)

Aggregations

ITvInputSessionCallback (android.media.tv.ITvInputSessionCallback)4 RemoteException (android.os.RemoteException)4 InputChannel (android.view.InputChannel)4