forked from upstream-mirrors/OpenTracks
Static import TAG.
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks;
|
||||
|
||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||
|
||||
import com.google.android.apps.mytracks.ChartView.Mode;
|
||||
import com.google.android.apps.mytracks.content.MyTracksLocation;
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||
@@ -200,7 +202,7 @@ public class ChartActivity extends Activity implements
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.w(Constants.TAG, "ChartActivity.onCreate");
|
||||
Log.w(TAG, "ChartActivity.onCreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
MyTracks.getInstance().setChartActivity(this);
|
||||
providerUtils = MyTracksProviderUtils.Factory.get(this);
|
||||
@@ -258,7 +260,7 @@ public class ChartActivity extends Activity implements
|
||||
observer = new ContentObserver(contentHandler) {
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
Log.d(Constants.TAG, "ChartActivity: ContentObserver.onChange");
|
||||
Log.d(TAG, "ChartActivity: ContentObserver.onChange");
|
||||
// Check for any new locations and append them to the currently
|
||||
// recording track.
|
||||
if (recordingTrackId < 0) {
|
||||
@@ -279,7 +281,7 @@ public class ChartActivity extends Activity implements
|
||||
waypointObserver = new ContentObserver(contentHandler) {
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
Log.d(Constants.TAG,
|
||||
Log.d(TAG,
|
||||
"MyTracksMap: ContentObserver.onChange waypoints");
|
||||
if (selectedTrackId < 0) {
|
||||
return;
|
||||
@@ -395,7 +397,7 @@ public class ChartActivity extends Activity implements
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
Log.w(Constants.TAG, "Caught an unexpected exception.", e);
|
||||
Log.w(TAG, "Caught an unexpected exception.", e);
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
@@ -492,7 +494,7 @@ public class ChartActivity extends Activity implements
|
||||
result[0] = (location.getTime() - startTime);
|
||||
break;
|
||||
default:
|
||||
Log.w(Constants.TAG, "ChartActivity unknown mode: " + mode);
|
||||
Log.w(TAG, "ChartActivity unknown mode: " + mode);
|
||||
}
|
||||
|
||||
elevationBuffer.setNext(metricUnits
|
||||
@@ -573,10 +575,10 @@ public class ChartActivity extends Activity implements
|
||||
* Read all new track points.
|
||||
*/
|
||||
private void readNewTrackPoints() {
|
||||
Log.i(Constants.TAG, "MyTracks: Updating chart last seen: " + lastSeenLocationId);
|
||||
Log.i(TAG, "MyTracks: Updating chart last seen: " + lastSeenLocationId);
|
||||
Track track = providerUtils.getTrack(recordingTrackId);
|
||||
if (track == null) {
|
||||
Log.w(Constants.TAG, "MyTracks: track not found");
|
||||
Log.w(TAG, "MyTracks: track not found");
|
||||
return;
|
||||
}
|
||||
chartView.addDataPoints(readPointsToList(track));
|
||||
@@ -585,7 +587,7 @@ public class ChartActivity extends Activity implements
|
||||
chartView.invalidate();
|
||||
}
|
||||
});
|
||||
Log.i(Constants.TAG, "MyTracks: Updated chart last seen: " + lastSeenLocationId);
|
||||
Log.i(TAG, "MyTracks: Updated chart last seen: " + lastSeenLocationId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks;
|
||||
|
||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtilsImpl;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
@@ -112,24 +114,24 @@ public class StatsActivity extends Activity
|
||||
|
||||
public UIUpdateThread() {
|
||||
super();
|
||||
Log.i(Constants.TAG, "Created UI update thread");
|
||||
Log.i(TAG, "Created UI update thread");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Log.i(Constants.TAG, "Started UI update thread");
|
||||
Log.i(TAG, "Started UI update thread");
|
||||
while (MyTracks.getInstance().isRecording()) {
|
||||
long sleeptime = 1000;
|
||||
runOnUiThread(updateResults);
|
||||
try {
|
||||
Thread.sleep(sleeptime);
|
||||
} catch (InterruptedException e) {
|
||||
Log.w(Constants.TAG,
|
||||
Log.w(TAG,
|
||||
"StatsActivity: Caught exception on sleep.", e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Log.w(Constants.TAG, "UIUpdateThread finished.");
|
||||
Log.w(TAG, "UIUpdateThread finished.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +157,7 @@ public class StatsActivity extends Activity
|
||||
observer = new ContentObserver(contentHandler) {
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
Log.d(Constants.TAG, "StatsActivity: ContentObserver.onChange");
|
||||
Log.d(TAG, "StatsActivity: ContentObserver.onChange");
|
||||
restoreStats();
|
||||
super.onChange(selfChange);
|
||||
}
|
||||
@@ -217,7 +219,7 @@ public class StatsActivity extends Activity
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(
|
||||
final SharedPreferences sharedPreferences, final String key) {
|
||||
Log.d(Constants.TAG,
|
||||
Log.d(TAG,
|
||||
"StatsActivity: onSharedPreferences changed " + key);
|
||||
if (key != null) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@@ -255,7 +257,7 @@ public class StatsActivity extends Activity
|
||||
utils.updateUnits();
|
||||
utils.setSpeedLabel(
|
||||
R.id.speed_label, R.string.speed, R.string.pace_label);
|
||||
Log.w(Constants.TAG, "Setting speed labels");
|
||||
Log.w(TAG, "Setting speed labels");
|
||||
utils.setSpeedLabels();
|
||||
restoreStats();
|
||||
}
|
||||
@@ -333,7 +335,7 @@ public class StatsActivity extends Activity
|
||||
Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
} else {
|
||||
Log.d(Constants.TAG, "StatsActivity: Using location provider "
|
||||
Log.d(TAG, "StatsActivity: Using location provider "
|
||||
+ gpsProvider.getName());
|
||||
}
|
||||
locationManager.requestLocationUpdates(gpsProvider.getName(),
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.google.android.apps.mytracks.stats;
|
||||
|
||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.MyTracksSettings;
|
||||
|
||||
@@ -126,7 +128,7 @@ public class TripStatisticsBuilder {
|
||||
*/
|
||||
public boolean addLocation(Location currentLocation, long systemTime) {
|
||||
if (paused) {
|
||||
Log.w(Constants.TAG,
|
||||
Log.w(TAG,
|
||||
"Tried to account for location while track is paused");
|
||||
return false;
|
||||
}
|
||||
@@ -208,7 +210,7 @@ public class TripStatisticsBuilder {
|
||||
// We are now sure the user is moving.
|
||||
long timeDifference = updateTime - lastLocationTime;
|
||||
if (timeDifference < 0) {
|
||||
Log.e(Constants.TAG,
|
||||
Log.e(TAG,
|
||||
"Found negative time change: " + timeDifference);
|
||||
}
|
||||
data.addMovingTime(timeDifference);
|
||||
@@ -224,7 +226,7 @@ public class TripStatisticsBuilder {
|
||||
data.setMaxSpeed(movingSpeed);
|
||||
}
|
||||
} else {
|
||||
Log.d(Constants.TAG,
|
||||
Log.d(TAG,
|
||||
"TripStatistics ignoring big change: Raw Speed: " + speed
|
||||
+ " old: " + lastLocationSpeed + " [" + toString() + "]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user