1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-08 19:21:35 +00:00

Optimized imports, removed unused function, removed assert.

This commit is contained in:
Felix Ableitner 2014-08-18 00:55:01 +02:00
parent 9a0cf429ae
commit c3b027e8b5
5 changed files with 4 additions and 23 deletions

View file

@ -2,14 +2,10 @@ package com.nutomic.syncthingandroid.fragments;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.Preference;
@ -26,7 +22,6 @@ import com.nutomic.syncthingandroid.activities.SettingsActivity;
import com.nutomic.syncthingandroid.activities.SyncthingActivity;
import com.nutomic.syncthingandroid.syncthing.RestApi;
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
import com.nutomic.syncthingandroid.util.ExtendedCheckBoxPreference;
import java.util.ArrayList;

View file

@ -1,18 +1,12 @@
package com.nutomic.syncthingandroid.fragments;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import android.support.v4.app.NavUtils;
import android.support.v4.preference.PreferenceFragment;
import android.support.v7.app.ActionBarActivity;
import android.text.InputType;
import android.view.MenuItem;
@ -20,7 +14,6 @@ import com.nutomic.syncthingandroid.R;
import com.nutomic.syncthingandroid.activities.SyncthingActivity;
import com.nutomic.syncthingandroid.syncthing.RestApi;
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
public class SettingsFragment extends PreferenceFragment
implements SyncthingActivity.OnServiceConnectedListener,

View file

@ -3,10 +3,8 @@ package com.nutomic.syncthingandroid.syncthing;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.os.BatteryManager;
import android.util.Log;
/**
* Holds information about the current wifi and charging state of the device.

View file

@ -3,12 +3,8 @@ package com.nutomic.syncthingandroid.syncthing;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.BatteryManager;
import android.preference.PreferenceManager;
import android.util.Log;
/**
* Receives network connection change intents and sends the wifi state to {@link SyncthingService}.

View file

@ -17,6 +17,7 @@ import android.util.Log;
import android.view.WindowManager;
import android.widget.Toast;
import com.nutomic.syncthingandroid.BuildConfig;
import com.nutomic.syncthingandroid.R;
import org.json.JSONArray;
@ -231,7 +232,9 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener {
*/
private void tryIsAvailable() {
int value = mAvailableCount.incrementAndGet();
assert(value <= TOTAL_STARTUP_CALLS);
if (BuildConfig.DEBUG && value > TOTAL_STARTUP_CALLS) {
throw new AssertionError("Too many startup calls");
}
if (value == TOTAL_STARTUP_CALLS) {
mSyncthingService.onApiChange();
}
@ -855,10 +858,6 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener {
}.execute(mUrl, GetTask.URI_NODEID, mApiKey, "id", id);
}
public boolean isApiAvailable() {
return mAvailableCount.get() == TOTAL_STARTUP_CALLS;
}
/**
* Shares the given node id via Intent. Must be called from an Activity.
*/