上でコメントしたように、私の解決策(SOのさまざまなページに感謝します):
// DownloadManager job from the main activity
videoUri = Uri.parse(path.toURI() + composedFilename);
dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
Request request = new Request(Uri.parse(link));
request.setDestinationUri(videoUri);
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE);
request.setTitle(vfilename);
enqueue = dm.enqueue(request);
Log.d(DEBUG_TAG, "_ID " + enqueue + " enqueued");
fileObserver = new Utils.delFileObserver(path.getAbsolutePath());
fileObserver.startWatching();
// delFileObserver class inside another Utility class
public static class delFileObserver extends FileObserver {
static final String TAG="FileObserver: ";
String rootPath;
static final int mask = (FileObserver.CREATE | FileObserver.DELETE | FileObserver.DELETE_SELF);
public delFileObserver(String root){
super(root, mask);
if (! root.endsWith(File.separator)){
root += File.separator;
}
rootPath = root;
}
public void onEvent(int event, String path) {
if (event == FileObserver.DELETE || event == FileObserver.DELETE_SELF){
Log.d(DEBUG_TAG, TAG + "file " + path + " DELETED");
long id = settings.getLong(path, 0);
Log.d(DEBUG_TAG, TAG + "id: " + id);
// actual job after a file deletion is detected
}
}
public void close(){
super.finalize();
}
}