get rid of unused recursive flag
This commit is contained in:
parent
3d49310a9d
commit
69b8636c60
@ -71,7 +71,7 @@ public class MediaScanner implements Handler.Callback {
|
|||||||
* @param dir the directory to scan
|
* @param dir the directory to scan
|
||||||
*/
|
*/
|
||||||
public void startScan(File dir) {
|
public void startScan(File dir) {
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_SCAN_DIRECTORY, 1, 0, dir));
|
mHandler.sendMessage(mHandler.obtainMessage(MSG_SCAN_DIRECTORY, 0, 0, dir));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int MSG_SCAN_DIRECTORY = 1;
|
private static final int MSG_SCAN_DIRECTORY = 1;
|
||||||
@ -82,8 +82,7 @@ public class MediaScanner implements Handler.Callback {
|
|||||||
File file = (File)message.obj;
|
File file = (File)message.obj;
|
||||||
switch (message.what) {
|
switch (message.what) {
|
||||||
case MSG_SCAN_DIRECTORY: {
|
case MSG_SCAN_DIRECTORY: {
|
||||||
boolean recursive = (message.arg1 == 0 ? false : true);
|
scanDirectory(file);
|
||||||
scanDirectory(file, recursive);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MSG_ADD_FILE: {
|
case MSG_ADD_FILE: {
|
||||||
@ -114,9 +113,8 @@ public class MediaScanner implements Handler.Callback {
|
|||||||
* Scans a directory for indexable files
|
* Scans a directory for indexable files
|
||||||
*
|
*
|
||||||
* @param dir the directory to scan
|
* @param dir the directory to scan
|
||||||
* @param recursive scan subdirs if true
|
|
||||||
*/
|
*/
|
||||||
private void scanDirectory(File dir, boolean recursive) {
|
private void scanDirectory(File dir) {
|
||||||
if (dir.isDirectory() == false)
|
if (dir.isDirectory() == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -130,8 +128,8 @@ public class MediaScanner implements Handler.Callback {
|
|||||||
for (File file : dirents) {
|
for (File file : dirents) {
|
||||||
if (file.isFile()) {
|
if (file.isFile()) {
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_ADD_FILE, 0, 0, file));
|
mHandler.sendMessage(mHandler.obtainMessage(MSG_ADD_FILE, 0, 0, file));
|
||||||
} else if (file.isDirectory() && recursive) {
|
} else if (file.isDirectory()) {
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_SCAN_DIRECTORY, 1, 0, file));
|
mHandler.sendMessage(mHandler.obtainMessage(MSG_SCAN_DIRECTORY, 0, 0, file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user