Moved common async input handling to core library.

This commit is contained in:
Armin Novak
2016-09-13 09:53:16 +02:00
parent b8b84473a3
commit f2d7766db6
7 changed files with 173 additions and 222 deletions

View File

@@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.android.tools.build:gradle:2.1.3'
}
}

View File

@@ -1,6 +1,6 @@
#Wed Jul 06 13:01:23 CEST 2016
#Mon Sep 12 15:54:49 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

View File

@@ -555,13 +555,6 @@ static int android_freerdp_run(freerdp* instance)
if (async_input)
{
if (!(inputEvent = freerdp_get_message_queue_event_handle(instance,
FREERDP_INPUT_MESSAGE_QUEUE)))
{
WLog_ERR(TAG, "async input: failed to get input event handle");
goto disconnect;
}
if (!(inputThread = CreateThread(NULL, 0,
(LPTHREAD_START_ROUTINE) jni_input_thread, instance, 0, NULL)))
{
@@ -576,10 +569,11 @@ static int android_freerdp_run(freerdp* instance)
{
DWORD tmp;
count = 0;
handles[count++] = inputEvent;
if (inputThread)
handles[count++] = inputThread;
else
handles[count++] = inputEvent;
tmp = freerdp_get_event_handles(context, &handles[count], 64 - count);
@@ -622,18 +616,6 @@ static int android_freerdp_run(freerdp* instance)
break;
}
}
else if (inputEvent)
{
if (WaitForSingleObject(inputEvent, 0) == WAIT_OBJECT_0)
{
if (!freerdp_message_queue_process_pending_messages(instance,
FREERDP_INPUT_MESSAGE_QUEUE))
{
WLog_INFO(TAG, "User Disconnect");
break;
}
}
}
}
disconnect:
@@ -641,15 +623,7 @@ disconnect:
if (async_input && inputThread)
{
wMessageQueue* input_queue = freerdp_get_message_queue(instance,
FREERDP_INPUT_MESSAGE_QUEUE);
if (input_queue)
{
if (MessageQueue_PostQuit(input_queue, 0))
WaitForSingleObject(inputThread, INFINITE);
}
WaitForSingleObject(inputThread, INFINITE);
CloseHandle(inputThread);
}