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

Commit aa6a67a3 authored by Yuncheol Heo's avatar Yuncheol Heo Committed by Android (Google) Code Review
Browse files

Merge "Invoke the callback only when DeviceInfo is available." into lmp-dev

parents 62802533 7c5d31ea
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -856,8 +856,11 @@ public final class HdmiControlService extends SystemService {
                device.onDeviceRemoved();
                // There is no explicit event for device removal unlike capability register event
                // used for device addition . Hence we remove the device on hotplug event.
                invokeDeviceEventListeners(device.getInfo(), DEVICE_EVENT_REMOVE_DEVICE);
                HdmiDeviceInfo deviceInfo = device.getInfo();
                if (deviceInfo != null) {
                    invokeDeviceEventListeners(deviceInfo, DEVICE_EVENT_REMOVE_DEVICE);
                    updateSafeMhlInput();
                }
            } else {
                Slog.w(TAG, "No device to remove:[portId=" + portId);
            }
@@ -1082,7 +1085,7 @@ public final class HdmiControlService extends SystemService {
                        // the connected mobile device, start routing control to switch ports.
                        // callback is handled by MHL action.
                        device.turnOn(callback);
                        tv.doManualPortSwitching(device.getInfo().getPortId(), null);
                        tv.doManualPortSwitching(device.getPortId(), null);
                        return;
                    }
                    tv.deviceSelect(deviceId, callback);