From 98efb4f6d518765af5a9f9d86fffc33a94056fdb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 18:44:05 +0200 Subject: [PATCH] android: raise minSdkVersion to 21 The number of MPD installs on Android < 5.0 is negligible, and that API version introduces lots of useful features for MPD. --- Makefile.am | 2 +- android/AndroidManifest.xml | 2 +- android/build.py | 2 +- android/src/Main.java | 2 +- src/input/plugins/FileInputPlugin.cxx | 3 --- src/system/EPollFD.cxx | 15 --------------- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Makefile.am b/Makefile.am index efbe11dfd..95f888ff9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -294,7 +294,7 @@ libmpd.so: $(filter %.a,$(src_mpd_LDADD)) libmain.a $(AM_V_CXXLD)$(CXXLD) -shared -Wl,--no-undefined,-shared,-Bsymbolic -llog -lz -o $@ $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) src/libmain_a-Main.o $(src_mpd_LDADD) $(LIBS) ANDROID_SDK_BUILD_TOOLS_VERSION = 27.0.0 -ANDROID_SDK_PLATFORM = android-17 +ANDROID_SDK_PLATFORM = android-21 ANDROID_BUILD_TOOLS_DIR = $(ANDROID_SDK)/build-tools/$(ANDROID_SDK_BUILD_TOOLS_VERSION) ANDROID_SDK_PLATFORM_DIR = $(ANDROID_SDK)/platforms/$(ANDROID_SDK_PLATFORM) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 09536d9c1..b6abd1124 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionCode="20" android:versionName="0.20.21"> - + = 21 - /* posix_fadvise() requires Android API 21 */ #ifdef POSIX_FADV_SEQUENTIAL posix_fadvise(reader.GetFD().Get(), (off_t)0, info.GetSize(), POSIX_FADV_SEQUENTIAL); -#endif #endif return InputStreamPtr(new FileInputStream(path.ToUTF8().c_str(), diff --git a/src/system/EPollFD.cxx b/src/system/EPollFD.cxx index 39ddbca5e..d9200ed41 100644 --- a/src/system/EPollFD.cxx +++ b/src/system/EPollFD.cxx @@ -22,21 +22,6 @@ #include "EPollFD.hxx" #include "FatalError.hxx" -#if defined(__BIONIC__) && __ANDROID_API__ < 21 - -#include -#include - -#define EPOLL_CLOEXEC O_CLOEXEC - -static inline int -epoll_create1(int flags) -{ - return syscall(__NR_epoll_create1, flags); -} - -#endif - EPollFD::EPollFD() :fd(::epoll_create1(EPOLL_CLOEXEC)) {