[Banglejs] Bug fix to use correct GPS data provider #3007

Merged
joserebelo merged 1 commits from LukasEdl/Gadgetbridge:bug/banglejs-gps-fix-wrong-provider into master 2023-01-07 13:19:45 +00:00
Contributor

Hi everyone,

the current implementaion of the class PhoneNetworkLocationProvider uses the GPS_PROVIDER to retrieve the gps position from the phone. This however should be the NETWORK_PROVIDER, since the GPS_PROVIDER dose not provide the gps data based on the current network.

Therefore i replaced the GPS_PROVIDER with the NETWORK_PROVIDER so that the network gps data can be used.

Hi everyone, the current implementaion of the class PhoneNetworkLocationProvider uses the GPS_PROVIDER to retrieve the gps position from the phone. This however should be the NETWORK_PROVIDER, since the GPS_PROVIDER dose not provide the gps data based on the current network. Therefore i replaced the GPS_PROVIDER with the NETWORK_PROVIDER so that the network gps data can be used.
joserebelo reviewed 2022-12-31 00:09:41 +00:00
@ -60,3 +60,3 @@
locationManager.removeUpdates(getLocationListener());
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
LocationManager.NETWORK_PROVIDER,
Member

I think we should change it in line 69 too, right?

I think we should change it in line 69 too, right?
Member

@LukasEdl thanks! What about @joserebelo's comment?

@LukasEdl thanks! What about @joserebelo's comment?
Author
Contributor

i added the changes, but i think i did the rebase wrong (i followed the steps here), since there are all the changes between the last time i updated my branch and now. Should i recreate the PR?

i added the changes, but i think i did the rebase wrong (i followed the steps [here](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Developer-Documentation#rebasing-on-top-of-the-master)), since there are all the changes between the last time i updated my branch and now. Should i recreate the PR?
Member

@LukasEdl Not sure what you may have done wrong, but you can still fix it in this PR - it's (almost) always possible fix these things in git :)

You just need to rebase your branch on top of master. Off of the top of my head:

In your branch, you can try to git rebase -i upstream/master. It should open an editor, so you can pick what commits to apply. You want to just leave your 2 commits (the messages here don't matter, only the hashes):

pick 6c03792a6 replace GPS_PROVIDER with NETWORK_PROVIDER to retrieve the gps data from the network
fixup 2fdb4556c fix wrong provider

Here, we are:

  • Picking the first commit
  • Applying the second commit, but as "fixup" - so it gets merged on the previous one.

After this, you should be able to git push --force, and it will end up with a single commit (you can check git log as well).

@LukasEdl Not sure what you may have done wrong, but you can still fix it in this PR - it's (almost) always possible fix these things in git :) You just need to rebase your branch on top of master. Off of the top of my head: In your branch, you can try to `git rebase -i upstream/master`. It should open an editor, so you can pick what commits to apply. You want to just leave your 2 commits (the messages here don't matter, only the hashes): ``` pick 6c03792a6 replace GPS_PROVIDER with NETWORK_PROVIDER to retrieve the gps data from the network fixup 2fdb4556c fix wrong provider ``` Here, we are: - Picking the first commit - Applying the second commit, but as "fixup" - so it gets merged on the previous one. After this, you should be able to `git push --force`, and it will end up with a single commit (you can check `git log` as well).
LukasEdl force-pushed bug/banglejs-gps-fix-wrong-provider from da5eeb312a to 9ef0e6044c 2023-01-07 11:31:15 +00:00 Compare
joserebelo merged commit 9ef0e6044c into master 2023-01-07 13:19:45 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Freeyourgadget/Gadgetbridge#3007
No description provided.