ionic-team / ionic-team/ion-android-camera
Android 15: image editor reads deprecated Window.getStatusBarColor / getNavigationBarColor
- Dominant language
- Kotlin
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Summary
Google Play Console flags apps that ship `@capacitor/camera` for using edge-to-edge APIs that Android 15 deprecated, and names this library as one of the origins:
```
android.view.Window.getStatusBarColor
android.view.Window.getNavigationBarColor
origin: io.ionic.libs.ioncameralib.view.IONCAMRImageEditorActivity.onCreate
```
### Where
[`IONCAMRImageEditorActivity.kt#L40-L43`](https://github.com/ionic-team/ion-android-camera/blob/main/src/main/kotlin/io/ionic/libs/ioncameralib/view/IONCAMRImageEditorActivity.kt#L40-L43)
```kotlin
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.dark(window.statusBarColor),
navigationBarStyle = SystemBarStyle.dark(window.navigationBarColor)
)
```
The activity already adopts `enableEdgeToEdge` and applies insets correctly. The only problem is reading those two colours back off the `Window` to feed into it.
### Why it may be worth more than silencing a warning
Per the [Android 15 behaviour changes](https://developer.android.com/about/versions/15/behavior-changes-15#deprecated-apis), `Window#getStatusBarColor` and `Window#getNavigationBarColor` are listed as deprecated **and disabled** for apps targeting SDK 35+, alongside their setters.
So on Android 15+ these getters no longer reflect a value the platform maintains, which means the scrim colours handed to `SystemBarStyle.dark(...)` are effectively incidental rather than chosen — the same call on Android 14 and Android 15 can produce different results for reasons the caller can't see.
### Suggested fix
Pass explicit colours rather than reading them back, e.g. `SystemBarStyle.dark(Color.TRANSPARENT)` or a defined scrim constant.
### Environment
- `@capacitor/camera` 8.2.0 (still present on `main` of this library)
- Capacitor 8, `compileSdkVersion` / `targetSdkVersion` 36
- Reported by Play Console as a recommended action, not a blocking one
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/main/kotlin/io/ionic/libs/ioncameralib/view/IONCAMRImageEditorActivity.kt at lines 40–43 and inspect how the image editor configures its system bars. Replace the deprecated Window color reads with an explicit, intentional scrim color, then verify the editor’s system-bar appearance on Android 15 and that the deprecated getters are no longer used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100