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

Commit 2d238f86 authored by Shubang Lu's avatar Shubang Lu Committed by Android (Google) Code Review
Browse files

Merge "[CSAI] fix createSession failure" into main

parents 27decd8e d7edec96
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -659,6 +659,11 @@ public class TvAdView extends ViewGroup {
        }
    }

    /** @hide */
    public TvAdManager.Session getAdSession() {
        return mSession;
    }

    private class MySessionCallback extends TvAdManager.SessionCallback {
        final String mServiceId;

+3 −3
Original line number Diff line number Diff line
@@ -349,6 +349,7 @@ public class TvInteractiveAppManagerService extends SystemService {
            }
        }

        userState.mAdServiceMap.clear();
        userState.mAdServiceMap = adServiceMap;
    }

@@ -988,7 +989,7 @@ public class TvInteractiveAppManagerService extends SystemService {
                        return;
                    }
                    UserState userState = getOrCreateUserStateLocked(resolvedUserId);
                    TvAdServiceState adState = userState.mAdMap.get(serviceId);
                    TvAdServiceState adState = userState.mAdServiceMap.get(serviceId);
                    if (adState == null) {
                        Slogf.w(TAG, "Failed to find state for serviceId=" + serviceId);
                        sendAdSessionTokenToClientLocked(client, serviceId, null, null, seq);
@@ -3031,6 +3032,7 @@ public class TvInteractiveAppManagerService extends SystemService {
            ITvAdService service, IBinder sessionToken, int userId) {
        UserState userState = getOrCreateUserStateLocked(userId);
        AdSessionState sessionState = userState.mAdSessionStateMap.get(sessionToken);

        if (DEBUG) {
            Slogf.d(TAG, "createAdSessionInternalLocked(iAppServiceId="
                    + sessionState.mAdServiceId + ")");
@@ -3300,8 +3302,6 @@ public class TvInteractiveAppManagerService extends SystemService {

    private static final class UserState {
        private final int mUserId;
        // A mapping from the TV AD service ID to its TvAdServiceState.
        private Map<String, TvAdServiceState> mAdMap = new HashMap<>();
        // A mapping from the name of a TV Interactive App service to its state.
        private final Map<ComponentName, AdServiceState> mAdServiceStateMap = new HashMap<>();
        // A mapping from the token of a TV Interactive App session to its state.