During the mid-term phase of the Google Summer of Code (GSoC) project, we focused on enhancing location privacy in the enviroCar app. Our objective was to implement and improve the Location Privacy Toolkit (LPT), empowering users with better control over their location data during track recording. We completed code analysis, implementation, bug fixing, and UI enhancements tasks. Let’s delve into the details.
Code Analysis and Setup
Initially, we analyzed the enviroCar app’s codebase to identify relevant modules and components related to location tracking and privacy. By exploring the code using Android Studio, we better understood the code structure and identified areas requiring attention for implementing location privacy features.
Implementing Location Privacy Configuration
One of the major tasks was to implement a test-setting preference and utilize the functions provided by the Location Privacy Config (LPC) module within the app. We edited XML files to define privacy preferences and to match the app theme, and added code to retrieve and set the privacy configuration in the SettingActivity. While we encountered an issue related to accessing the privacy configuration, we laid the foundation for further development.
Setting Accuracy and Interval Preferences
In the following days, we continued working on implementing test-setting preferences and incorporating accuracy and interval preferences into the location privacy configuration. We encountered challenges with libraries and Java Development Kit (JDK) versions, but we were able to successfully set and retrieve accuracy and interval preferences, making progress on implementing location privacy features.
Integrating Location Privacy Toolkit (LPT)
We integrated the LPT as a module in the enviroCar app to enhance location privacy capabilities. We referred to the “LocationProvider.java” file from the enviroCar repository for guidance. The integration involved aligning the LPT with the app’s theme and functionality. This integration allowed the app to leverage advanced privacy features provided by the LPT, paving the way for further enhancements.
Meeting and Progress Update
My project mentor Benjamin Pross and I held regular meetings to discuss progress, challenges and next steps. These meetings provided valuable advice and guidance, aiding decision-making and issue resolution. A meeting on May 29th focused on designing the setting screen using Figma and improving the previously written blog post.
Adding Location Privacy Features to the App
After integrating the LPT, we incorporated location privacy features into different app sections. The LocationPrivacyActivity from the LPT was added to the OthersFragment, enabling users to access location privacy configurations. Code adjustments were made to ensure smooth integration and a cohesive theme. Extensive testing was conducted to ensure proper functioning and promptly address any issues.
Improving Flexibility of Location Privacy Configuration
During the implementation of location privacy features, we realized that the existing LPT provided limited flexibility to users. We enhanced the LPT code to offer more configuration options and user-friendliness to address this. We expanded the accuracy and interval ranges, allowing users to set their preferred values into a broader range. Additionally, rigorous testing and debugging were conducted to ensure the effectiveness of these changes.
Dialog Notifications for Location Access
We introduced dialog notifications in the app to provide better guidance and awareness of location privacy settings. When users block location access through the LPT during track recording, a notification informs them about the restricted access and its implications. This notification helps users understand that their location data may not be accurately recorded. We also modified the upload track dialog notification text to provide more explicit instructions on deleting uploaded track data. These enhancements aimed to improve user experience and ensure a comprehensive understanding of location privacy choices.
Migration and Dependency Conflict Resolution
After inspecting the remote location privacy toolkit, we observed new changes in the LPT module, such as exclusion zones and an improved version of the LPT code. I explored the code and attempted to integrate the new LPT into the enviroCar app. That’s when the most challenging error occurred – migration and dependency conflicts. Efforts were made to resolve dependency conflicts and facilitate seamless integration of the updated LPT. Two integration methods were explored:
- Creating a new repository containing only the LPT submodule and
- pulling the LPT repository, initializing a submodule repo, and pushing the changes to a new remote repository.
Unfortunately, a dependency resolution error involving duplicate classes in the LPT and enviroCar app module dependencies arose. This was related explicitly to Maplibre and Mapbox SDK dependencies. Further analysis and discussions with Benjamin Pross addressed this issue and ensured a smooth migration. A solution to this problem is to remove the Mapbox SDK library from the enviroCar app and add the three mentioned libraries and another core Mapbox library to the enviroCar app build gradle file.
The following dependencies were causing errors:
- maplibre1 = ‘org.maplibre.gl:android-sdk:10.0.2’
- maplibre2 = ‘org.maplibre.gl:android-sdk-turf:5.9.0’
- maplibre3 = ‘org.maplibre.gl:android-plugin-annotation-v9:1.0.0’ in LPT module gradle file
- Mapbox SDK dependency in the enviroCar app gradle file.
Error Description https://gist.github.com/prvn2004/aaedd20e35c2483dd68034d32561c5a3
Future Steps and Conclusion
As the mid-term phase concludes, significant progress has been made in implementing and enhancing location privacy features in the enviroCar app. Integration of the Location Privacy Toolkit, configuration settings, and dialog notifications has provided users with improved control over their location data. Efforts have been made to enhance flexibility and explore better dependency management options. Further collaboration and discussions with Benjamin Pross will determine the best approach to address remaining challenges and improve overall app functionality. Our commitment to enhancing privacy in location tracking will continue in the project’s next phase.
Stay tuned for the next blog post, where we will discuss progress made in the latter half of the Google Summer of Code program and highlight the outcomes achieved.