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();
}
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();
}
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();
}
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();
}
Aggregations