mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-10 13:13:05 +02:00
Code cleanup: remove TAG in Constants.java
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks.util;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.services.sensors.BluetoothConnectionManager;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
@@ -33,13 +32,15 @@ import java.io.IOException;
|
||||
@TargetApi(10)
|
||||
public class Api10Adapter extends Api9Adapter {
|
||||
|
||||
private static final String TAG = Api10Adapter.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public BluetoothSocket getBluetoothSocket(BluetoothDevice bluetoothDevice) throws IOException {
|
||||
try {
|
||||
return bluetoothDevice.createInsecureRfcommSocketToServiceRecord(
|
||||
BluetoothConnectionManager.MY_TRACKS_UUID);
|
||||
} catch (IOException e) {
|
||||
Log.d(Constants.TAG, "Unable to create insecure connection", e);
|
||||
Log.d(TAG, "Unable to create insecure connection", e);
|
||||
}
|
||||
return bluetoothDevice.createRfcommSocketToServiceRecord(BluetoothConnectionManager.MY_TRACKS_UUID);
|
||||
};
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks.util;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.ContextualActionModeCallback;
|
||||
import com.google.android.apps.mytracks.TrackController;
|
||||
import com.google.android.apps.mytracks.services.sensors.BluetoothConnectionManager;
|
||||
@@ -49,6 +48,8 @@ import java.util.List;
|
||||
*/
|
||||
public class Api8Adapter implements ApiAdapter {
|
||||
|
||||
private static final String TAG = Api8Adapter.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public void applyPreferenceChanges(Editor editor) {
|
||||
editor.commit();
|
||||
@@ -85,15 +86,15 @@ public class Api8Adapter implements ApiAdapter {
|
||||
insecure.setAccessible(true);
|
||||
return (BluetoothSocket) insecure.invoke(bluetoothDevice, 1);
|
||||
} catch (SecurityException e) {
|
||||
Log.d(Constants.TAG, "Unable to create insecure connection", e);
|
||||
Log.d(TAG, "Unable to create insecure connection", e);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Log.d(Constants.TAG, "Unable to create insecure connection", e);
|
||||
Log.d(TAG, "Unable to create insecure connection", e);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.d(Constants.TAG, "Unable to create insecure connection", e);
|
||||
Log.d(TAG, "Unable to create insecure connection", e);
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.d(Constants.TAG, "Unable to create insecure connection", e);
|
||||
Log.d(TAG, "Unable to create insecure connection", e);
|
||||
} catch (InvocationTargetException e) {
|
||||
Log.d(Constants.TAG, "Unable to create insecure connection", e);
|
||||
Log.d(TAG, "Unable to create insecure connection", e);
|
||||
}
|
||||
return bluetoothDevice.createRfcommSocketToServiceRecord(BluetoothConnectionManager.MY_TRACKS_UUID);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks.util;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.api.client.http.HttpTransport;
|
||||
import com.google.api.client.http.javanet.NetHttpTransport;
|
||||
|
||||
@@ -35,6 +34,8 @@ import java.util.Arrays;
|
||||
@TargetApi(9)
|
||||
public class Api9Adapter extends Api8Adapter {
|
||||
|
||||
private static final String TAG = Api9Adapter.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public void applyPreferenceChanges(Editor editor) {
|
||||
// Apply asynchronously
|
||||
@@ -43,7 +44,7 @@ public class Api9Adapter extends Api8Adapter {
|
||||
|
||||
@Override
|
||||
public void enableStrictMode() {
|
||||
Log.d(Constants.TAG, "Enabling strict mode");
|
||||
Log.d(TAG, "Enabling strict mode");
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectAll()
|
||||
.penaltyLog()
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks.util;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
|
||||
import android.location.Location;
|
||||
@@ -31,6 +30,8 @@ import java.util.Stack;
|
||||
*/
|
||||
public class LocationUtils {
|
||||
|
||||
private static final String TAG = LocationUtils.class.getSimpleName();
|
||||
|
||||
private static final long MAX_LOCATION_AGE_MS = 60 * 1000; // 1 minute
|
||||
|
||||
private LocationUtils() {}
|
||||
@@ -133,7 +134,7 @@ public class LocationUtils {
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
Log.d(Constants.TAG, "Decimating " + n + " points to " + i + " w/ tolerance = " + tolerance);
|
||||
Log.d(TAG, "Decimating " + n + " points to " + i + " w/ tolerance = " + tolerance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.google.android.apps.mytracks.util;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
@@ -49,7 +47,7 @@ public class SystemUtils {
|
||||
.getPackageInfo("com.google.android.maps.mytracks", PackageManager.GET_META_DATA);
|
||||
return pi.versionName;
|
||||
} catch (NameNotFoundException e) {
|
||||
Log.w(Constants.TAG, "Failed to get version info.", e);
|
||||
Log.w(TAG, "Failed to get version info.", e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -75,7 +73,7 @@ public class SystemUtils {
|
||||
return wakeLock;
|
||||
}
|
||||
if (wakeLock == null) {
|
||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG);
|
||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
|
||||
if (wakeLock == null) {
|
||||
Log.e(TAG, "Cannot create a new wake lock.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user