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