aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvanitasvitae <vanitasvitae@riseup.net>2016-05-11 13:37:34 +0200
committervanitasvitae <vanitasvitae@riseup.net>2016-05-11 13:37:34 +0200
commit26a73724548797cec791ea4b622e5e8baea06980 (patch)
treefef9555edef2266d91c9c6e0f4e0ead2840a19ec
parent8e250e0b5d427229abf654944da171960a094738 (diff)
downloadopen-keychain-26a73724548797cec791ea4b622e5e8baea06980.tar.gz
open-keychain-26a73724548797cec791ea4b622e5e8baea06980.tar.bz2
open-keychain-26a73724548797cec791ea4b622e5e8baea06980.zip
Removed authorship, added license etc.
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotStatusReceiver.java31
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotStatusReceiver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotStatusReceiver.java
index 743fbdf16..29a058f0a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotStatusReceiver.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotStatusReceiver.java
@@ -1,3 +1,18 @@
+/*
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
package org.sufficientlysecure.keychain.util.orbot;
import android.content.BroadcastReceiver;
@@ -5,16 +20,14 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
+import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.util.Log;
/**
- * Created by vanitas on 11.05.16.
* BroadcastReceiver that receives Orbots status
*/
public class OrbotStatusReceiver extends BroadcastReceiver {
- private static final String TAG = "OrbStatRec";
-
//TODO: These two Strings are missing in older versions of NetCipher.
//TODO: Once they are present in OrbotHelper (not ProxyHelper) point to OrbotHelpers Strings instead.
public final static String EXTRA_PROXY_PORT_HTTP = "org.torproject.android.intent.extra.HTTP_PROXY_PORT";
@@ -32,7 +45,9 @@ public class OrbotStatusReceiver extends BroadcastReceiver {
}
public static OrbotStatusReceiver getInstance() {
- if(instance == null) instance = new OrbotStatusReceiver();
+ if(instance == null) {
+ instance = new OrbotStatusReceiver();
+ }
return instance;
}
@@ -40,22 +55,22 @@ public class OrbotStatusReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (OrbotHelper.ACTION_STATUS.equals(intent.getAction())) {
- Log.i(TAG, context.getPackageName() + " received intent : " + intent.getAction() + " " + intent.getPackage());
+ Log.i(Constants.TAG, context.getPackageName() + " received intent : " + intent.getAction() + " " + intent.getPackage());
String status = intent.getStringExtra(OrbotHelper.EXTRA_STATUS) + " (" + intent.getStringExtra(OrbotHelper.EXTRA_PACKAGE_NAME) + ")";
this.torRunning = (intent.getStringExtra(OrbotHelper.EXTRA_STATUS).equals(OrbotHelper.STATUS_ON));
- Log.d(TAG, "Orbot status: "+status);
+ Log.d(Constants.TAG, "Orbot status: "+status);
if(torRunning){
Bundle extras = intent.getExtras();
if (extras.containsKey(EXTRA_PROXY_PORT_HTTP)) {
this.proxy_port_http = extras.getInt(EXTRA_PROXY_PORT_HTTP, -1);
- Log.i(TAG, "Http proxy set to "+proxy_port_http);
+ Log.i(Constants.TAG, "Http proxy set to "+proxy_port_http);
}
if (extras.containsKey(EXTRA_PROXY_PORT_SOCKS)) {
this.proxy_port_socks = extras.getInt(EXTRA_PROXY_PORT_SOCKS, -1);
- Log.i(TAG, "Socks proxy set to "+proxy_port_socks);
+ Log.i(Constants.TAG, "Socks proxy set to "+proxy_port_socks);
}
}
}