Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make background location permission configurable for rebranded apps in build.gradle #1092

Open
barbeau opened this issue Jun 30, 2022 · 1 comment
Milestone

Comments

@barbeau
Copy link
Member

barbeau commented Jun 30, 2022

Summary:

Some rebranded versions of OBA Android may have trouble getting published to Google Play because of the use of background location in the opt-in travel behavior study depending on who is reviewing the Google Play app update application (feedback from Google Play is very inconsistent).

To avoid this headache, we can add a configuration option that effectively removes background location from rebranded apps if the developers want to remove it.

My notes to someone interested in this and the current manual process you'd need to go through:

If you want to remove background location from the whitelabel app entirely you can try removing the “ACCESS_BACKGROUND_LOCATION” from the AndroidManifest.xml:

https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/main/AndroidManifest.xml#L31

…and comment out this code in HomeActivity:

https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/main/java/org/onebusaway/android/ui/HomeActivity.java#L387-L388

        new TravelBehaviorManager(this, getApplicationContext()).
                registerTravelBehaviorParticipant();

This should effectively disable the ability for a user to opt-into the research study by not showing the initial dialog.

Depending on how much static analysis of the code they’re doing, you might need to remove the code that calls for the background location permission too (otherwise they will think you’re still doing background location, even though it’s impossible to actually trigger this code from executing):

https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/main/java/org/onebusaway/android/ui/HomeActivity.java#L1833

                            activity.requestPermissions(TravelBehaviorConstants.BACKGROUND_LOCATION_PERMISSION, BACKGROUND_LOCATION_PERMISSION_REQUEST);

Steps to reproduce:

Build a rebranded version such as Agency X (see https://github.com/OneBusAway/onebusaway-android/blob/master/REBRANDING.md)

Expected behavior:

Give the developer an option to not allow users to opt into travel behavior study and remove the background location permission

Observed behavior:

You need to manually remove the background location configuration and travel behavior study popup.

Device and Android version:

N/A

@barbeau barbeau added this to the v2.6 milestone Jun 30, 2022
@HimanshuMahto
Copy link

hey there, I would like to work on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants