Abstract the location engine from a specific provider#269
Conversation
|
This PR is ready is for a first round of feedback. The main goal of this PR is to create a new abstract In particular, this PR includes:
Still WIP, required next actions:
Related mapbox/mapbox-gl-native#4331. |
|
|
||
| private final int REQUEST_PERMISSIONS_CODE = 0; | ||
|
|
||
| private Activity activity; |
There was a problem hiding this comment.
would it be possible to remove activity completely? it's used for 2 items: permissions granted checks and requesting permissions. Imo I think callers of those method won't mind passing an reference to the Activity.
|
|
||
| /** | ||
| * Created by antonio on 1/11/17. | ||
| */ |
|
|
||
| /** | ||
| * Created by antonio on 1/11/17. | ||
| */ |
| .build(); | ||
| } | ||
|
|
||
| public static LocationEngine getLocationEngine(Context context) { |
There was a problem hiding this comment.
synchronised keyword for thread safety to avoid creating 2 instances?
| .build(); | ||
| } | ||
|
|
||
| public static LocationEngine getLocationEngine(Context context) { |
There was a problem hiding this comment.
synchronised keyword for thread safety to avoid creating 2 instances?
|
|
||
| public interface PermissionsListener { | ||
|
|
||
| void onExplanationNeeded(List<String> permissionsToExplain); |
There was a problem hiding this comment.
Let the developer know that they need to provide an explanation to the user as indicated in the docs. Basically, it covers the ActivityCompat.shouldShowRequestPermissionRationale() == true flow.
| /** | ||
| * Helps request permissions at runtime | ||
| */ | ||
|
|
|
|
||
| private final int REQUEST_PERMISSIONS_CODE = 0; | ||
|
|
||
| private Activity activity; |
There was a problem hiding this comment.
would it be possible to remove activity completely? it's used for 2 items: permissions granted checks and requesting permissions. Imo I think callers of those method won't mind passing an reference to the Activity.
|
@cammace All comments addressed, care to 👍 / 👎 ? |
/cc: @cammace