Commit 2a75778b authored by narinder Rana's avatar narinder Rana
Browse files

update connection check for testing

parent 880b6305
Pipeline #136768 failed with stage
in 8 seconds
......@@ -35,16 +35,14 @@ public class ScannerJob extends JobService {
filter.addAction(Intent.ACTION_SCREEN_OFF);
getApplicationContext().registerReceiver(ScreenOffReceiver.getInstance(), filter);
if(ConnectivityReceiver.isConnected()){
Intent observerServiceIntent = new Intent(this, ObserverService.class);
this.startService(observerServiceIntent);
jobFinished(params, false);
return true;
}
else {
InitializerService.fileObserverFlag=true;
return false;
Intent observerServiceIntent = new Intent(this, ObserverService.class);
this.startService(observerServiceIntent);
jobFinished(params, false);
if(!ConnectivityReceiver.isConnected()){
InitializerService.fileObserverFlag=false;
}
return true;
}
......
......@@ -67,24 +67,22 @@ public class FileObserverService extends Service {
InitializerService.files.add(file);
}
if(ConnectivityReceiver.isConnected()){
try
{
if(observerFlag == -1){
new AsyncTaskRunner().execute("");
}
}
catch (Exception e)
{
e.printStackTrace();
if(!ConnectivityReceiver.isConnected()){
InitializerService.fileObserverFlag=true;
}
try
{
if(observerFlag == -1){
new AsyncTaskRunner().execute("");
}
}
else {
InitializerService.fileObserverFlag=true;
catch (Exception e)
{
e.printStackTrace();
}
}
}
......
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