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();
}
}
Aggregations