X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FAltosDebug.java;h=2ae065222b756351bd406b75ba338e9c642d5739;hp=80f1861b15ba6b7732ac14c2e0a8fe1de9940de6;hb=4a257455b2dc57069c41e1845daf66239c5cbe1d;hpb=2509b664df6a13e6ae9e6753dc9fa0d696a4f6c7 diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java index 80f1861b..2ae06522 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java @@ -3,7 +3,8 @@ * * 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; version 2 of the License. + * the Free Software Foundation; either version 2 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 @@ -20,7 +21,7 @@ import java.util.Arrays; import java.io.*; import java.lang.*; -import org.altusmetrum.altoslib_7.*; +import org.altusmetrum.altoslib_13.*; import android.app.Activity; import android.graphics.*; @@ -32,12 +33,27 @@ import android.widget.*; import android.location.Location; import android.content.*; import android.util.Log; -import android.os.Looper; +import android.os.*; +import android.content.pm.*; public class AltosDebug { // Debugging static final String TAG = "AltosDroid"; - public static final boolean D = true; + + static boolean D = true; + + static void init(Context context) { + ApplicationInfo app_info = context.getApplicationInfo(); + + if ((app_info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) { + Log.d(TAG, "Enable debugging\n"); + D = true; + } else { + Log.d(TAG, "Disable debugging\n"); + D = false; + } + } + static void info(String format, Object ... arguments) { Log.i(TAG, String.format(format, arguments));