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

Commit 26dc71e7 authored by Jungshik Jang's avatar Jungshik Jang
Browse files

Remove two TODOs from HotpulgDetectionAction.

Bug: 15844023
Bug: 15841646

Change-Id: I4022c48a9fdb1963f755895ec5ff0370157050c7
parent 40d43b27
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -891,12 +891,14 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    final void removeCecDevice(int address) {
        assertRunOnServiceThread();
        HdmiCecDeviceInfo info = removeDeviceInfo(address);
        handleRemoveActiveRoutingPath(info.getPhysicalAddress());

        mCecMessageCache.flushMessagesFrom(address);
        mService.invokeDeviceEventListeners(info, false);
    }

    private void handleRemoveActiveRoutingPath(int path) {
    @ServiceThreadOnly
    void handleRemoveActiveRoutingPath(int path) {
        assertRunOnServiceThread();
        // Seq #23
        if (isTailOfActivePath(path, getActivePath())) {
            removeAction(RoutingControlAction.class);
+6 −7
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import java.util.List;
 * If system audio is on, check hot-plug for audio system every 5 secs.
 * For other devices, keep 15 secs period.
 */
// #Seq 3
final class HotplugDetectionAction extends FeatureAction {
    private static final String TAG = "HotPlugDetectionAction";

@@ -193,14 +194,12 @@ final class HotplugDetectionAction extends FeatureAction {
    }

    private void addDevice(int addedAddress) {
        // Send <Give Physical Address>.
        // Sending <Give Physical Address> will initiate new device action.
        sendCommand(HdmiCecMessageBuilder.buildGivePhysicalAddress(getSourceAddress(),
                addedAddress));
    }

    private void removeDevice(int removedAddress) {
        // TODO: move the following logic to local device once move many logic to
        //       local device.
        mayChangeRoutingPath(removedAddress);
        mayCancelDeviceSelect(removedAddress);
        mayCancelOneTouchRecord(removedAddress);
@@ -210,10 +209,10 @@ final class HotplugDetectionAction extends FeatureAction {
    }

    private void mayChangeRoutingPath(int address) {
        // TODO: if removed address is current active source, it should change active source
        // path new one. we can keep previous selection or can choose default input,
        // such as internal tuner. Consider send intent to app so that app
        // can handle it.
        HdmiCecDeviceInfo info = tv().getDeviceInfo(address);
        if (info != null) {
            tv().handleRemoveActiveRoutingPath(info.getPhysicalAddress());
        }
    }

    private void mayCancelDeviceSelect(int address) {