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

Commit a21f245b authored by Sherry Huang's avatar Sherry Huang Committed by Android (Google) Code Review
Browse files

Merge "TIF: update throw exception to log exception in servicestate" into main

parents 2532e7f7 8f87c0b1
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -837,8 +837,7 @@ public final class TvInputManagerService extends SystemService {
        UserState userState = getOrCreateUserStateLocked(userId);
        ServiceState serviceState = userState.serviceStateMap.get(component);
        if (serviceState == null) {
            throw new IllegalStateException("Service state not found for " + component + " (userId="
                    + userId + ")");
            Slog.e(TAG, "Service state not found for " + component + " (userId=" + userId + ")");
        }
        return serviceState;
    }
@@ -1098,7 +1097,7 @@ public final class TvInputManagerService extends SystemService {
                        Process.SYSTEM_UID, userId);
            }
            ServiceState serviceState = getServiceStateLocked(sessionState.componentName, userId);
            if (!serviceState.isHardware) {
            if (serviceState == null || !serviceState.isHardware) {
                return;
            }
            ITvInputSession session = getSessionLocked(sessionState);
@@ -3735,6 +3734,7 @@ public final class TvInputManagerService extends SystemService {
    private void addHardwareInputLocked(
            TvInputInfo inputInfo, ComponentName component, int userId) {
        ServiceState serviceState = getServiceStateLocked(component, userId);
        if (serviceState == null) return;
        serviceState.hardwareInputMap.put(inputInfo.getId(), inputInfo);
        setPictureProfileLocked(inputInfo.getId());
        buildTvInputListLocked(userId, null);
@@ -3760,8 +3760,10 @@ public final class TvInputManagerService extends SystemService {
        }
        ComponentName component = mTvInputHardwareManager.getInputMap().get(inputId).getComponent();
        ServiceState serviceState = getServiceStateLocked(component, userId);
         if (serviceState != null) {
            serviceState.hardwareInputMap.remove(inputId);
            buildTvInputListLocked(userId, null);
        }
        mTvInputHardwareManager.removeHardwareInput(inputId);
    }

@@ -3924,7 +3926,8 @@ public final class TvInputManagerService extends SystemService {
            try {
                synchronized (mLock) {
                    ServiceState serviceState = getServiceStateLocked(mComponent, mUserId);
                    if (serviceState.hardwareInputMap.containsKey(inputInfo.getId())) {
                    if (serviceState != null && serviceState.hardwareInputMap.containsKey(
                            inputInfo.getId())) {
                        return;
                    }
                    Slog.d(TAG, "ServiceCallback: addHardwareInput, deviceId: " + deviceId +
@@ -3945,7 +3948,8 @@ public final class TvInputManagerService extends SystemService {
            try {
                synchronized (mLock) {
                    ServiceState serviceState = getServiceStateLocked(mComponent, mUserId);
                    if (serviceState.hardwareInputMap.containsKey(inputInfo.getId())) {
                    if (serviceState != null && serviceState.hardwareInputMap.containsKey(
                            inputInfo.getId())) {
                        return;
                    }
                    Slog.d(TAG, "ServiceCallback: addHdmiInput, id: " + id +