1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 04:41:16 +00:00

Removed unneeded code.

This commit is contained in:
Felix Ableitner 2015-04-26 05:48:15 +02:00
parent e821d2e468
commit 02a043f76c

View file

@ -14,7 +14,6 @@ import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
@ -92,8 +91,6 @@ public class SyncthingService extends Service {
private final SyncthingServiceBinder mBinder = new SyncthingServiceBinder(this);
private Handler mMainHandler;
/**
* Callback for when the Syncthing web interface becomes first available after service start.
*/
@ -255,7 +252,6 @@ public class SyncthingService extends Service {
.putString("gui_password", sb.toString()).commit();
}
mMainHandler = new Handler();
mDeviceStateHolder = new DeviceStateHolder(SyncthingService.this);
registerReceiver(mDeviceStateHolder, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
new StartupTask().execute();
@ -393,23 +389,18 @@ public class SyncthingService extends Service {
/**
* Called to notifiy listeners of an API change.
*
* Must only be called from SyncthingService or {@link RestApi}.
* Must only be called from SyncthingService or {@link RestApi} on the main thread.
*/
private void onApiChange() {
mMainHandler.post(new Runnable() {
@Override
public void run() {
for (Iterator<OnApiChangeListener> i = mOnApiChangeListeners.iterator();
i.hasNext(); ) {
OnApiChangeListener listener = i.next();
if (listener != null) {
listener.onApiChange(mCurrentState);
} else {
i.remove();
}
}
for (Iterator<OnApiChangeListener> i = mOnApiChangeListeners.iterator();
i.hasNext(); ) {
OnApiChangeListener listener = i.next();
if (listener != null) {
listener.onApiChange(mCurrentState);
} else {
i.remove();
}
});
}
}
/**