Skip to content

Fix DB Migration Crash, Provider Projections, and Missing INTERNET Permission#20

Merged
gx-bangsong merged 1 commit intomainfrom
fix-db-migration-and-provider-crash-14359383749659225481
Mar 27, 2026
Merged

Fix DB Migration Crash, Provider Projections, and Missing INTERNET Permission#20
gx-bangsong merged 1 commit intomainfrom
fix-db-migration-and-provider-crash-14359383749659225481

Conversation

@gx-bangsong
Copy link
Copy Markdown
Owner

This PR fixes a critical crash caused by a missing database column vibrationPattern and a SecurityException due to missing INTERNET permission.

Key changes:

  1. Database Migration (v22): Added vibrationPattern (TEXT) and holidayOption (INTEGER) columns to both alarm_templates and alarm_instances tables. Included full migration logic in ClockDatabaseHelper.onUpgrade().
  2. ClockProvider Fix: Updated the projection maps (sAlarmsWithInstancesProjection) to include the new columns. This resolves the IllegalArgumentException thrown by SQLiteQueryBuilder when querying these columns.
  3. Manifest Update: Declared the android.permission.INTERNET permission, which is required by HolidayRepository to fetch holiday data from external APIs.
  4. Model Updates: Updated Alarm and AlarmInstance classes to correctly read and write the new fields across all constructors, createContentValues(), and Parcelable implementations. Verified that all existing core methods were preserved.

All changes have been verified to compile successfully via ./gradlew assembleDebug.


PR created automatically by Jules for task 14359383749659225481 started by @gx-bangsong

- Bumped database version to 22 in ClockDatabaseHelper.
- Added vibrationPattern and holidayOption columns to alarm_templates and alarm_instances.
- Implemented migration logic in onUpgrade for version 22.
- Updated ClockProvider projection maps to include new columns, fixing IllegalArgumentException.
- Added INTERNET permission to AndroidManifest.xml for holiday data fetching.
- Updated Alarm and AlarmInstance models to support new fields in all constructors, ContentValues, and Parcelable implementations.

Co-authored-by: gx-bangsong <146644201+gx-bangsong@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gx-bangsong gx-bangsong merged commit 5c7eed1 into main Mar 27, 2026
1 check passed
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.

1 participant