Search in sources :

Example 16 with TvInputHardwareInfo

use of android.media.tv.TvInputHardwareInfo in project android_frameworks_base by crdroidandroid.

the class TvInputHardwareManager method onDeviceUnavailable.

@Override
public void onDeviceUnavailable(int deviceId) {
    synchronized (mLock) {
        Connection connection = mConnections.get(deviceId);
        if (connection == null) {
            Slog.e(TAG, "onDeviceUnavailable: Cannot find a connection with " + deviceId);
            return;
        }
        connection.resetLocked(null, null, null, null, null);
        mConnections.remove(deviceId);
        buildHardwareListLocked();
        TvInputHardwareInfo info = connection.getHardwareInfoLocked();
        if (info.getType() == TvInputHardwareInfo.TV_INPUT_TYPE_HDMI) {
            // Remove HDMI devices linked with this hardware.
            for (Iterator<HdmiDeviceInfo> it = mHdmiDeviceList.iterator(); it.hasNext(); ) {
                HdmiDeviceInfo deviceInfo = it.next();
                if (deviceInfo.getPortId() == info.getHdmiPortId()) {
                    mHandler.obtainMessage(ListenerHandler.HDMI_DEVICE_REMOVED, 0, 0, deviceInfo).sendToTarget();
                    it.remove();
                }
            }
        }
        mHandler.obtainMessage(ListenerHandler.HARDWARE_DEVICE_REMOVED, 0, 0, info).sendToTarget();
    }
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) TvInputHardwareInfo(android.media.tv.TvInputHardwareInfo)

Aggregations

TvInputHardwareInfo (android.media.tv.TvInputHardwareInfo)16 HdmiDeviceInfo (android.hardware.hdmi.HdmiDeviceInfo)12 TvInputInfo (android.media.tv.TvInputInfo)4 Message (android.os.Message)4 ArrayMap (android.util.ArrayMap)4 IndentingPrintWriter (com.android.internal.util.IndentingPrintWriter)4 Map (java.util.Map)4