[DEV] remove call of java when system is not autorised of turn screen
This commit is contained in:
parent
53a678cdd1
commit
0004c7710f
2
build
2
build
@ -1 +1 @@
|
||||
Subproject commit 3f4ee97584169819c4fbe95dea80ba83508fce15
|
||||
Subproject commit cb8010af47373f5d5b2c319153b2585b074b5b68
|
@ -6,6 +6,7 @@
|
||||
* @license BSD v3 (see license file)
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <etk/MessageFifo.h>
|
||||
@ -28,9 +29,15 @@
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
|
||||
|
||||
static ewol::Windows* windowsCurrent = NULL;
|
||||
static ivec2 windowsSize(320, 480);
|
||||
static ewol::eSystemInput l_managementInput;
|
||||
static bool requestEndProcessing = false;
|
||||
static bool isGlobalSystemInit = false;
|
||||
static ewol::Windows* windowsCurrent = NULL;
|
||||
static int64_t previousDisplayTime = 0; // this is to limit framerate ... in case...
|
||||
static ivec2 windowsSize(320, 480);
|
||||
static ewol::eSystemInput l_managementInput;
|
||||
static ewol::Fps l_FpsSystemEvent( "Event ", false);
|
||||
static ewol::Fps l_FpsSystemContext( "Context ", false);
|
||||
static ewol::Fps l_FpsSystem( "Draw ", true);
|
||||
|
||||
|
||||
|
||||
@ -68,7 +75,6 @@ typedef enum {
|
||||
} theadMessage_te;
|
||||
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
class eSystemMessage {
|
||||
public :
|
||||
@ -101,10 +107,8 @@ class eSystemMessage {
|
||||
}
|
||||
};
|
||||
|
||||
// deblare the message system
|
||||
static etk::MessageFifo<eSystemMessage> l_msgSystem;
|
||||
|
||||
static bool requestEndProcessing = false;
|
||||
|
||||
void ewolProcessEvents(void)
|
||||
{
|
||||
@ -235,7 +239,6 @@ void eSystem::SetArchiveDir(int mode, const char* str)
|
||||
|
||||
|
||||
|
||||
bool isGlobalSystemInit = false;
|
||||
|
||||
void RequestInit(void)
|
||||
{
|
||||
@ -451,15 +454,6 @@ void eSystem::ClipBoardArrive(ewol::clipBoard::clipboardListe_te clipboardID)
|
||||
}
|
||||
|
||||
|
||||
static ewol::Fps l_FpsSystemEvent( "Event ", false);
|
||||
static ewol::Fps l_FpsSystemContext( "Context ", false);
|
||||
static ewol::Fps l_FpsSystem( "Draw ", true);
|
||||
|
||||
// this is to limit framerate ... in case...
|
||||
static int64_t previousDisplayTime = 0;
|
||||
|
||||
|
||||
|
||||
bool eSystem::Draw(bool displayEveryTime)
|
||||
{
|
||||
int64_t currentTime = ewol::GetTime();
|
||||
|
@ -96,56 +96,61 @@ void SendJava_KeyboardShow(bool showIt)
|
||||
// mode 0 : auto; 1 landscape, 2 portrait
|
||||
void SendJava_OrientationChange(int32_t mode)
|
||||
{
|
||||
EWOL_DEBUG("C->java : call java");
|
||||
if (NULL == g_JavaVM) {
|
||||
EWOL_DEBUG("C->java : JVM not initialised");
|
||||
#ifndef __ANDROID_PERMISSION__SET_ORIENTATION__
|
||||
EWOL_ERROR("C->java : call set orientation without Allow application to do it ... Break...");
|
||||
return;
|
||||
}
|
||||
JNIEnv *JavaVirtualMachinePointer_tmp;
|
||||
int status = g_JavaVM->GetEnv((void **) &JavaVirtualMachinePointer_tmp, JNI_VERSION_1_6);
|
||||
if (status == JNI_EDETACHED) {
|
||||
JavaVMAttachArgs lJavaVMAttachArgs;
|
||||
lJavaVMAttachArgs.version = JNI_VERSION_1_6;
|
||||
lJavaVMAttachArgs.name = "EwolNativeThread";
|
||||
lJavaVMAttachArgs.group = NULL;
|
||||
status = g_JavaVM->AttachCurrentThread(&JavaVirtualMachinePointer_tmp, &lJavaVMAttachArgs);
|
||||
if (status != JNI_OK) {
|
||||
EWOL_DEBUG("C->java : AttachCurrentThread failed : " << status);
|
||||
#else
|
||||
EWOL_DEBUG("C->java : call java");
|
||||
if (NULL == g_JavaVM) {
|
||||
EWOL_DEBUG("C->java : JVM not initialised");
|
||||
return;
|
||||
}
|
||||
JNIEnv *JavaVirtualMachinePointer_tmp;
|
||||
int status = g_JavaVM->GetEnv((void **) &JavaVirtualMachinePointer_tmp, JNI_VERSION_1_6);
|
||||
if (status == JNI_EDETACHED) {
|
||||
JavaVMAttachArgs lJavaVMAttachArgs;
|
||||
lJavaVMAttachArgs.version = JNI_VERSION_1_6;
|
||||
lJavaVMAttachArgs.name = "EwolNativeThread";
|
||||
lJavaVMAttachArgs.group = NULL;
|
||||
status = g_JavaVM->AttachCurrentThread(&JavaVirtualMachinePointer_tmp, &lJavaVMAttachArgs);
|
||||
if (status != JNI_OK) {
|
||||
EWOL_DEBUG("C->java : AttachCurrentThread failed : " << status);
|
||||
return;
|
||||
}
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
}
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
}
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
|
||||
if (NULL == JavaVirtualMachinePointer) {
|
||||
EWOL_DEBUG("C->java : JVM not initialised");
|
||||
return;
|
||||
}
|
||||
|
||||
jint param = mode;
|
||||
|
||||
//Call java ...
|
||||
JavaVirtualMachinePointer->CallVoidMethod(javaObjectActivity, javaClassActivityEntryPoint__CPP_OrientationChange, param);
|
||||
|
||||
// manage execption :
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
if (NULL == JavaVirtualMachinePointer) {
|
||||
EWOL_DEBUG("C->java : JVM not initialised");
|
||||
return;
|
||||
}
|
||||
|
||||
if (status == JNI_EDETACHED) {
|
||||
// Finished with the JVM.
|
||||
g_JavaVM->DetachCurrentThread();
|
||||
}
|
||||
jint param = mode;
|
||||
|
||||
//Call java ...
|
||||
JavaVirtualMachinePointer->CallVoidMethod(javaObjectActivity, javaClassActivityEntryPoint__CPP_OrientationChange, param);
|
||||
|
||||
// manage execption :
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
|
||||
if (status == JNI_EDETACHED) {
|
||||
// Finished with the JVM.
|
||||
g_JavaVM->DetachCurrentThread();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user