Fixed android shutdown crash.

Added new permissions required for microphone redirection.
Fixed JNI call for microphone redirection.
This commit is contained in:
Armin Novak 2013-09-27 11:41:25 +02:00
parent c2d3f60ad0
commit d81421a76a
4 changed files with 18 additions and 7 deletions

View File

@ -3,7 +3,5 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -11,6 +11,8 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<application>

View File

@ -12,6 +12,7 @@
#include "config.h"
#endif
#include <assert.h>
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
@ -262,6 +263,8 @@ int android_freerdp_run(freerdp* instance)
int select_status;
struct timeval timeout;
assert(instance);
memset(rfds, 0, sizeof(rfds));
memset(wfds, 0, sizeof(wfds));
@ -330,6 +333,9 @@ int android_freerdp_run(freerdp* instance)
}
}
if (freerdp_shall_disconnect(instance))
break;
if (freerdp_check_fds(instance) != TRUE)
{
DEBUG_ANDROID("Failed to check FreeRDP file descriptor\n");
@ -365,6 +371,9 @@ void* android_thread_func(void* param)
struct thread_data* data;
data = (struct thread_data*) param;
assert(data);
assert(data->instance);
freerdp* instance = data->instance;
android_freerdp_run(instance);
free(data);
@ -409,6 +418,10 @@ JNIEXPORT jboolean JNICALL jni_freerdp_connect(JNIEnv *env, jclass cls, jint ins
struct thread_data* data = (struct thread_data*) malloc(sizeof(struct thread_data));
data->instance = inst;
assert(inst);
assert(data);
assert(inst->context);
androidContext* ctx = (androidContext*)inst->context;
pthread_create(&ctx->thread, 0, android_thread_func, data);
@ -685,7 +698,7 @@ JNIEXPORT void JNICALL jni_freerdp_set_microphone_redirection(JNIEnv *env,
p = malloc(sizeof(char*));
p[0] = "audin";
freerdp_client_add_static_channel(settings, count, p);
freerdp_client_add_dynamic_channel(settings, count, p);
free(p);
}

View File

@ -3,7 +3,5 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
<classpathentry kind="output" path="bin"/>
</classpath>