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

Commit e8e0e665 authored by Yixiao Luo's avatar Yixiao Luo Committed by Automerger Merge Worker
Browse files

Merge "Fix new TIF code" into udc-dev am: d9891b87

parents 0d5e3f4c d9891b87
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -249,7 +249,8 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand
            }
            }
            case DO_SELECT_AUDIO_PRESENTATION: {
            case DO_SELECT_AUDIO_PRESENTATION: {
                SomeArgs args = (SomeArgs) msg.obj;
                SomeArgs args = (SomeArgs) msg.obj;
                mTvInputSessionImpl.selectAudioPresentation(args.argi1, args.argi2);
                mTvInputSessionImpl.selectAudioPresentation(
                        (Integer) args.arg1, (Integer) args.arg2);
                args.recycle();
                args.recycle();
                break;
                break;
            }
            }
@@ -348,8 +349,8 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand


    @Override
    @Override
    public void selectAudioPresentation(int presentationId, int programId) {
    public void selectAudioPresentation(int presentationId, int programId) {
        mCaller.executeOrSendMessage(mCaller.obtainMessageII(DO_SELECT_AUDIO_PRESENTATION,
        mCaller.executeOrSendMessage(
                                                             presentationId, programId));
                mCaller.obtainMessageOO(DO_SELECT_AUDIO_PRESENTATION, presentationId, programId));
    }
    }


    @Override
    @Override
+11 −9
Original line number Original line Diff line number Diff line
@@ -815,8 +815,8 @@ public final class TvInputManagerService extends SystemService {
    }
    }


    @GuardedBy("mLock")
    @GuardedBy("mLock")
    private boolean createSessionInternalLocked(ITvInputService service, IBinder sessionToken,
    private boolean createSessionInternalLocked(
            int userId, AttributionSource tvAppAttributionSource) {
            ITvInputService service, IBinder sessionToken, int userId) {
        UserState userState = getOrCreateUserStateLocked(userId);
        UserState userState = getOrCreateUserStateLocked(userId);
        SessionState sessionState = userState.sessionStateMap.get(sessionToken);
        SessionState sessionState = userState.sessionStateMap.get(sessionToken);
        if (DEBUG) {
        if (DEBUG) {
@@ -836,7 +836,7 @@ public final class TvInputManagerService extends SystemService {
                        callback, sessionState.inputId, sessionState.sessionId);
                        callback, sessionState.inputId, sessionState.sessionId);
            } else {
            } else {
                service.createSession(channels[1], callback, sessionState.inputId,
                service.createSession(channels[1], callback, sessionState.inputId,
                        sessionState.sessionId, tvAppAttributionSource);
                        sessionState.sessionId, sessionState.tvAppAttributionSource);
            }
            }
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            Slog.e(TAG, "error in createSession", e);
            Slog.e(TAG, "error in createSession", e);
@@ -1547,7 +1547,7 @@ public final class TvInputManagerService extends SystemService {
                    IBinder sessionToken = new Binder();
                    IBinder sessionToken = new Binder();
                    SessionState sessionState = new SessionState(sessionToken, info.getId(),
                    SessionState sessionState = new SessionState(sessionToken, info.getId(),
                            info.getComponent(), isRecordingSession, client, seq, callingUid,
                            info.getComponent(), isRecordingSession, client, seq, callingUid,
                            callingPid, resolvedUserId, uniqueSessionId);
                            callingPid, resolvedUserId, uniqueSessionId, tvAppAttributionSource);


                    // Add them to the global session state map of the current user.
                    // Add them to the global session state map of the current user.
                    userState.sessionStateMap.put(sessionToken, sessionState);
                    userState.sessionStateMap.put(sessionToken, sessionState);
@@ -1559,8 +1559,8 @@ public final class TvInputManagerService extends SystemService {
                    serviceState.sessionTokens.add(sessionToken);
                    serviceState.sessionTokens.add(sessionToken);


                    if (serviceState.service != null) {
                    if (serviceState.service != null) {
                        if (!createSessionInternalLocked(serviceState.service, sessionToken,
                        if (!createSessionInternalLocked(
                                    resolvedUserId, tvAppAttributionSource)) {
                                    serviceState.service, sessionToken, resolvedUserId)) {
                            removeSessionStateLocked(sessionToken, resolvedUserId);
                            removeSessionStateLocked(sessionToken, resolvedUserId);
                        }
                        }
                    } else {
                    } else {
@@ -3135,6 +3135,7 @@ public final class TvInputManagerService extends SystemService {
        private final ComponentName componentName;
        private final ComponentName componentName;
        private final boolean isRecordingSession;
        private final boolean isRecordingSession;
        private final ITvInputClient client;
        private final ITvInputClient client;
        private final AttributionSource tvAppAttributionSource;
        private final int seq;
        private final int seq;
        /**
        /**
         * The {code UID} of the application that created the session.
         * The {code UID} of the application that created the session.
@@ -3163,7 +3164,8 @@ public final class TvInputManagerService extends SystemService {


        private SessionState(IBinder sessionToken, String inputId, ComponentName componentName,
        private SessionState(IBinder sessionToken, String inputId, ComponentName componentName,
                boolean isRecordingSession, ITvInputClient client, int seq, int callingUid,
                boolean isRecordingSession, ITvInputClient client, int seq, int callingUid,
                int callingPid, int userId, String sessionId) {
                int callingPid, int userId, String sessionId,
                AttributionSource tvAppAttributionSource) {
            this.sessionToken = sessionToken;
            this.sessionToken = sessionToken;
            this.inputId = inputId;
            this.inputId = inputId;
            this.componentName = componentName;
            this.componentName = componentName;
@@ -3174,6 +3176,7 @@ public final class TvInputManagerService extends SystemService {
            this.callingPid = callingPid;
            this.callingPid = callingPid;
            this.userId = userId;
            this.userId = userId;
            this.sessionId = sessionId;
            this.sessionId = sessionId;
            this.tvAppAttributionSource = tvAppAttributionSource;
        }
        }


        @Override
        @Override
@@ -3223,8 +3226,7 @@ public final class TvInputManagerService extends SystemService {


                // And create sessions, if any.
                // And create sessions, if any.
                for (IBinder sessionToken : serviceState.sessionTokens) {
                for (IBinder sessionToken : serviceState.sessionTokens) {
                    if (!createSessionInternalLocked(
                    if (!createSessionInternalLocked(serviceState.service, sessionToken, mUserId)) {
                                serviceState.service, sessionToken, mUserId, null)) {
                        tokensToBeRemoved.add(sessionToken);
                        tokensToBeRemoved.add(sessionToken);
                    }
                    }
                }
                }