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

Commit 2fc3b031 authored by Yixiao Luo's avatar Yixiao Luo
Browse files

Sync updated TvInputInfo to serviceState.hardWareInputMap and TvInputHardwareManager

Bug: 288190389
Test: mmm
Change-Id: Ie9dd597f75c731f9a9c45fb1693932433b0e106d
parent 753acc68
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) {