We generate an awful lot of debug spew to the log; presumably that's
not helping performance, so lose that for release builds.
Signed-off-by: Keith Packard <keithp@keithp.com>
import android.location.Location;
import android.content.*;
import android.util.Log;
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 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));
static void info(String format, Object ... arguments) {
Log.i(TAG, String.format(format, arguments));
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AltosDebug.debug("+++ ON CREATE +++");
fm = getSupportFragmentManager();
AltosDebug.debug("+++ ON CREATE +++");
fm = getSupportFragmentManager();