Search in sources :

Example 1 with HdmiHotplugEvent

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

the class HdmiControlService method addHotplugEventListener.

private void addHotplugEventListener(final IHdmiHotplugEventListener listener) {
    final HotplugEventListenerRecord record = new HotplugEventListenerRecord(listener);
    try {
        listener.asBinder().linkToDeath(record, 0);
    } catch (RemoteException e) {
        Slog.w(TAG, "Listener already died");
        return;
    }
    synchronized (mLock) {
        mHotplugEventListenerRecords.add(record);
    }
    // Inform the listener of the initial state of each HDMI port by generating
    // hotplug events.
    runOnServiceThread(new Runnable() {

        @Override
        public void run() {
            synchronized (mLock) {
                if (!mHotplugEventListenerRecords.contains(record))
                    return;
            }
            for (HdmiPortInfo port : mPortInfo) {
                HdmiHotplugEvent event = new HdmiHotplugEvent(port.getId(), mCecController.isConnected(port.getId()));
                synchronized (mLock) {
                    invokeHotplugEventListenerLocked(listener, event);
                }
            }
        }
    });
}
Also used : HdmiPortInfo(android.hardware.hdmi.HdmiPortInfo) HdmiHotplugEvent(android.hardware.hdmi.HdmiHotplugEvent) RemoteException(android.os.RemoteException)

Example 2 with HdmiHotplugEvent

use of android.hardware.hdmi.HdmiHotplugEvent in project android_frameworks_base by DirtyUnicorns.

the class HdmiControlService method addHotplugEventListener.

private void addHotplugEventListener(final IHdmiHotplugEventListener listener) {
    final HotplugEventListenerRecord record = new HotplugEventListenerRecord(listener);
    try {
        listener.asBinder().linkToDeath(record, 0);
    } catch (RemoteException e) {
        Slog.w(TAG, "Listener already died");
        return;
    }
    synchronized (mLock) {
        mHotplugEventListenerRecords.add(record);
    }
    // Inform the listener of the initial state of each HDMI port by generating
    // hotplug events.
    runOnServiceThread(new Runnable() {

        @Override
        public void run() {
            synchronized (mLock) {
                if (!mHotplugEventListenerRecords.contains(record))
                    return;
            }
            for (HdmiPortInfo port : mPortInfo) {
                HdmiHotplugEvent event = new HdmiHotplugEvent(port.getId(), mCecController.isConnected(port.getId()));
                synchronized (mLock) {
                    invokeHotplugEventListenerLocked(listener, event);
                }
            }
        }
    });
}
Also used : HdmiPortInfo(android.hardware.hdmi.HdmiPortInfo) HdmiHotplugEvent(android.hardware.hdmi.HdmiHotplugEvent) RemoteException(android.os.RemoteException)

Example 3 with HdmiHotplugEvent

use of android.hardware.hdmi.HdmiHotplugEvent in project android_frameworks_base by crdroidandroid.

the class HdmiControlService method addHotplugEventListener.

private void addHotplugEventListener(final IHdmiHotplugEventListener listener) {
    final HotplugEventListenerRecord record = new HotplugEventListenerRecord(listener);
    try {
        listener.asBinder().linkToDeath(record, 0);
    } catch (RemoteException e) {
        Slog.w(TAG, "Listener already died");
        return;
    }
    synchronized (mLock) {
        mHotplugEventListenerRecords.add(record);
    }
    // Inform the listener of the initial state of each HDMI port by generating
    // hotplug events.
    runOnServiceThread(new Runnable() {

        @Override
        public void run() {
            synchronized (mLock) {
                if (!mHotplugEventListenerRecords.contains(record))
                    return;
            }
            for (HdmiPortInfo port : mPortInfo) {
                HdmiHotplugEvent event = new HdmiHotplugEvent(port.getId(), mCecController.isConnected(port.getId()));
                synchronized (mLock) {
                    invokeHotplugEventListenerLocked(listener, event);
                }
            }
        }
    });
}
Also used : HdmiPortInfo(android.hardware.hdmi.HdmiPortInfo) HdmiHotplugEvent(android.hardware.hdmi.HdmiHotplugEvent) RemoteException(android.os.RemoteException)

Example 4 with HdmiHotplugEvent

use of android.hardware.hdmi.HdmiHotplugEvent in project android_frameworks_base by AOSPA.

the class HdmiControlService method addHotplugEventListener.

private void addHotplugEventListener(final IHdmiHotplugEventListener listener) {
    final HotplugEventListenerRecord record = new HotplugEventListenerRecord(listener);
    try {
        listener.asBinder().linkToDeath(record, 0);
    } catch (RemoteException e) {
        Slog.w(TAG, "Listener already died");
        return;
    }
    synchronized (mLock) {
        mHotplugEventListenerRecords.add(record);
    }
    // Inform the listener of the initial state of each HDMI port by generating
    // hotplug events.
    runOnServiceThread(new Runnable() {

        @Override
        public void run() {
            synchronized (mLock) {
                if (!mHotplugEventListenerRecords.contains(record))
                    return;
            }
            for (HdmiPortInfo port : mPortInfo) {
                HdmiHotplugEvent event = new HdmiHotplugEvent(port.getId(), mCecController.isConnected(port.getId()));
                synchronized (mLock) {
                    invokeHotplugEventListenerLocked(listener, event);
                }
            }
        }
    });
}
Also used : HdmiPortInfo(android.hardware.hdmi.HdmiPortInfo) HdmiHotplugEvent(android.hardware.hdmi.HdmiHotplugEvent) RemoteException(android.os.RemoteException)

Example 5 with HdmiHotplugEvent

use of android.hardware.hdmi.HdmiHotplugEvent in project android_frameworks_base by ResurrectionRemix.

the class HdmiControlService method addHotplugEventListener.

private void addHotplugEventListener(final IHdmiHotplugEventListener listener) {
    final HotplugEventListenerRecord record = new HotplugEventListenerRecord(listener);
    try {
        listener.asBinder().linkToDeath(record, 0);
    } catch (RemoteException e) {
        Slog.w(TAG, "Listener already died");
        return;
    }
    synchronized (mLock) {
        mHotplugEventListenerRecords.add(record);
    }
    // Inform the listener of the initial state of each HDMI port by generating
    // hotplug events.
    runOnServiceThread(new Runnable() {

        @Override
        public void run() {
            synchronized (mLock) {
                if (!mHotplugEventListenerRecords.contains(record))
                    return;
            }
            for (HdmiPortInfo port : mPortInfo) {
                HdmiHotplugEvent event = new HdmiHotplugEvent(port.getId(), mCecController.isConnected(port.getId()));
                synchronized (mLock) {
                    invokeHotplugEventListenerLocked(listener, event);
                }
            }
        }
    });
}
Also used : HdmiPortInfo(android.hardware.hdmi.HdmiPortInfo) HdmiHotplugEvent(android.hardware.hdmi.HdmiHotplugEvent) RemoteException(android.os.RemoteException)

Aggregations

HdmiHotplugEvent (android.hardware.hdmi.HdmiHotplugEvent)5 HdmiPortInfo (android.hardware.hdmi.HdmiPortInfo)5 RemoteException (android.os.RemoteException)5