Search in sources :

Example 81 with HdmiDeviceInfo

use of android.hardware.hdmi.HdmiDeviceInfo in project platform_frameworks_base by android.

the class HdmiCecLocalDeviceTv method isInDeviceList.

/**
     * Whether a device of the specified physical address and logical address exists
     * in a device info list. However, both are minimal condition and it could
     * be different device from the original one.
     *
     * @param logicalAddress logical address of a device to be searched
     * @param physicalAddress physical address of a device to be searched
     * @return true if exist; otherwise false
     */
@ServiceThreadOnly
boolean isInDeviceList(int logicalAddress, int physicalAddress) {
    assertRunOnServiceThread();
    HdmiDeviceInfo device = getCecDeviceInfo(logicalAddress);
    if (device == null) {
        return false;
    }
    return device.getPhysicalAddress() == physicalAddress;
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) ServiceThreadOnly(com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly)

Example 82 with HdmiDeviceInfo

use of android.hardware.hdmi.HdmiDeviceInfo in project platform_frameworks_base by android.

the class HdmiCecLocalDeviceTv method clearDeviceInfoList.

// Clear all device info.
@ServiceThreadOnly
private void clearDeviceInfoList() {
    assertRunOnServiceThread();
    for (HdmiDeviceInfo info : mSafeExternalInputs) {
        invokeDeviceEventListener(info, HdmiControlManager.DEVICE_EVENT_REMOVE_DEVICE);
    }
    mDeviceInfos.clear();
    updateSafeDeviceInfoList();
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) ServiceThreadOnly(com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly)

Example 83 with HdmiDeviceInfo

use of android.hardware.hdmi.HdmiDeviceInfo in project platform_frameworks_base by android.

the class HdmiCecLocalDeviceTv method handleInactiveSource.

@Override
@ServiceThreadOnly
protected boolean handleInactiveSource(HdmiCecMessage message) {
    assertRunOnServiceThread();
    // Ignore <Inactive Source> from non-active source device.
    if (getActiveSource().logicalAddress != message.getSource()) {
        return true;
    }
    if (isProhibitMode()) {
        return true;
    }
    int portId = getPrevPortId();
    if (portId != Constants.INVALID_PORT_ID) {
        // TODO: Do this only if TV is not showing multiview like PIP/PAP.
        HdmiDeviceInfo inactiveSource = getCecDeviceInfo(message.getSource());
        if (inactiveSource == null) {
            return true;
        }
        if (mService.pathToPortId(inactiveSource.getPhysicalAddress()) == portId) {
            return true;
        }
        // TODO: Switch the TV freeze mode off
        doManualPortSwitching(portId, null);
        setPrevPortId(Constants.INVALID_PORT_ID);
    } else {
        // No HDMI port to switch to was found. Notify the input change listers to
        // switch to the lastly shown internal input.
        mActiveSource.invalidate();
        setActivePath(Constants.INVALID_PHYSICAL_ADDRESS);
        mService.invokeInputChangeListener(HdmiDeviceInfo.INACTIVE_DEVICE);
    }
    return true;
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) ServiceThreadOnly(com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly)

Example 84 with HdmiDeviceInfo

use of android.hardware.hdmi.HdmiDeviceInfo in project platform_frameworks_base by android.

the class HdmiCecLocalDeviceTv method changeSystemAudioMode.

@ServiceThreadOnly
// Seq #32
void changeSystemAudioMode(boolean enabled, IHdmiControlCallback callback) {
    assertRunOnServiceThread();
    if (!mService.isControlEnabled() || hasAction(DeviceDiscoveryAction.class)) {
        setSystemAudioMode(false, true);
        invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE);
        return;
    }
    HdmiDeviceInfo avr = getAvrDeviceInfo();
    if (avr == null) {
        setSystemAudioMode(false, true);
        invokeCallback(callback, HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE);
        return;
    }
    addAndStartAction(new SystemAudioActionFromTv(this, avr.getLogicalAddress(), enabled, callback));
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) ServiceThreadOnly(com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly)

Example 85 with HdmiDeviceInfo

use of android.hardware.hdmi.HdmiDeviceInfo in project platform_frameworks_base by android.

the class HdmiCecLocalDeviceTv method dump.

@Override
protected void dump(final IndentingPrintWriter pw) {
    super.dump(pw);
    pw.println("mArcEstablished: " + mArcEstablished);
    pw.println("mArcFeatureEnabled: " + mArcFeatureEnabled);
    pw.println("mSystemAudioActivated: " + mSystemAudioActivated);
    pw.println("mSystemAudioMute: " + mSystemAudioMute);
    pw.println("mAutoDeviceOff: " + mAutoDeviceOff);
    pw.println("mAutoWakeup: " + mAutoWakeup);
    pw.println("mSkipRoutingControl: " + mSkipRoutingControl);
    pw.println("mPrevPortId: " + mPrevPortId);
    pw.println("CEC devices:");
    pw.increaseIndent();
    for (HdmiDeviceInfo info : mSafeAllDeviceInfos) {
        pw.println(info);
    }
    pw.decreaseIndent();
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo)

Aggregations

HdmiDeviceInfo (android.hardware.hdmi.HdmiDeviceInfo)172 ServiceThreadOnly (com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly)110 ArrayList (java.util.ArrayList)15 TvInputHardwareInfo (android.media.tv.TvInputHardwareInfo)12 HdmiPortInfo (android.hardware.hdmi.HdmiPortInfo)10 SendMessageCallback (com.android.server.hdmi.HdmiControlService.SendMessageCallback)10 IHdmiControlCallback (android.hardware.hdmi.IHdmiControlCallback)5 RemoteException (android.os.RemoteException)5 ArraySet (android.util.ArraySet)5 SparseArray (android.util.SparseArray)5 SparseIntArray (android.util.SparseIntArray)5 InputChannel (android.view.InputChannel)5 SomeArgs (com.android.internal.os.SomeArgs)5 DeviceDiscoveryCallback (com.android.server.hdmi.DeviceDiscoveryAction.DeviceDiscoveryCallback)5 AllocateAddressCallback (com.android.server.hdmi.HdmiCecController.AllocateAddressCallback)5 ActiveSource (com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 BitSet (java.util.BitSet)5 TvInputInfo (android.media.tv.TvInputInfo)4 Message (android.os.Message)4