From a6c3996936a3a451f8015ff901ad3ee37dfa8ca7 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 14 Nov 2015 12:17:57 +0100 Subject: [PATCH] Label all components --- app/src/main/AndroidManifest.xml | 11 +++++++++-- .../eu/faircode/netguard/SinkholeService.java | 18 +++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cc316b37..41fea7f3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ @@ -32,17 +33,21 @@ - + @@ -53,7 +58,9 @@ - + diff --git a/app/src/main/java/eu/faircode/netguard/SinkholeService.java b/app/src/main/java/eu/faircode/netguard/SinkholeService.java index 4198a96b..331d7e59 100644 --- a/app/src/main/java/eu/faircode/netguard/SinkholeService.java +++ b/app/src/main/java/eu/faircode/netguard/SinkholeService.java @@ -54,7 +54,7 @@ public class SinkholeService extends VpnService { private boolean last_roaming; private ParcelFileDescriptor vpn = null; private boolean debug = false; - private Thread thread = null; + private Thread debugThread = null; private volatile Looper mServiceLooper; private volatile ServiceHandler mServiceHandler; @@ -71,7 +71,7 @@ public class SinkholeService extends VpnService { synchronized private static PowerManager.WakeLock getLock(Context context) { if (wlInstance == null) { PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); - wlInstance = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, context.getString(R.string.app_name)); + wlInstance = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, context.getString(R.string.app_name) + " wakelock"); wlInstance.setReferenceCounted(true); } return wlInstance; @@ -155,7 +155,7 @@ public class SinkholeService extends VpnService { // Build VPN service final Builder builder = new Builder(); - builder.setSession(getString(R.string.app_name)); + builder.setSession(getString(R.string.app_name) + " session"); // TODO: make tunnel parameters configurable builder.addAddress("10.1.10.1", 32); builder.addAddress("fd00:1:fd00:1:fd00:1:fd00:1", 64); @@ -219,7 +219,7 @@ public class SinkholeService extends VpnService { if (pfd == null || !debug) return; - thread = new Thread(new Runnable() { + debugThread = new Thread(new Runnable() { @Override public void run() { FileInputStream in = null; @@ -282,13 +282,13 @@ public class SinkholeService extends VpnService { } } } - }); - thread.start(); + }, getString(R.string.app_name) + " debug"); + debugThread.start(); } private void stopDebug() { - if (thread != null) - thread.interrupt(); + if (debugThread != null) + debugThread.interrupt(); } private BroadcastReceiver interactiveStateReceiver = new BroadcastReceiver() { @@ -345,7 +345,7 @@ public class SinkholeService extends VpnService { super.onCreate(); Log.i(TAG, "Create"); - HandlerThread thread = new HandlerThread(getString(R.string.app_name)); + HandlerThread thread = new HandlerThread(getString(R.string.app_name) + " handler"); thread.start(); mServiceLooper = thread.getLooper();