mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Android: Remove old minimum SDK version checks
This commit is contained in:
parent
3c1393ecb6
commit
39772b7474
3 changed files with 13 additions and 60 deletions
|
|
@ -1272,11 +1272,7 @@ private:
|
|||
|
||||
String getAppPlatform() const
|
||||
{
|
||||
auto ndkVersion = static_cast<int> (androidMinimumSDK.get());
|
||||
if (ndkVersion == 9)
|
||||
ndkVersion = 10; // (doesn't seem to be a version '9')
|
||||
|
||||
return "android-" + String (ndkVersion);
|
||||
return "android-" + androidMinimumSDK.get().toString();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -1713,15 +1709,8 @@ private:
|
|||
app->setAttribute ("android:icon", "@drawable/icon");
|
||||
}
|
||||
|
||||
if (static_cast<int> (androidMinimumSDK.get()) >= 11)
|
||||
{
|
||||
if (! app->hasAttribute ("android:hardwareAccelerated"))
|
||||
app->setAttribute ("android:hardwareAccelerated", "false"); // (using the 2D acceleration slows down openGL)
|
||||
}
|
||||
else
|
||||
{
|
||||
app->removeAttribute ("android:hardwareAccelerated");
|
||||
}
|
||||
if (! app->hasAttribute ("android:hardwareAccelerated"))
|
||||
app->setAttribute ("android:hardwareAccelerated", "false"); // (using the 2D acceleration slows down openGL)
|
||||
|
||||
return app;
|
||||
}
|
||||
|
|
@ -1734,34 +1723,12 @@ private:
|
|||
setAttributeIfNotPresent (*act, "android:label", "@string/app_name");
|
||||
|
||||
if (! act->hasAttribute ("android:configChanges"))
|
||||
{
|
||||
String configChanges ("keyboardHidden|orientation");
|
||||
if (static_cast<int> (androidMinimumSDK.get()) >= 13)
|
||||
configChanges += "|screenSize";
|
||||
|
||||
act->setAttribute ("android:configChanges", configChanges);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto configChanges = act->getStringAttribute ("android:configChanges");
|
||||
|
||||
if (static_cast<int> (androidMinimumSDK.get()) < 13 && configChanges.contains ("screenSize"))
|
||||
{
|
||||
configChanges = configChanges.replace ("|screenSize", "")
|
||||
.replace ("screenSize|", "")
|
||||
.replace ("screenSize", "");
|
||||
|
||||
act->setAttribute ("android:configChanges", configChanges);
|
||||
}
|
||||
}
|
||||
act->setAttribute ("android:configChanges", "keyboardHidden|orientation|screenSize");
|
||||
|
||||
if (androidScreenOrientation.get() == "landscape")
|
||||
{
|
||||
String landscapeString = static_cast<int> (androidMinimumSDK.get()) < 9
|
||||
? "landscape"
|
||||
: (static_cast<int> (androidMinimumSDK.get()) < 18 ? "sensorLandscape" : "userLandscape");
|
||||
|
||||
setAttributeIfNotPresent (*act, "android:screenOrientation", landscapeString);
|
||||
setAttributeIfNotPresent (*act, "android:screenOrientation",
|
||||
static_cast<int> (androidMinimumSDK.get()) < 18 ? "sensorLandscape" : "userLandscape");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1773,15 +1740,8 @@ private:
|
|||
// Using the 2D acceleration slows down OpenGL. We *do* enable it here for the activity though, and we disable it
|
||||
// in each ComponentPeerView instead. This way any embedded native views, which are not children of ComponentPeerView,
|
||||
// can still use hardware acceleration if needed (e.g. web view).
|
||||
if (static_cast<int> (androidMinimumSDK.get()) >= 11)
|
||||
{
|
||||
if (! act->hasAttribute ("android:hardwareAccelerated"))
|
||||
act->setAttribute ("android:hardwareAccelerated", "true"); // (using the 2D acceleration slows down openGL)
|
||||
}
|
||||
else
|
||||
{
|
||||
act->removeAttribute ("android:hardwareAccelerated");
|
||||
}
|
||||
if (! act->hasAttribute ("android:hardwareAccelerated"))
|
||||
act->setAttribute ("android:hardwareAccelerated", "true"); // (using the 2D acceleration slows down openGL)
|
||||
|
||||
return act;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,21 +124,17 @@
|
|||
#endif
|
||||
|
||||
/** Config: JUCE_USE_ANDROID_OBOE
|
||||
Enables Oboe devices (Android only, API 16 or above).
|
||||
Enables Oboe devices (Android only).
|
||||
*/
|
||||
#ifndef JUCE_USE_ANDROID_OBOE
|
||||
#define JUCE_USE_ANDROID_OBOE 1
|
||||
#endif
|
||||
|
||||
#if JUCE_USE_ANDROID_OBOE && JUCE_ANDROID_API_VERSION < 16
|
||||
#undef JUCE_USE_ANDROID_OBOE
|
||||
#define JUCE_USE_ANDROID_OBOE 0
|
||||
#endif
|
||||
|
||||
/** Config: JUCE_USE_OBOE_STABILIZED_CALLBACK
|
||||
If JUCE_USE_ANDROID_OBOE is enabled, enabling this will wrap output audio
|
||||
streams in the oboe::StabilizedCallback class. This class attempts to keep
|
||||
the CPU spinning to avoid it being scaled down on certain devices.
|
||||
(Android only).
|
||||
*/
|
||||
#ifndef JUCE_USE_ANDROID_OBOE_STABILIZED_CALLBACK
|
||||
#define JUCE_USE_ANDROID_OBOE_STABILIZED_CALLBACK 0
|
||||
|
|
@ -148,7 +144,7 @@
|
|||
Enables OpenSLES devices (Android only).
|
||||
*/
|
||||
#ifndef JUCE_USE_ANDROID_OPENSLES
|
||||
#if ! JUCE_USE_ANDROID_OBOE && JUCE_ANDROID_API_VERSION >= 9
|
||||
#if ! JUCE_USE_ANDROID_OBOE
|
||||
#define JUCE_USE_ANDROID_OPENSLES 1
|
||||
#else
|
||||
#define JUCE_USE_ANDROID_OPENSLES 0
|
||||
|
|
|
|||
|
|
@ -865,11 +865,8 @@ static void* threadEntryProc (void* userData)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
#if JUCE_ANDROID && JUCE_MODULE_AVAILABLE_juce_audio_devices && \
|
||||
((JUCE_USE_ANDROID_OPENSLES || (! defined(JUCE_USE_ANDROID_OPENSLES) && JUCE_ANDROID_API_VERSION > 8)) \
|
||||
|| (JUCE_USE_ANDROID_OBOE || (! defined(JUCE_USE_ANDROID_OBOE) && JUCE_ANDROID_API_VERSION > 15)))
|
||||
|
||||
#define JUCE_ANDROID_REALTIME_THREAD_AVAILABLE 1
|
||||
#if JUCE_ANDROID && JUCE_MODULE_AVAILABLE_juce_audio_devices && (JUCE_USE_ANDROID_OPENSLES || JUCE_USE_ANDROID_OBOE)
|
||||
#define JUCE_ANDROID_REALTIME_THREAD_AVAILABLE 1
|
||||
#endif
|
||||
|
||||
#if JUCE_ANDROID_REALTIME_THREAD_AVAILABLE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue