Loading services/core/java/com/android/server/tv/TvInputManagerService.java +23 −13 Original line number Diff line number Diff line Loading @@ -277,10 +277,16 @@ public final class TvInputManagerService extends SystemService { } synchronized (mLock) { sessionState.session = session; if (session == null) { removeSessionStateLocked(sessionToken, userId); sendSessionTokenToClientLocked(sessionState.client, sessionState.name, null, sessionState.seq, userId); } else { sendSessionTokenToClientLocked(sessionState.client, sessionState.name, sessionToken, sessionState.seq, userId); } } } }; // Create a session. When failed, send a null token immediately. Loading @@ -288,6 +294,7 @@ public final class TvInputManagerService extends SystemService { service.createSession(callback); } catch (RemoteException e) { Log.e(TAG, "error in createSession", e); removeSessionStateLocked(sessionToken, userId); sendSessionTokenToClientLocked(sessionState.client, sessionState.name, null, sessionState.seq, userId); } Loading @@ -307,6 +314,19 @@ public final class TvInputManagerService extends SystemService { } } private void removeSessionStateLocked(IBinder sessionToken, int userId) { // Remove the session state from the global session state map of the current user. UserState userState = getUserStateLocked(userId); SessionState sessionState = userState.sessionStateMap.remove(sessionToken); // Also remove the session state from the session state map of the current service. ServiceState serviceState = userState.serviceStateMap.get(sessionState.name); if (serviceState != null) { serviceState.sessionStateMap.remove(sessionToken); } updateServiceConnectionLocked(sessionState.name, userId); } private final class BinderService extends ITvInputManager.Stub { @Override public List<TvInputInfo> getTvInputList(int userId) { Loading Loading @@ -474,17 +494,7 @@ public final class TvInputManagerService extends SystemService { Log.e(TAG, "error in release", e); } // Remove its state from the global session state map of the current user. UserState userState = getUserStateLocked(resolvedUserId); SessionState sessionState = userState.sessionStateMap.remove(sessionToken); // Also remove it from the session state map of the current service. ServiceState serviceState = userState.serviceStateMap.get(sessionState.name); if (serviceState != null) { serviceState.sessionStateMap.remove(sessionToken); } updateServiceConnectionLocked(sessionState.name, resolvedUserId); removeSessionStateLocked(sessionToken, resolvedUserId); } } finally { Binder.restoreCallingIdentity(identity); Loading Loading
services/core/java/com/android/server/tv/TvInputManagerService.java +23 −13 Original line number Diff line number Diff line Loading @@ -277,10 +277,16 @@ public final class TvInputManagerService extends SystemService { } synchronized (mLock) { sessionState.session = session; if (session == null) { removeSessionStateLocked(sessionToken, userId); sendSessionTokenToClientLocked(sessionState.client, sessionState.name, null, sessionState.seq, userId); } else { sendSessionTokenToClientLocked(sessionState.client, sessionState.name, sessionToken, sessionState.seq, userId); } } } }; // Create a session. When failed, send a null token immediately. Loading @@ -288,6 +294,7 @@ public final class TvInputManagerService extends SystemService { service.createSession(callback); } catch (RemoteException e) { Log.e(TAG, "error in createSession", e); removeSessionStateLocked(sessionToken, userId); sendSessionTokenToClientLocked(sessionState.client, sessionState.name, null, sessionState.seq, userId); } Loading @@ -307,6 +314,19 @@ public final class TvInputManagerService extends SystemService { } } private void removeSessionStateLocked(IBinder sessionToken, int userId) { // Remove the session state from the global session state map of the current user. UserState userState = getUserStateLocked(userId); SessionState sessionState = userState.sessionStateMap.remove(sessionToken); // Also remove the session state from the session state map of the current service. ServiceState serviceState = userState.serviceStateMap.get(sessionState.name); if (serviceState != null) { serviceState.sessionStateMap.remove(sessionToken); } updateServiceConnectionLocked(sessionState.name, userId); } private final class BinderService extends ITvInputManager.Stub { @Override public List<TvInputInfo> getTvInputList(int userId) { Loading Loading @@ -474,17 +494,7 @@ public final class TvInputManagerService extends SystemService { Log.e(TAG, "error in release", e); } // Remove its state from the global session state map of the current user. UserState userState = getUserStateLocked(resolvedUserId); SessionState sessionState = userState.sessionStateMap.remove(sessionToken); // Also remove it from the session state map of the current service. ServiceState serviceState = userState.serviceStateMap.get(sessionState.name); if (serviceState != null) { serviceState.sessionStateMap.remove(sessionToken); } updateServiceConnectionLocked(sessionState.name, resolvedUserId); removeSessionStateLocked(sessionToken, resolvedUserId); } } finally { Binder.restoreCallingIdentity(identity); Loading