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

Commit 5b838616 authored by Yixiao Luo's avatar Yixiao Luo
Browse files

External TV Input Logging: update logging in addHdmiInput()

Bug: 279185950
Test: manual
Change-Id: I7f7729f68d9739acbec81a236e4fe91acc0895df
parent 65ce0257
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -3432,15 +3432,22 @@ public final class TvInputManagerService extends SystemService {
                synchronized (mLock) {
                    mTvInputHardwareManager.addHdmiInput(id, inputInfo);
                    addHardwareInputLocked(inputInfo);
                    // catch the use case when a CEC device is unplugged from
                    // an HDMI port, then plugged in to the same HDMI port.
                    if (mCurrentInputId != null && mCurrentSessionState != null
                            && mCurrentInputId.equals(inputInfo.getParentId())
                            && inputInfo.getId().equals(mCurrentSessionState.inputId)) {
                    if (mCurrentInputId != null && mCurrentSessionState != null) {
                        if (TextUtils.equals(mCurrentInputId, inputInfo.getParentId())) {
                            // catch the use case when a CEC device is plugged in an HDMI port,
                            // and TV app does not explicitly call tune() to the added CEC input.
                            logExternalInputEvent(
                                    FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__TUNED,
                                    inputInfo.getId(), mCurrentSessionState);
                            mCurrentInputId = inputInfo.getId();
                        } else if (TextUtils.equals(mCurrentInputId, inputInfo.getId())) {
                            // catch the use case when a CEC device disconnects itself
                            // and reconnects to update info.
                            logExternalInputEvent(
                                    FrameworkStatsLog
                                        .EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__DEVICE_INFO_UPDATED,
                                    mCurrentInputId, mCurrentSessionState);
                        }
                    }
                }
            } finally {