diff --git a/deps/dr/dr_flac.h b/deps/dr/dr_flac.h index 2ac68fb8b1..96ce30c1a1 100644 --- a/deps/dr/dr_flac.h +++ b/deps/dr/dr_flac.h @@ -667,7 +667,7 @@ const char* drflac_next_vorbis_comment(drflac_vorbis_comment_iterator* pIter, dr #define DRFLAC_NO_CPUID #endif #else - #if (defined(__GNUC__) || defined(__clang__)) && !defined(__ANDROID__) + #if defined(__GNUC__) || defined(__clang__) static void drflac__cpuid(int info[4], int fid) { __asm__ __volatile__ ( diff --git a/pkg/android/phoenix/src/com/retroarch/browser/mainmenu/MainMenuActivity.java b/pkg/android/phoenix/src/com/retroarch/browser/mainmenu/MainMenuActivity.java index 689ad5f9c9..537fee43cc 100644 --- a/pkg/android/phoenix/src/com/retroarch/browser/mainmenu/MainMenuActivity.java +++ b/pkg/android/phoenix/src/com/retroarch/browser/mainmenu/MainMenuActivity.java @@ -42,16 +42,13 @@ public final class MainMenuActivity extends PreferenceActivity private boolean addPermission(List permissionsList, String permission) { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) + if (checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) { - if (checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) - { - permissionsList.add(permission); + permissionsList.add(permission); - // Check for Rationale Option - if (!shouldShowRequestPermissionRationale(permission)) - return false; - } + // Check for Rationale Option + if (!shouldShowRequestPermissionRationale(permission)) + return false; } return true; @@ -59,7 +56,7 @@ public final class MainMenuActivity extends PreferenceActivity public void checkRuntimePermissions() { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) + if (android.os.Build.VERSION.SDK_INT >= 23) { // Android 6.0+ needs runtime permission checks List permissionsNeeded = new ArrayList(); @@ -92,13 +89,10 @@ public final class MainMenuActivity extends PreferenceActivity { if (which == AlertDialog.BUTTON_POSITIVE) { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) - { - requestPermissions(permissionsList.toArray(new String[permissionsList.size()]), - REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS); + requestPermissions(permissionsList.toArray(new String[permissionsList.size()]), + REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS); - Log.i("MainMenuActivity", "User accepted request for external storage permissions."); - } + Log.i("MainMenuActivity", "User accepted request for external storage permissions."); } } }); diff --git a/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityCommon.java b/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityCommon.java index f948558b61..109126a171 100644 --- a/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityCommon.java +++ b/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityCommon.java @@ -49,17 +49,14 @@ public class RetroActivityCommon extends RetroActivityLocation long[] pattern = {16}; int[] strengths = {strength}; - if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) + if (id == -1) + vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE); + else { - if (id == -1) - vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE); - else - { - InputDevice dev = InputDevice.getDevice(id); + InputDevice dev = InputDevice.getDevice(id); - if (dev != null) - vibrator = dev.getVibrator(); - } + if (dev != null) + vibrator = dev.getVibrator(); } if (vibrator == null) @@ -75,7 +72,7 @@ public class RetroActivityCommon extends RetroActivityLocation else pattern[0] = 1000; - if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT >= 26) { if (id >= 0) Log.i("RetroActivity", "Vibrate id " + id + ": strength " + strength); diff --git a/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java b/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java index 1c6a3062ef..92c142aebc 100644 --- a/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java +++ b/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java @@ -40,16 +40,13 @@ public final class RetroActivityFuture extends RetroActivityCamera { // Check for Android UI specific parameters Intent retro = getIntent(); + String refresh = retro.getStringExtra("REFRESH"); - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { - String refresh = retro.getStringExtra("REFRESH"); - - // If REFRESH parameter is provided then try to set refreshrate accordingly - if(refresh != null) { - WindowManager.LayoutParams params = getWindow().getAttributes(); - params.preferredRefreshRate = Integer.parseInt(refresh); - getWindow().setAttributes(params); - } + // If REFRESH parameter is provided then try to set refreshrate accordingly + if(refresh != null) { + WindowManager.LayoutParams params = getWindow().getAttributes(); + params.preferredRefreshRate = Integer.parseInt(refresh); + getWindow().setAttributes(params); } // If QUITFOCUS parameter is provided then enable that Retroarch quits when focus is lost @@ -64,21 +61,20 @@ public final class RetroActivityFuture extends RetroActivityCamera { public void hideMouseCursor() { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) { - // Check for NVIDIA extensions and minimum SDK version - Method mInputManager_setCursorVisibility; - try { mInputManager_setCursorVisibility = - InputManager.class.getMethod("setCursorVisibility", boolean.class); - } - catch (NoSuchMethodException ex) { - return; // Extensions were not available so do nothing - } + // Check for NVIDIA extensions and minimum SDK version + Method mInputManager_setCursorVisibility; + try { mInputManager_setCursorVisibility = + InputManager.class.getMethod("setCursorVisibility", boolean.class); + } + catch (NoSuchMethodException ex) { + return; // Extensions were not available so do nothing + } - // Hide the mouse cursor - InputManager inputManager = (InputManager) getSystemService(Context.INPUT_SERVICE); - try { mInputManager_setCursorVisibility.invoke(inputManager, false); } - catch (InvocationTargetException ite) { } - catch (IllegalAccessException iae) { } + // Hide the mouse cursor + InputManager inputManager = (InputManager) getSystemService(Context.INPUT_SERVICE); + try { mInputManager_setCursorVisibility.invoke(inputManager, false); } + catch (InvocationTargetException ite) { } + catch (IllegalAccessException iae) { } } @Override