Skip to content

Pre-vehicle cleanup#48

Merged
mmathieum merged 4 commits into
masterfrom
mm/pre_vehicle_cleanup
Jan 16, 2026
Merged

Pre-vehicle cleanup#48
mmathieum merged 4 commits into
masterfrom
mm/pre_vehicle_cleanup

Conversation

@mmathieum

@mmathieum mmathieum commented Jan 15, 2026

Copy link
Copy Markdown
Member

@mmathieum mmathieum self-assigned this Jan 15, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mmathieum, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a significant cleanup and enhancement effort, primarily focusing on the provider package by reorganizing content providers into more logical sub-packages. It introduces a new data model for GTFS trips and extends the GTFS Real-Time provider's capabilities with custom headers and flexible alert processing. Additionally, it streamlines Kotlin code for better consistency and introduces a utility script for image asset management, contributing to a more modular, maintainable, and feature-rich codebase.

Highlights

  • Codebase Refactoring & Reorganization: Many content provider classes and their contracts have been moved into dedicated sub-packages (e.g., agency, bike, common, gtfs, news, scheduletimestamp, serviceupdate, status) to improve modularity and maintainability. This includes renaming files and updating their package declarations and import statements across the project.
  • GTFS Data Model Enhancements: A new Trip.kt data class has been introduced to represent GTFS trip information, including trip ID, route ID, direction ID, and service ID. Corresponding changes were made in GTFSProviderContract and GTFSRDSProvider to support querying and handling this new trip data.
  • GTFS Real-Time Provider Improvements: The GTFSRealTimeProvider now supports custom HTTP headers for API requests and includes a new configuration option to ignore direction for service alerts. Several internal helper methods were made public to facilitate extensibility.
  • Kotlin Code Style & Utility Enhancements: Kotlin files saw consistent updates to use private val for LOG_TAG and simplified getLogTag() overrides. New extension functions for Cursor were added in CursorExt.kt to easily retrieve Float and Long values, and existing ones were simplified.
  • Image Asset Generation Script: A new bash script pub/generate_all_dpis_from_xxxhdpi.sh was added to automate the generation of various DPI versions of an image from a high-resolution xxxhdpi source, using the convert command-line tool.
  • Database Initialization & Logging Improvements: The GTFS database initialization process (GTFSProviderDbHelper) was updated to handle the new Trip table and improved with parameters for handling flattened lines in raw resource files. MTLog.java was modified to use ThreadSafeDateFormatter for more readable debug timestamps.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request primarily focuses on refactoring package structures, enhancing code style with Kotlin idioms, and introducing new configuration options for GTFS-RT providers. Key changes include moving provider-related classes into more organized sub-packages (e.g., agency, bike, common, gtfs, news, poi, scheduletimestamp, serviceupdate, status). Additionally, a new Trip data class and associated logic have been added to the GTFS provider, along with a feature flag to conditionally handle trip data export. The GTFS-RT provider now supports ignoring direction in alerts and adding custom HTTP headers, with network request logic refactored into a Kotlin extension function for better modularity. Resource file renames and minor code cleanups also contribute to improved maintainability and clarity.

@mmathieum mmathieum marked this pull request as ready for review January 15, 2026 17:11
@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a large but valuable refactoring effort that significantly improves code organization by moving provider-related classes into more specific sub-packages. It also introduces a new Trip entity with the necessary updates to the GTFS provider, and includes numerous Kotlin style improvements that enhance readability. I've added a few suggestions to make the new drawable generation script more robust.

Comment thread pub/generate_all_dpis_from_xxxhdpi.sh
Comment thread pub/generate_all_dpis_from_xxxhdpi.sh
Comment thread pub/generate_all_dpis_from_xxxhdpi.sh Outdated
mmathieum and others added 2 commits January 16, 2026 08:29
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@mmathieum mmathieum requested a review from Copilot January 16, 2026 13:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes the provider package structure by moving provider classes into more specific subdirectories (agency, bike, common, gtfs, news, poi, scheduletimestamp, serviceupdate, status), improving code organization and maintainability. It also adds new GTFS real-time functionality including trip queries, alert sorting improvements, and support for custom HTTP headers.

Changes:

  • Reorganized provider classes into subdirectory packages
  • Added GTFS trip query support and related database operations
  • Enhanced GTFS real-time alert processing with direction ignoring capability and improved sorting
  • Added utility methods and improved code consistency (LOG_TAG visibility, getLogTag() simplification)

Reviewed changes

Copilot reviewed 91 out of 97 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/java/org/mtransit/android/commons/provider/gtfs/GTFSStatusProviderTest.kt Updated package declaration and imports to reflect new package structure
src/main/res/values/gtfs_real_time_values.xml Added new configuration options for direction ignoring and HTTP headers
src/main/res/values/constants.xml Added clarifying comment about schedule_provider_target
src/main/java/org/mtransit/android/commons/ui/*.kt/java Updated imports and simplified getLogTag() implementations
src/main/java/org/mtransit/android/commons/receiver/*.kt Simplified getLogTag() and LOG_TAG visibility
src/main/java/org/mtransit/android/commons/provider/**/*.java/kt Moved files to subdirectories and updated package declarations
src/main/java/org/mtransit/android/commons/provider/gtfs/GtfsRealtimeExt.kt Renamed sort methods, added conditional field output, new utility methods
src/main/java/org/mtransit/android/commons/provider/gtfs/GTFSRDSProvider.java Added trip query support and related database operations
src/main/java/org/mtransit/android/commons/provider/gtfs/GTFSProviderDbHelper.java Added trip table initialization and visibility changes
src/main/java/org/mtransit/android/commons/provider/gtfs/GTFSProviderDBHelperUtils.kt Enhanced database initialization with line flattening support
src/main/java/org/mtransit/android/commons/provider/gtfs/GTFSRealTimeProviderExt.kt New file with request building utility function
src/main/java/org/mtransit/android/commons/provider/GTFSRealTimeProvider.java Added direction ignoring, HTTP header support, refactored URL building
src/main/java/org/mtransit/android/commons/data/*.java/kt Updated imports to new provider package structure
src/main/java/org/mtransit/android/commons/data/Trip.kt New data class for trip information
Various provider files Added "DO NOT MOVE" comments for Android manifest references
pub/generate_all_dpis_from_xxxhdpi.sh New utility script for generating drawable assets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mmathieum mmathieum merged commit ee7033a into master Jan 16, 2026
4 checks passed
@mmathieum mmathieum deleted the mm/pre_vehicle_cleanup branch January 16, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants