Skip to content

Commit

Permalink
Merge pull request #6 from mitchhentges/gps-status-looking-location
Browse files Browse the repository at this point in the history
Ensure that GPS Status doesn't "lose" the mocked location
  • Loading branch information
Mitchell Hentges committed Nov 8, 2015
2 parents caf722a + 2813166 commit ca0b338
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!apiKey) {
apiKey = positionMockApiKey
} else {
apiKey = "PLACEHOLDER_API_KEY"
}
}
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void run() {
}
};

private Location current;
private Position current;
private boolean canMock = true;

public CurrentLocation(LocationManager locationManager) {
Expand All @@ -43,7 +43,7 @@ public void init() {
}

public void set(Position position) {
current = position.toLocation();
current = position;
}

public void clean() {
Expand All @@ -61,7 +61,7 @@ private void applyToSystem() {
}

if (current != null) {
locationManager.setTestProviderLocation(PROVIDER, current);
locationManager.setTestProviderLocation(PROVIDER, current.toLocation());
}
}

Expand Down

0 comments on commit ca0b338

Please sign in to comment.