Commit 590fa448 authored by narinder Rana's avatar narinder Rana
Browse files

worked on Feedback

parent cf3a070f
Pipeline #128428 passed with stage
in 3 minutes and 14 seconds
...@@ -19,7 +19,7 @@ public class ConnectivityReceiver ...@@ -19,7 +19,7 @@ public class ConnectivityReceiver
} }
public boolean isConnected(Context context) { public boolean isConnected(Context context) {
// String command = "ping -c 1 google.com"; // String command = "ping -c 1 e.foundation";
// return (Runtime.getRuntime().exec(command).waitFor() == 0); // return (Runtime.getRuntime().exec(command).waitFor() == 0);
try { try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
......
...@@ -68,11 +68,11 @@ public class InitializerService extends Service ...@@ -68,11 +68,11 @@ public class InitializerService extends Service
this.existingRemoteFolderCounter = 0; this.existingRemoteFolderCounter = 0;
//JobUtils.scheduleInitializerJob(getApplicationContext()); //JobUtils.scheduleInitializerJob(getApplicationContext());
connectivityReceiver = new ConnectivityReceiver(); connectivityReceiver = new ConnectivityReceiver();
registerNetworkBroadcastForNougat(); registerConnectivityReceiver();
} }
private void registerNetworkBroadcastForNougat() { private void registerConnectivityReceiver() {
registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
...@@ -323,9 +323,9 @@ public class InitializerService extends Service ...@@ -323,9 +323,9 @@ public class InitializerService extends Service
this.mCloudClient = null; this.mCloudClient = null;
if(this.mSyncedFolders != null) this.mSyncedFolders.clear(); if(this.mSyncedFolders != null) this.mSyncedFolders.clear();
this.mSyncedFolders = null; this.mSyncedFolders = null;
unregisterNetworkChanges(); unregisterConnectivityReceiver();
} }
protected void unregisterNetworkChanges() { protected void unregisterConnectivityReceiver() {
try { try {
unregisterReceiver(connectivityReceiver); unregisterReceiver(connectivityReceiver);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
......
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