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
}
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);
try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
......
......@@ -68,11 +68,11 @@ public class InitializerService extends Service
this.existingRemoteFolderCounter = 0;
//JobUtils.scheduleInitializerJob(getApplicationContext());
connectivityReceiver = new ConnectivityReceiver();
registerNetworkBroadcastForNougat();
registerConnectivityReceiver();
}
private void registerNetworkBroadcastForNougat() {
private void registerConnectivityReceiver() {
registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
......@@ -323,9 +323,9 @@ public class InitializerService extends Service
this.mCloudClient = null;
if(this.mSyncedFolders != null) this.mSyncedFolders.clear();
this.mSyncedFolders = null;
unregisterNetworkChanges();
unregisterConnectivityReceiver();
}
protected void unregisterNetworkChanges() {
protected void unregisterConnectivityReceiver() {
try {
unregisterReceiver(connectivityReceiver);
} catch (IllegalArgumentException e) {
......
Markdown is supported
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