Commit e5a4789d authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

MediaLibrary: remove mRestartContext

parent d7babc50
...@@ -57,7 +57,6 @@ public class MediaLibrary { ...@@ -57,7 +57,6 @@ public class MediaLibrary {
private final ReadWriteLock mItemListLock; private final ReadWriteLock mItemListLock;
private boolean isStopping = false; private boolean isStopping = false;
private boolean mRestart = false; private boolean mRestart = false;
private Context mRestartContext;
protected Thread mLoadingThread; protected Thread mLoadingThread;
private MediaLibrary() { private MediaLibrary() {
...@@ -72,7 +71,6 @@ public class MediaLibrary { ...@@ -72,7 +71,6 @@ public class MediaLibrary {
/* do a clean restart if a scan is ongoing */ /* do a clean restart if a scan is ongoing */
mRestart = true; mRestart = true;
isStopping = true; isStopping = true;
mRestartContext = context;
} else { } else {
loadMediaItems(); loadMediaItems();
} }
...@@ -360,8 +358,6 @@ public class MediaLibrary { ...@@ -360,8 +358,6 @@ public class MediaLibrary {
Log.d(TAG, "Restarting scan"); Log.d(TAG, "Restarting scan");
mRestart = false; mRestart = false;
restartHandler.sendEmptyMessageDelayed(1, 200); restartHandler.sendEmptyMessageDelayed(1, 200);
} else {
mRestartContext = null;
} }
} }
} }
...@@ -378,10 +374,7 @@ public class MediaLibrary { ...@@ -378,10 +374,7 @@ public class MediaLibrary {
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
MediaLibrary owner = getOwner(); MediaLibrary owner = getOwner();
if(owner == null) return; if(owner == null) return;
if (owner.mRestartContext != null) owner.loadMediaItems();
owner.loadMediaItems();
else
Log.e(TAG, "Context lost in a black hole");
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment