From 478cedcadf4b45c325d9ed54481a13f13023c0b5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 May 2019 20:15:33 +0200 Subject: [PATCH 1/4] increment version number to 0.21.9 --- NEWS | 2 ++ android/AndroidManifest.xml | 4 ++-- doc/conf.py | 2 +- meson.build | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index a028448ab..c8c510924 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.21.9 (not yet released) + ver 0.21.8 (2019/04/23) * input - smbclient: download to buffer instead of throttling transfer diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index ba343453d..57f14ac53 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="31" + android:versionName="0.21.9"> diff --git a/doc/conf.py b/doc/conf.py index bf7b60eb0..d7ec62db9 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -38,7 +38,7 @@ author = 'Max Kellermann' # built documents. # # The short X.Y version. -version = '0.21.8' +version = '0.21.9' # The full version, including alpha/beta/rc tags. release = version diff --git a/meson.build b/meson.build index 40fe2e182..3a90aa8fb 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'mpd', ['c', 'cpp'], - version: '0.21.8', + version: '0.21.9', meson_version: '>= 0.49.0', default_options: [ 'c_std=c99', From 36dec47bf70421733ac50c53f75a342752b777ff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 May 2019 20:15:30 +0200 Subject: [PATCH 2/4] android/build.py: link ARMv7 binary with libunwind Fixes nullptr dereference when an exception gets thrown because there is no ".eh_frame" section for unwinding. Closes https://github.com/MusicPlayerDaemon/MPD/issues/543 --- NEWS | 2 ++ android/build.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index c8c510924..e3e2a882b 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.9 (not yet released) +* Android + - fix crash on ARMv7 ver 0.21.8 (2019/04/23) * input diff --git a/android/build.py b/android/build.py index 842784d49..23ec9f256 100755 --- a/android/build.py +++ b/android/build.py @@ -138,6 +138,12 @@ class AndroidNdkToolchain: libstdcxx_ldflags = libstdcxx_flags + ' -L' + libcxx_libs_path libstdcxx_libs = '-lc++_static -lc++abi' + if self.is_armv7: + # On 32 bit ARM, clang generates no ".eh_frame" section; + # instead, the LLVM unwinder library is used for unwinding + # the stack after a C++ exception was thrown + libstdcxx_libs += ' -lunwind' + if use_cxx: self.cxxflags += ' ' + libstdcxx_cxxflags self.ldflags += ' ' + libstdcxx_ldflags From 65df6ca14e1e92d5ae34c3abc5158e4ece0ca2c7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 4 May 2019 07:29:41 +0200 Subject: [PATCH 3/4] android/Settings: request READ_EXTERNAL_STORAGE permission Using this API function requires SDK level 23. --- NEWS | 1 + android/meson.build | 2 +- android/src/Settings.java | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e3e2a882b..c0512ac8a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.21.9 (not yet released) * Android - fix crash on ARMv7 + - request storage permission on Android 6+ ver 0.21.8 (2019/04/23) * input diff --git a/android/meson.build b/android/meson.build index ddd3f030c..ee1f7cd31 100644 --- a/android/meson.build +++ b/android/meson.build @@ -6,7 +6,7 @@ android_sdk = get_option('android_sdk') android_abi = get_option('android_abi') android_sdk_build_tools_version = '27.0.0' -android_sdk_platform = 'android-21' +android_sdk_platform = 'android-23' android_build_tools_dir = join_paths(android_sdk, 'build-tools', android_sdk_build_tools_version) android_sdk_platform_dir = join_paths(android_sdk, 'platforms', android_sdk_platform) diff --git a/android/src/Settings.java b/android/src/Settings.java index 69b5305e2..2713fdc8c 100644 --- a/android/src/Settings.java +++ b/android/src/Settings.java @@ -21,10 +21,12 @@ package org.musicpd; import java.util.LinkedList; +import android.Manifest; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; +import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import android.os.Message; @@ -178,6 +180,14 @@ public class Settings extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { + /* TODO: this sure is the wrong place to request + permissions - it will cause MPD to quit + immediately; we should request permissions when we + need them, but implementing that is complicated, so + for now, we do it here to give users a quick + solution for the problem */ + requestAllPermissions(); + setContentView(R.layout.settings); mRunButton = (ToggleButton) findViewById(R.id.run); mRunButton.setOnCheckedChangeListener(mOnRunChangeListener); @@ -203,6 +213,31 @@ public class Settings extends Activity { super.onCreate(savedInstanceState); } + private void checkRequestPermission(String permission) { + if (checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED) + return; + + try { + this.requestPermissions(new String[]{permission}, 0); + } catch (Exception e) { + Log.e(TAG, "requestPermissions(" + permission + ") failed", + e); + } + } + + private void requestAllPermissions() { + if (android.os.Build.VERSION.SDK_INT < 23) + /* we don't need to request permissions on + this old Android version */ + return; + + /* starting with Android 6.0, we need to explicitly + request all permissions before using them; + mentioning them in the manifest is not enough */ + + checkRequestPermission(Manifest.permission.READ_EXTERNAL_STORAGE); + } + private void connectClient() { mClient = new Main.Client(this, new Main.Client.Callback() { From f8468451c915bf9933543961c4a4785d330b0b93 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 4 May 2019 13:25:05 +0200 Subject: [PATCH 4/4] android/AndroidManifest.xml: increment versionCode after hotfix upload --- android/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 57f14ac53..3bbb517e3 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,7 +2,7 @@