Skip to content

Fix Runtime Crashes: Preference NPEs and Resource Mismatches#24

Merged
gx-bangsong merged 2 commits intomainfrom
fix-preference-and-resource-crashes-14528928520064845018
Mar 29, 2026
Merged

Fix Runtime Crashes: Preference NPEs and Resource Mismatches#24
gx-bangsong merged 2 commits intomainfrom
fix-preference-and-resource-crashes-14528928520064845018

Conversation

@gx-bangsong
Copy link
Copy Markdown
Owner

This PR fixes multiple runtime crashes that were occurring due to corrupted (0-byte) Java files, mismatched preference keys between Java and XML, and inconsistent translation arrays for timezones.

Key changes:

  1. Restored 0-byte Files: Six critical custom preference classes in com.best.deskclock.settings.custompreference were restored from a known-good commit.
  2. Resource Synchronization:
    • The AutoSizingTextView package path was corrected in the expanded alarm layout.
    • The key_timer_auto_silence key was updated to key_timer_auto_silence_duration in settings_timer.xml.
    • The timezone_labels array in the Simplified Chinese (zh_CN) locale was trimmed to 85 items to match the ID array.
  3. Dependency Fixes: Missing layouts and drawables referenced by the restored classes were also restored. An incorrect import of WidgetUtils was fixed.
  4. Preventative Measures:
    • Strict linting for InconsistentArrays is now enforced in app/build.gradle.
    • A basic Espresso smoke test was added to androidTest to ensure the app launches correctly.

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

- Restored several custom preference Java files that were accidentally truncated to 0 bytes.
- Updated `alarm_time_expanded.xml` with the correct package for `AutoSizingTextView`.
- Synchronized the auto-silence preference key in `settings_timer.xml` with `PreferencesKeys.java`.
- Trimmed the `zh_CN` timezone labels array to match the default list size (85 items), preventing `IllegalStateException`.
- Restored missing layouts and drawables required by the restored custom preference classes.
- Fixed an incorrect `WidgetUtils` import in `CustomSeekbarPreference.java`.
- Enforced strict linting for inconsistent resource arrays in `app/build.gradle`.
- Added a basic Espresso UI smoke test to verify app launch stability.

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.

- Restored several custom preference Java files that were accidentally truncated to 0 bytes.
- Updated `alarm_time_expanded.xml` with the correct package for `AutoSizingTextView`.
- Synchronized the auto-silence preference key in `settings_timer.xml` with `PreferencesKeys.java`.
- Trimmed the `zh_CN` timezone labels array to match the default list size (85 items), preventing `IllegalStateException`.
- Restored missing layouts and drawables required by the restored custom preference classes.
- Fixed an incorrect `WidgetUtils` import in `CustomSeekbarPreference.java`.
- Enforced strict linting for inconsistent resource arrays in `app/build.gradle`.
- Added a basic Espresso UI smoke test to verify app launch stability.
- Added a lint baseline to allow existing issues while failing on new `InconsistentArrays` errors.

Co-authored-by: gx-bangsong <146644201+gx-bangsong@users.noreply.github.com>
@gx-bangsong gx-bangsong merged commit e716f4e into main Mar 29, 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