diff --git a/sources/Config.in b/sources/Config.in deleted file mode 100644 index 6063a710..00000000 --- a/sources/Config.in +++ /dev/null @@ -1,17 +0,0 @@ -menu "General" - config __EWOL_APPL_BASIC_TITLE__ - prompt "Application Title" - string - default "Ewol Basic Title" - help - This is the application Title - - config __EWOL_INTEGRATED_FONT__ - prompt "Integrate Font in the appl data" - bool - default y - help - By default the application seach the font in the system folder. - If enable the system seach the font in the "DATA:fonts" folder. - -endmenu diff --git a/sources/ConfigAndroid.in b/sources/ConfigAndroid.in deleted file mode 100644 index b50ce4ee..00000000 --- a/sources/ConfigAndroid.in +++ /dev/null @@ -1,125 +0,0 @@ -menu "Android" - - config __EWOL_ANDROID_MINIMUM_SDK_VERSION__ - prompt "Minimum android Version" - int - default 9 - help - This is the minimum version of Android that is Requested - - - config __EWOL_ANDROID_SHOW_TITLE__ - prompt "Application display title" - bool - default y - help - This Permit on android to hide title - - - choice - prompt "Display orientation mode" - default __EWOL_ANDROID_ORIENTATION_AUTO__ - help - Force the display possibilities of this video settings - config __EWOL_ANDROID_ORIENTATION_AUTO__ - bool "0: Automatic orientation (change automaticly)" - config __EWOL_ANDROID_ORIENTATION_LANDSCAPE__ - bool "1: Lock in landscape mode" - config __EWOL_ANDROID_ORIENTATION_PORTRAIT__ - bool "2: Lock in portrait mode" - endchoice - - menu "Permissions" - config __ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__ - prompt "WRITE_EXTERNAL_STORAGE" - bool - default n - help - Allows an application to write to external storage. - - config __ANDROID_PERMISSION__CAMERA__ - prompt "CAMERA" - bool - default n - help - Required to be able to access the camera device. - - config __ANDROID_PERMISSION__INTERNET__ - prompt "INTERNET" - bool - default n - help - Allows applications to open network sockets. - - config __ANDROID_PERMISSION__MODIFY_AUDIO_SETTINGS__ - prompt "MODIFY_AUDIO_SETTINGS" - bool - default n - help - Allows an application to modify global audio settings. - - config __ANDROID_PERMISSION__READ_CALENDAR__ - prompt "READ_CALENDAR" - bool - default n - help - Allows an application to read the user''s calendar data. - - config __ANDROID_PERMISSION__READ_CONTACTS__ - prompt "READ_CONTACTS" - bool - default n - help - Allows an application to read the user''s contacts data. - - config __ANDROID_PERMISSION__READ_FRAME_BUFFER__ - prompt "READ_FRAME_BUFFER" - bool - default n - help - Allows an application to take screen shots and more generally get access to the frame buffer data - - config __ANDROID_PERMISSION__READ_PROFILE__ - prompt "READ_PROFILE" - bool - default n - help - Allows an application to read the user''s personal profile data. - - config __ANDROID_PERMISSION__RECORD_AUDIO__ - prompt "RECORD_AUDIO" - bool - default n - help - Allows an application to record audio - - config __ANDROID_PERMISSION__SET_ORIENTATION__ - prompt "SET_ORIENTATION" - bool - default n - help - Allows low-level access to setting the orientation (actually rotation) of the screen. - - config __ANDROID_PERMISSION__VIBRATE__ - prompt "VIBRATE" - bool - default n - help - Allows access to the vibrator - - config __ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ - prompt "ACCESS_COARSE_LOCATION" - bool - default n - help - Allows an application to access coarse (e.g., Cell-ID, WiFi) location. - - config __ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ - prompt "ACCESS_FINE_LOCATION" - bool - default n - help - Allows an application to access fine (e.g., GPS) location. - - endmenu -endmenu diff --git a/sources/ConfigLinux.in b/sources/ConfigLinux.in deleted file mode 100644 index 9c4250fe..00000000 --- a/sources/ConfigLinux.in +++ /dev/null @@ -1,13 +0,0 @@ -menu "Linux" - choice - prompt "Display orientation mode" - default __EWOL_LINUX_GUI_MODE_X11__ - help - display Gui interface - config __EWOL_LINUX_GUI_MODE_X11__ - bool "0: X11 mode" - config __EWOL_LINUX_GUI_MODE_DIRECT_FB__ - bool "1: Direct FB mode" - endchoice - -endmenu diff --git a/sources/android/src/org/ewol/EwolActivity.java b/sources/android/src/org/ewol/EwolActivity.java index 62d34f53..e13695ae 100644 --- a/sources/android/src/org/ewol/EwolActivity.java +++ b/sources/android/src/org/ewol/EwolActivity.java @@ -11,6 +11,7 @@ package org.ewol; import android.app.Activity; import android.content.Context; +import android.Manifest; import android.opengl.GLSurfaceView; import android.os.Bundle; import android.view.MotionEvent; @@ -22,6 +23,7 @@ import android.view.Window; import android.view.WindowManager; // for the keyboard event : import android.view.inputmethod.InputMethodManager; +import android.Manifest; import java.io.File; import android.content.Context; @@ -52,6 +54,7 @@ import org.ewol.Ewol; * */ public abstract class EwolActivity extends Activity implements EwolCallback, EwolConstants { + private static Context mContext; private EwolSurfaceViewGL mGLView; private EwolAudioTask mStreams; private Thread mAudioThread; @@ -65,6 +68,10 @@ public abstract class EwolActivity extends Activity implements EwolCallback, Ewo } } + public static Context getAppContext() { + return EwolActivity.mContext; + } + public EwolActivity() { // set the java evironement in the C sources : EWOL = new Ewol(this, EWOL_APPL_TYPE_ACTIVITY); @@ -93,6 +100,8 @@ public abstract class EwolActivity extends Activity implements EwolCallback, Ewo super.onCreate(savedInstanceState); //setListnerToRootView(); + EwolActivity.mContext = getApplicationContext(); + // Load the application directory EWOL.paramSetArchiveDir(1, getFilesDir().toString()); EWOL.paramSetArchiveDir(2, getCacheDir().toString()); @@ -238,15 +247,23 @@ public abstract class EwolActivity extends Activity implements EwolCallback, Ewo } public void orientationUpdate(int screenMode) { - if (screenMode == EWOL_ORIENTATION_LANDSCAPE) { - //Force landscape - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } else if (screenMode == EWOL_ORIENTATION_PORTRAIT) { - //Force portrait - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + Context localContext = getAppContext(); + int result = localContext.checkCallingOrSelfPermission(Manifest.permission.SET_ORIENTATION); + if (result != PackageManager.PERMISSION_GRANTED) { + if (screenMode == EWOL_ORIENTATION_LANDSCAPE) { + //Force landscape + //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); + } else if (screenMode == EWOL_ORIENTATION_PORTRAIT) { + //Force portrait + //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); + } else { + //Force auto Rotation + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); + } } else { - //Force auto Rotation - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); + Log.e("EwolActivity", "Not the right 'SET_ORIENTATION' to access on the screen orientation..."); } } diff --git a/sources/ewol/context/Android/Context.cpp b/sources/ewol/context/Android/Context.cpp index 6b63205e..3cf021d5 100644 --- a/sources/ewol/context/Android/Context.cpp +++ b/sources/ewol/context/Android/Context.cpp @@ -333,10 +333,6 @@ class AndroidContext : public ewol::Context { // mode 0 : auto; 1 landscape, 2 portrait void forceOrientation(enum ewol::orientation _orientation) { - #ifndef __ANDROID_PERMISSION__SET_ORIENTATION__ - EWOL_ERROR("C->java : call set orientation without Allow application to do it ... Break..."); - return; - #else int status; if(!java_attach_current_thread(&status)) { return; @@ -349,7 +345,6 @@ class AndroidContext : public ewol::Context { // manage execption : java_check_exception(m_JavaVirtualMachinePointer); java_detach_current_thread(status); - #endif } void setTitle(std::string& _title) {