I created an app in which I need the user's GPS location in Codename One, however when I am installing the app I am prompted to give permission for
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
I know that Codename one adds permission by inspecting the code, so I am not sure what triggers this permission, so that I could remove it. The only place in which I use location is the following:
Location location = LocationManager.getLocationManager().getCurrentLocation();
JSONObject jsonLocation = new JSONObject();
jsonLocation.put(Constants.Latitude, location.getLatitude());
jsonLocation.put(Constants.Longtitude, location.getLongitude());
How can I remove this permission?
Using the location API adds various permissions and in the past a user asked for the ability to mock the location in the device for debugging purposes.
It seems this was added globally without an option to disable that specific permission so we added a build hint android.mockLocation=false
which will allow you to disable the mock location explicitly.
It should be available on the weekend of Nov, 19 2016 (this week).