Commit e801384
fix: batch fix ~40 bugs across codebase
Template fix (affects all 1032 generated methods):
- Fix callErr variable shadowing: `:=` in closure created new variable
that shadowed outer callErr, silently losing JNI errors
- Capture vm.Do() return value: thread attach errors were discarded
- Both fixes together ensure all JNI errors propagate to callers
Code generator fixes:
- Handle bare "CharSequence" as string type in ResolveType
- Handle CharSequence in mergeParam and mergeCallback isString checks
- Remove redundant nil check in Field.GetterName()
- Remove redundant MergedMethod.Error field (HasError suffices)
Core JNI fixes:
- NewString: guard against empty unicodeChars slice panic
- DefineClass: guard against empty class bytes panic
- GetStringRegion/GetStringUTFRegion: guard against empty buf panic
Example resource leak fixes:
- accounts: free GlobalRef per account element after use
- lights: free GlobalRef per Light and LightState after use
- session: free GlobalRef per MediaController after use
- print: free GlobalRef for Job and JobInfo after use
- usb: remove redundant NewGlobalRef wrapping, free refs after use
- power: add missing defer mgr.Close()
- ir: remove crash-causing nil pattern Transmit call
- location: fix comment saying 15s when code uses 30s
Regenerated all packages with template fix applied.1 parent c17fdb0 commit e801384
181 files changed
Lines changed: 6139 additions & 5162 deletions
File tree
- accounts
- app
- admin
- alarm
- blob
- download
- job
- notification
- role
- usage
- bluetooth
- le
- companion
- content
- clipboard
- pm
- preferences
- resolver
- examples
- accounts
- ir
- lights
- location
- power
- print
- session
- usb
- graphics/pdf
- hardware
- biometric
- camera
- ir
- lights
- usb
- location
- altitude
- media
- audiomanager
- audiorecord
- player
- projection
- recorder
- ringtone
- session
- net
- nsd
- vpn
- wifi
- p2p
- rtt
- nfc
- os
- battery
- build
- environment
- keyguard
- power
- storage
- vibrator
- print
- provider
- calendar
- contacts
- documents
- media
- se/omapi
- spec
- java
- overlays/java
- speech
- telecom
- telephony
- templates/java
- tests/e2e
- tools/pkg/javagen
- view
- display
- inputmethod
- widget/toast
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments