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

Commit 39c1fb91 authored by Yixiao Luo's avatar Yixiao Luo Committed by Android (Google) Code Review
Browse files

Merge "Sync updated TvInputInfo to serviceState.hardWareInputMap and TvInputHardwareManager"

parents 42b2ec63 2fc3b031
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -396,6 +396,16 @@ class TvInputHardwareManager implements TvInputHal.Callback {
        }
    }

    public void updateInputInfo(TvInputInfo info) {
        synchronized (mLock) {
            if (!mInputMap.containsKey(info.getId())) {
                return;
            }
            Slog.w(TAG, "update inputInfo for input id " + info.getId());
            mInputMap.put(info.getId(), info);
        }
    }

    /**
     * Create a TvInputHardware object with a specific deviceId. One service at a time can access
     * the object, and if more than one process attempts to create hardware with the same deviceId,
+5 −0
Original line number Diff line number Diff line
@@ -1067,6 +1067,11 @@ public final class TvInputManagerService extends SystemService {
        }
        inputState.info = inputInfo;
        inputState.uid = getInputUid(inputInfo);
        ServiceState serviceState = userState.serviceStateMap.get(inputInfo.getComponent());
        if (serviceState != null && serviceState.isHardware) {
            serviceState.hardwareInputMap.put(inputInfo.getId(), inputInfo);
            mTvInputHardwareManager.updateInputInfo(inputInfo);
        }

        int n = userState.mCallbacks.beginBroadcast();
        for (int i = 0; i < n; ++i) {