Search in sources :

Example 11 with TvInputHardwareInfo

use of android.media.tv.TvInputHardwareInfo in project platform_frameworks_base by android.

the class TvInputHardwareManager method processPendingHdmiDeviceEventsLocked.

private void processPendingHdmiDeviceEventsLocked() {
    for (Iterator<Message> it = mPendingHdmiDeviceEvents.iterator(); it.hasNext(); ) {
        Message msg = it.next();
        HdmiDeviceInfo deviceInfo = (HdmiDeviceInfo) msg.obj;
        TvInputHardwareInfo hardwareInfo = findHardwareInfoForHdmiPortLocked(deviceInfo.getPortId());
        if (hardwareInfo != null) {
            msg.sendToTarget();
            it.remove();
        }
    }
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) TvInputHardwareInfo(android.media.tv.TvInputHardwareInfo) Message(android.os.Message)

Example 12 with TvInputHardwareInfo

use of android.media.tv.TvInputHardwareInfo in project platform_frameworks_base by android.

the class TvInputHardwareManager method dump.

public void dump(FileDescriptor fd, final PrintWriter writer, String[] args) {
    final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) {
        pw.println("Permission Denial: can't dump TvInputHardwareManager from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid());
        return;
    }
    synchronized (mLock) {
        pw.println("TvInputHardwareManager Info:");
        pw.increaseIndent();
        pw.println("mConnections: deviceId -> Connection");
        pw.increaseIndent();
        for (int i = 0; i < mConnections.size(); i++) {
            int deviceId = mConnections.keyAt(i);
            Connection mConnection = mConnections.valueAt(i);
            pw.println(deviceId + ": " + mConnection);
        }
        pw.decreaseIndent();
        pw.println("mHardwareList:");
        pw.increaseIndent();
        for (TvInputHardwareInfo tvInputHardwareInfo : mHardwareList) {
            pw.println(tvInputHardwareInfo);
        }
        pw.decreaseIndent();
        pw.println("mHdmiDeviceList:");
        pw.increaseIndent();
        for (HdmiDeviceInfo hdmiDeviceInfo : mHdmiDeviceList) {
            pw.println(hdmiDeviceInfo);
        }
        pw.decreaseIndent();
        pw.println("mHardwareInputIdMap: deviceId -> inputId");
        pw.increaseIndent();
        for (int i = 0; i < mHardwareInputIdMap.size(); i++) {
            int deviceId = mHardwareInputIdMap.keyAt(i);
            String inputId = mHardwareInputIdMap.valueAt(i);
            pw.println(deviceId + ": " + inputId);
        }
        pw.decreaseIndent();
        pw.println("mHdmiInputIdMap: id -> inputId");
        pw.increaseIndent();
        for (int i = 0; i < mHdmiInputIdMap.size(); i++) {
            int id = mHdmiInputIdMap.keyAt(i);
            String inputId = mHdmiInputIdMap.valueAt(i);
            pw.println(id + ": " + inputId);
        }
        pw.decreaseIndent();
        pw.println("mInputMap: inputId -> inputInfo");
        pw.increaseIndent();
        for (Map.Entry<String, TvInputInfo> entry : mInputMap.entrySet()) {
            pw.println(entry.getKey() + ": " + entry.getValue());
        }
        pw.decreaseIndent();
        pw.decreaseIndent();
    }
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) TvInputHardwareInfo(android.media.tv.TvInputHardwareInfo) TvInputInfo(android.media.tv.TvInputInfo) Map(java.util.Map) ArrayMap(android.util.ArrayMap) IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

Example 13 with TvInputHardwareInfo

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

the class TvInputHardwareManager method addHardwareInput.

public void addHardwareInput(int deviceId, TvInputInfo info) {
    synchronized (mLock) {
        String oldInputId = mHardwareInputIdMap.get(deviceId);
        if (oldInputId != null) {
            Slog.w(TAG, "Trying to override previous registration: old = " + mInputMap.get(oldInputId) + ":" + deviceId + ", new = " + info + ":" + deviceId);
        }
        mHardwareInputIdMap.put(deviceId, info.getId());
        mInputMap.put(info.getId(), info);
        // For logical HDMI devices, they have information from HDMI CEC signals.
        for (int i = 0; i < mHdmiStateMap.size(); ++i) {
            TvInputHardwareInfo hardwareInfo = findHardwareInfoForHdmiPortLocked(mHdmiStateMap.keyAt(i));
            if (hardwareInfo == null) {
                continue;
            }
            String inputId = mHardwareInputIdMap.get(hardwareInfo.getDeviceId());
            if (inputId != null && inputId.equals(info.getId())) {
                mHandler.obtainMessage(ListenerHandler.STATE_CHANGED, convertConnectedToState(mHdmiStateMap.valueAt(i)), 0, inputId).sendToTarget();
                return;
            }
        }
        // For the rest of the devices, we can tell by the number of available streams.
        Connection connection = mConnections.get(deviceId);
        if (connection != null) {
            mHandler.obtainMessage(ListenerHandler.STATE_CHANGED, convertConnectedToState(connection.getConfigsLocked().length > 0), 0, info.getId()).sendToTarget();
        }
    }
}
Also used : TvInputHardwareInfo(android.media.tv.TvInputHardwareInfo)

Example 14 with TvInputHardwareInfo

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

the class TvInputHardwareManager method processPendingHdmiDeviceEventsLocked.

private void processPendingHdmiDeviceEventsLocked() {
    for (Iterator<Message> it = mPendingHdmiDeviceEvents.iterator(); it.hasNext(); ) {
        Message msg = it.next();
        HdmiDeviceInfo deviceInfo = (HdmiDeviceInfo) msg.obj;
        TvInputHardwareInfo hardwareInfo = findHardwareInfoForHdmiPortLocked(deviceInfo.getPortId());
        if (hardwareInfo != null) {
            msg.sendToTarget();
            it.remove();
        }
    }
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) TvInputHardwareInfo(android.media.tv.TvInputHardwareInfo) Message(android.os.Message)

Example 15 with TvInputHardwareInfo

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

the class TvInputHardwareManager method dump.

public void dump(FileDescriptor fd, final PrintWriter writer, String[] args) {
    final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) {
        pw.println("Permission Denial: can't dump TvInputHardwareManager from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid());
        return;
    }
    synchronized (mLock) {
        pw.println("TvInputHardwareManager Info:");
        pw.increaseIndent();
        pw.println("mConnections: deviceId -> Connection");
        pw.increaseIndent();
        for (int i = 0; i < mConnections.size(); i++) {
            int deviceId = mConnections.keyAt(i);
            Connection mConnection = mConnections.valueAt(i);
            pw.println(deviceId + ": " + mConnection);
        }
        pw.decreaseIndent();
        pw.println("mHardwareList:");
        pw.increaseIndent();
        for (TvInputHardwareInfo tvInputHardwareInfo : mHardwareList) {
            pw.println(tvInputHardwareInfo);
        }
        pw.decreaseIndent();
        pw.println("mHdmiDeviceList:");
        pw.increaseIndent();
        for (HdmiDeviceInfo hdmiDeviceInfo : mHdmiDeviceList) {
            pw.println(hdmiDeviceInfo);
        }
        pw.decreaseIndent();
        pw.println("mHardwareInputIdMap: deviceId -> inputId");
        pw.increaseIndent();
        for (int i = 0; i < mHardwareInputIdMap.size(); i++) {
            int deviceId = mHardwareInputIdMap.keyAt(i);
            String inputId = mHardwareInputIdMap.valueAt(i);
            pw.println(deviceId + ": " + inputId);
        }
        pw.decreaseIndent();
        pw.println("mHdmiInputIdMap: id -> inputId");
        pw.increaseIndent();
        for (int i = 0; i < mHdmiInputIdMap.size(); i++) {
            int id = mHdmiInputIdMap.keyAt(i);
            String inputId = mHdmiInputIdMap.valueAt(i);
            pw.println(id + ": " + inputId);
        }
        pw.decreaseIndent();
        pw.println("mInputMap: inputId -> inputInfo");
        pw.increaseIndent();
        for (Map.Entry<String, TvInputInfo> entry : mInputMap.entrySet()) {
            pw.println(entry.getKey() + ": " + entry.getValue());
        }
        pw.decreaseIndent();
        pw.decreaseIndent();
    }
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) TvInputHardwareInfo(android.media.tv.TvInputHardwareInfo) TvInputInfo(android.media.tv.TvInputInfo) Map(java.util.Map) ArrayMap(android.util.ArrayMap) IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

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