Added some logging

This commit is contained in:
M66B 2015-11-24 10:54:43 +01:00
parent 6565938101
commit 90598c2a79
2 changed files with 8 additions and 1 deletions

View File

@ -66,6 +66,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/renderscript" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes-proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
@ -75,6 +76,8 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/release" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />

View File

@ -417,11 +417,15 @@ public class SinkholeService extends VpnService {
public int onStartCommand(Intent intent, int flags, int startId) {
// Intent redelivery
PowerManager.WakeLock wl = getLock(this);
if (!wl.isHeld())
if (!wl.isHeld()) {
Log.w(TAG, "Wakelock not held");
wl.acquire();
}
// Handle service restart
if (intent == null) {
Log.i(TAG, "Restart");
// Get enabled
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean enabled = prefs.getBoolean("enabled", false);