*
* 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
import java.io.*;
import java.lang.*;
-import org.altusmetrum.altoslib_7.*;
+import org.altusmetrum.altoslib_11.*;
import android.app.Activity;
import android.graphics.*;
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));