android.os.Looper#getQueue ( )源码实例Demo

下面列出了android.os.Looper#getQueue ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android_9.0.0_r45   文件: FrameMetricsObserver.java
/**
 * Creates a FrameMetricsObserver
 *
 * @param looper the looper to use when invoking callbacks
 */
FrameMetricsObserver(@NonNull Window window, @NonNull Looper looper,
        @NonNull Window.OnFrameMetricsAvailableListener listener) {
    if (looper == null) {
        throw new NullPointerException("looper cannot be null");
    }

    mMessageQueue = looper.getQueue();
    if (mMessageQueue == null) {
        throw new IllegalStateException("invalid looper, null message queue\n");
    }

    mFrameMetrics = new FrameMetrics();
    mWindow = new WeakReference<>(window);
    mListener = listener;
}
 
源代码2 项目: android_9.0.0_r45   文件: InputEventSender.java
/**
 * Creates an input event sender bound to the specified input channel.
 *
 * @param inputChannel The input channel.
 * @param looper The looper to use when invoking callbacks.
 */
public InputEventSender(InputChannel inputChannel, Looper looper) {
    if (inputChannel == null) {
        throw new IllegalArgumentException("inputChannel must not be null");
    }
    if (looper == null) {
        throw new IllegalArgumentException("looper must not be null");
    }

    mInputChannel = inputChannel;
    mMessageQueue = looper.getQueue();
    mSenderPtr = nativeInit(new WeakReference<InputEventSender>(this),
            inputChannel, mMessageQueue);

    mCloseGuard.open("dispose");
}
 
源代码3 项目: android_9.0.0_r45   文件: InputEventReceiver.java
/**
 * Creates an input event receiver bound to the specified input channel.
 *
 * @param inputChannel The input channel.
 * @param looper The looper to use when invoking callbacks.
 */
public InputEventReceiver(InputChannel inputChannel, Looper looper) {
    if (inputChannel == null) {
        throw new IllegalArgumentException("inputChannel must not be null");
    }
    if (looper == null) {
        throw new IllegalArgumentException("looper must not be null");
    }

    mInputChannel = inputChannel;
    mMessageQueue = looper.getQueue();
    mReceiverPtr = nativeInit(new WeakReference<InputEventReceiver>(this),
            inputChannel, mMessageQueue);

    mCloseGuard.open("dispose");
}
 
源代码4 项目: android_9.0.0_r45   文件: DisplayEventReceiver.java
/**
 * Creates a display event receiver.
 *
 * @param looper The looper to use when invoking callbacks.
 * @param vsyncSource The source of the vsync tick. Must be on of the VSYNC_SOURCE_* values.
 */
public DisplayEventReceiver(Looper looper, int vsyncSource) {
    if (looper == null) {
        throw new IllegalArgumentException("looper must not be null");
    }

    mMessageQueue = looper.getQueue();
    mReceiverPtr = nativeInit(new WeakReference<DisplayEventReceiver>(this), mMessageQueue,
            vsyncSource);

    mCloseGuard.open("dispose");
}
 
源代码5 项目: deagle   文件: Loopers.java
@SuppressLint("NewApi")	// Looper.getQueue is hidden before Android M.
private static MessageQueue getQueue(final Looper looper) {
	return looper.getQueue();
}