Commit 5046ab5f authored by narinder Rana's avatar narinder Rana
Browse files

manage mp4 file

parent a281fb3a
Pipeline #148346 passed with stage
in 3 minutes and 58 seconds
......@@ -62,12 +62,18 @@ public class FileObserverService extends Service {
public void onEvent(int event, File file) {
//Modify =2, create =256, delete =512, movedTo =128
if(event== FileObserver.CREATE || event==FileObserver.MODIFY || event== FileObserver.DELETE || event ==FileObserver.MOVED_TO){
if(event== FileObserver.CREATE ||
event==FileObserver.MODIFY ||
event== FileObserver.DELETE ||
event ==FileObserver.MOVED_TO){
Log.i(TAG, "...Event ..." + event+"...file ..." + file);
String extension= file.getName().substring(
(file.getName().lastIndexOf('.')+1));
remoteFileFlag=false;
if(!file.isDirectory()){
if(!file.isDirectory() & !extension.equals("mp4")){
for(File remoteFile:InitializerService.remoteDownloadFile){
if(remoteFile.getName().equals(file.getName())){
......@@ -76,9 +82,15 @@ public class FileObserverService extends Service {
}
}
Log.e(TAG, "....... extension..."+extension);
if(!files.contains(file) && !remoteFileFlag){
files.add(file);
}
else {
return;
}
if(!ConnectivityReceiver.isConnected()){
InitializerService.fileObserverFlag=true;
}
......@@ -93,12 +105,7 @@ public class FileObserverService extends Service {
e.printStackTrace();
}
}
}
}
});
......@@ -141,7 +148,7 @@ public class FileObserverService extends Service {
protected void onPostExecute(String s) {
super.onPostExecute(s);
try {
Log.d(TAG, "calling observerServiceIntent via fileObserver..");
Intent observersServiceIntent = new Intent(getApplicationContext(), foundation.e.drive.services.ObserverService.class);
Bundle mBundle = new Bundle();
mBundle.putBoolean("isFileObserverService", true);
......
Supports Markdown
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