[Android] Medialibrary: Match new API
Geoffrey Métais
git at videolan.org
Fri Oct 4 15:57:25 CEST 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Oct 4 15:57:08 2019 +0200| [6d98b702581f6c52a61f2a4148572604369aeef0] | committer: Geoffrey Métais
Medialibrary: Match new API
> https://code.videolan.org/videolan/vlc-android/commit/6d98b702581f6c52a61f2a4148572604369aeef0
---
medialibrary/jni/AndroidMediaLibrary.cpp | 4 ++--
medialibrary/jni/AndroidMediaLibrary.h | 2 +-
medialibrary/jni/medialibrary.cpp | 2 +-
medialibrary/src/org/videolan/medialibrary/Medialibrary.java | 4 ++++
.../org/videolan/medialibrary/interfaces/AbstractMedialibrary.java | 6 +++---
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index 9ff728af4..45d77106d 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -917,12 +917,12 @@ void AndroidMediaLibrary::onMediaThumbnailReady( medialibrary::MediaPtr media, m
}
}
-bool AndroidMediaLibrary::onUnhandledException( const char* context, const char* errMsg )
+bool AndroidMediaLibrary::onUnhandledException( const char* context, const char* errMsg, bool clearSuggested )
{
JNIEnv *env = getEnv();
jstring ctx = env->NewStringUTF(context);
jstring msg = env->NewStringUTF(errMsg);
- env->CallVoidMethod(weak_thiz, p_fields->MediaLibrary.onUnhandledExceptionId, ctx, msg);
+ env->CallVoidMethod(weak_thiz, p_fields->MediaLibrary.onUnhandledExceptionId, ctx, msg, clearSuggested);
env->DeleteLocalRef(ctx);
env->DeleteLocalRef(msg);
return true;
diff --git a/medialibrary/jni/AndroidMediaLibrary.h b/medialibrary/jni/AndroidMediaLibrary.h
index 0e96c9a07..6602d228a 100644
--- a/medialibrary/jni/AndroidMediaLibrary.h
+++ b/medialibrary/jni/AndroidMediaLibrary.h
@@ -149,7 +149,7 @@ public:
bool success );
void onHistoryChanged( medialibrary::HistoryType historyType );
- bool onUnhandledException( const char* /* context */, const char* /* errMsg */ );
+ bool onUnhandledException( const char* /* context */, const char* /* errMsg */, bool /* clearSuggested */ );
private:
void jni_detach_thread(void *data);
diff --git a/medialibrary/jni/medialibrary.cpp b/medialibrary/jni/medialibrary.cpp
index c40216ce5..091d2f09a 100644
--- a/medialibrary/jni/medialibrary.cpp
+++ b/medialibrary/jni/medialibrary.cpp
@@ -2318,7 +2318,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved)
GET_ID(GetMethodID,
ml_fields.MediaLibrary.onUnhandledExceptionId,
ml_fields.MediaLibrary.clazz,
- "onUnhandledException", "(Ljava/lang/String;Ljava/lang/String;)V");
+ "onUnhandledException", "(Ljava/lang/String;Ljava/lang/String;Z)V");
#undef GET_CLASS
#undef GET_ID
diff --git a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
index e8f438be4..06289f076 100644
--- a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+++ b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
@@ -381,6 +381,10 @@ public class Medialibrary extends AbstractMedialibrary {
return mIsInitiated && nativeClearHistory();
}
+ public void clearDatabase(boolean restorePlaylist) {
+ if (mIsInitiated) nativeClearDatabase(restorePlaylist);
+ }
+
public boolean addToHistory(String mrl, String title) {
return mIsInitiated && nativeAddToHistory(Tools.encodeVLCMrl(mrl), Tools.encodeVLCMrl(title));
}
diff --git a/medialibrary/src/org/videolan/medialibrary/interfaces/AbstractMedialibrary.java b/medialibrary/src/org/videolan/medialibrary/interfaces/AbstractMedialibrary.java
index 3bea67e21..b4d208a5f 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/AbstractMedialibrary.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/AbstractMedialibrary.java
@@ -207,7 +207,7 @@ abstract public class AbstractMedialibrary {
}
public interface MedialibraryExceptionHandler {
- void onUnhandledException(String context, String errMsg);
+ void onUnhandledException(String context, String errMsg, boolean clearSuggested);
}
public MedialibraryExceptionHandler getExceptionHandler() {
@@ -403,8 +403,8 @@ abstract public class AbstractMedialibrary {
}
}
@SuppressWarnings("unused")
- public void onUnhandledException(String context, String errMsg) {
- if (mExceptionHandler != null) mExceptionHandler.onUnhandledException(context, errMsg);
+ public void onUnhandledException(String context, String errMsg, boolean clearSuggested) {
+ if (mExceptionHandler != null) mExceptionHandler.onUnhandledException(context, errMsg, clearSuggested);
}
@SuppressWarnings("unused")
More information about the Android
mailing list