This repository has been archived by the owner on Apr 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove ReportedChanges * add documentation
- Loading branch information
1 parent
5f57a43
commit 20fc93e
Showing
23 changed files
with
217 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
lost/src/main/java/com/mapzen/android/lost/internal/AndroidHandlerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.mapzen.android.lost.internal; | ||
|
||
import android.os.Handler; | ||
import android.os.Looper; | ||
|
||
/** | ||
* Concrete implementation of {@link HandlerFactory} used by {@link LostClientManager}. | ||
*/ | ||
class AndroidHandlerFactory implements HandlerFactory { | ||
|
||
@Override public void run(Looper looper, Runnable runnable) { | ||
Handler handler = new Handler(looper); | ||
handler.post(runnable); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
lost/src/main/java/com/mapzen/android/lost/internal/Clock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
package com.mapzen.android.lost.internal; | ||
|
||
import android.location.Location; | ||
|
||
public interface Clock { | ||
long getCurrentTimeInMillis(); | ||
long MS_TO_NS = 1000000; | ||
|
||
long getSystemElapsedTimeInNanos(); | ||
long getElapsedTimeInNanos(Location location); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
lost/src/main/java/com/mapzen/android/lost/internal/HandlerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.mapzen.android.lost.internal; | ||
|
||
import android.os.Looper; | ||
|
||
/** | ||
* Generic interface for {@link AndroidHandlerFactory} which can be seamlessly replaced for test | ||
* class when running test suite. | ||
*/ | ||
interface HandlerFactory { | ||
void run(Looper looper, Runnable runnable); | ||
} |
21 changes: 21 additions & 0 deletions
21
lost/src/main/java/com/mapzen/android/lost/internal/LocationRequestReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.mapzen.android.lost.internal; | ||
|
||
import com.mapzen.android.lost.api.LocationRequest; | ||
|
||
import android.location.Location; | ||
|
||
/** | ||
* Wrapper object used to store info about when a {@link Location} was last reported for a given | ||
* {@link LocationRequest}. Used by {@link LostClientManager} to determine if a new location should | ||
* should be reported to a given client listener. | ||
*/ | ||
class LocationRequestReport { | ||
|
||
Location location; | ||
final LocationRequest locationRequest; | ||
|
||
LocationRequestReport(LocationRequest request) { | ||
this.locationRequest = request; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.