mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
remove trailing whitespaces
This commit is contained in:
parent
b91efaa973
commit
46f62e1af9
117 changed files with 3039 additions and 3040 deletions
|
@ -23,4 +23,4 @@
|
|||
</activity>
|
||||
<service android:enabled="true" android:name=".ForegroundService"/>
|
||||
</application>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<menu
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".I2PD">
|
||||
<item
|
||||
android:id="@+id/action_graceful_quit"
|
||||
|
|
|
@ -14,10 +14,10 @@ public class DaemonSingleton {
|
|||
public static DaemonSingleton getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
public synchronized void addStateChangeListener(StateUpdateListener listener) { stateUpdateListeners.add(listener); }
|
||||
public synchronized void removeStateChangeListener(StateUpdateListener listener) { stateUpdateListeners.remove(listener); }
|
||||
|
||||
|
||||
public synchronized void stopAcceptingTunnels() {
|
||||
if(isStartedOkay()){
|
||||
state=State.gracefulShutdownInProgress;
|
||||
|
@ -25,19 +25,19 @@ public class DaemonSingleton {
|
|||
I2PD_JNI.stopAcceptingTunnels();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onNetworkStateChange(boolean isConnected) {
|
||||
I2PD_JNI.onNetworkStateChanged(isConnected);
|
||||
}
|
||||
|
||||
|
||||
private boolean startedOkay;
|
||||
|
||||
public static enum State {uninitialized,starting,jniLibraryLoaded,startedOkay,startFailed,gracefulShutdownInProgress};
|
||||
|
||||
|
||||
private State state = State.uninitialized;
|
||||
|
||||
|
||||
public State getState() { return state; }
|
||||
|
||||
|
||||
public synchronized void start() {
|
||||
if(state != State.uninitialized)return;
|
||||
state = State.starting;
|
||||
|
@ -76,9 +76,9 @@ public class DaemonSingleton {
|
|||
fireStateUpdate();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}, "i2pdDaemonStart").start();
|
||||
}
|
||||
private Throwable lastThrowable;
|
||||
|
@ -87,10 +87,10 @@ public class DaemonSingleton {
|
|||
private synchronized void fireStateUpdate() {
|
||||
Log.i(TAG, "daemon state change: "+state);
|
||||
for(StateUpdateListener listener : stateUpdateListeners) {
|
||||
try {
|
||||
listener.daemonStateUpdate();
|
||||
} catch (Throwable tr) {
|
||||
Log.e(TAG, "exception in listener ignored", tr);
|
||||
try {
|
||||
listener.daemonStateUpdate();
|
||||
} catch (Throwable tr) {
|
||||
Log.e(TAG, "exception in listener ignored", tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class DaemonSingleton {
|
|||
public String getDaemonStartResult() {
|
||||
return daemonStartResult;
|
||||
}
|
||||
|
||||
|
||||
private final Object startedOkayLock = new Object();
|
||||
|
||||
public boolean isStartedOkay() {
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ForegroundService extends Service {
|
|||
public void onDestroy() {
|
||||
// Cancel the persistent notification.
|
||||
notificationManager.cancel(NOTIFICATION);
|
||||
|
||||
|
||||
stopForeground(true);
|
||||
|
||||
// Tell the user we stopped.
|
||||
|
@ -91,7 +91,7 @@ public class ForegroundService extends Service {
|
|||
//mNM.notify(NOTIFICATION, notification);
|
||||
startForeground(NOTIFICATION, notification);
|
||||
}
|
||||
|
||||
|
||||
private final DaemonSingleton daemon = DaemonSingleton.getInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,12 +24,12 @@ public class I2PD extends Activity {
|
|||
private static final String TAG = "i2pd";
|
||||
|
||||
private TextView textView;
|
||||
|
||||
|
||||
private final DaemonSingleton daemon = DaemonSingleton.getInstance();
|
||||
|
||||
private DaemonSingleton.StateUpdateListener daemonStateUpdatedListener =
|
||||
|
||||
private DaemonSingleton.StateUpdateListener daemonStateUpdatedListener =
|
||||
new DaemonSingleton.StateUpdateListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void daemonStateUpdate() {
|
||||
runOnUiThread(new Runnable(){
|
||||
|
@ -53,7 +53,7 @@ public class I2PD extends Activity {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -123,7 +123,7 @@ public class I2PD extends Activity {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
private boolean mIsBound;
|
||||
|
||||
private void doBindService() {
|
||||
|
@ -147,7 +147,7 @@ public class I2PD extends Activity {
|
|||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.options_main, menu);
|
||||
getMenuInflater().inflate(R.menu.options_main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -216,9 +216,9 @@ public class I2PD extends Activity {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
quit();
|
||||
quit();
|
||||
}
|
||||
|
||||
|
||||
}, 10*60*1000/*milliseconds*/);
|
||||
}else{
|
||||
quit();
|
||||
|
@ -227,7 +227,7 @@ public class I2PD extends Activity {
|
|||
Log.e(TAG,"",tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},"gracQuitInit").start();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ public class I2PD_JNI {
|
|||
public static native String startDaemon();
|
||||
//should only be called after startDaemon() success
|
||||
public static native void stopDaemon();
|
||||
|
||||
|
||||
public static native void stopAcceptingTunnels();
|
||||
|
||||
|
||||
public static native void onNetworkStateChanged(boolean isConnected);
|
||||
|
||||
public static void loadLibraries() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue