Back to project page yousense-android-tracker.
The source code is released under:
Energy-efficent motion and location tracker for Android. Based on Mattias's power and tracking work. I plan to release it as GPL, once I have a paper published that goes with it. Might also release i...
If you think the Android project yousense-android-tracker listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.linnap.locationtracker; //w w w . ja v a 2 s.c o m public class ExpectedState { public enum TrackerState { OFF, BACKGROUND, GPS_LOCKED }; boolean background; int gpsLockCount; public ExpectedState() { this.background = false; this.gpsLockCount = 0; } public synchronized void intentReceived(String action) { if (LocationTrackerService.ACTION_START_BACKGROUND.equals(action)) background = true; else if (LocationTrackerService.ACTION_STOP_BACKGROUND.equals(action)) background = false; else if (LocationTrackerService.ACTION_LOCK_GPS.equals(action)) ++gpsLockCount; else if (LocationTrackerService.ACTION_UNLOCK_GPS.equals(action)) --gpsLockCount; } public synchronized TrackerState getExpectedState() { if (gpsLockCount > 0) return TrackerState.GPS_LOCKED; else if (background) return TrackerState.BACKGROUND; else return TrackerState.OFF; } }