[Android] Pause medialibrary during its dumping

Geoffrey Métais git at videolan.org
Thu Mar 1 16:28:57 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar  1 16:01:55 2018 +0100| [ddb9c25125055e5be107f7377d4cfd7730d64280] | committer: Geoffrey Métais

Pause medialibrary during its dumping

> https://code.videolan.org/videolan/vlc-android/commit/ddb9c25125055e5be107f7377d4cfd7730d64280
---

 .../src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java       | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java
index 647f31c3a..4b5308b54 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java
@@ -128,6 +128,7 @@ public class PreferencesAdvanced extends BasePreferenceFragment implements Share
                             @Override
                             public void run() {
                                 final File db = new File(VLCApplication.getAppContext().getDir("db", Context.MODE_PRIVATE)+ Medialibrary.VLC_MEDIA_DB_NAME);
+                                Medialibrary.getInstance().pauseBackgroundOperations();
                                 if (FileUtils.copyFile(db, new File(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY+ Medialibrary.VLC_MEDIA_DB_NAME)))
                                     VLCApplication.runOnMainThread(new Runnable() {
                                         @Override
@@ -141,6 +142,7 @@ public class PreferencesAdvanced extends BasePreferenceFragment implements Share
                                         Toast.makeText(VLCApplication.getAppContext(), "Failed to dumped database", Toast.LENGTH_LONG).show();
                                     }
                                 });
+                                Medialibrary.getInstance().resumeBackgroundOperations();
                             }
                         };
                         if (Permissions.canWriteStorage()) dump.run();



More information about the Android mailing list