Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

lint: Rule for openInputStreamSafe

Open Nishthajain7 opened this issue 1 month ago • 2 comments

Purpose / Description

Add a new Lint rule (OpenInputStreamSafeDetector) that enforces the use of openInputStreamSafe().

Fixes

  • Fixes #19663

Approach

Reports the UnsafeOpenInputStream issue and provides a quick-fix to replace the call with openInputStreamSafe().

How Has This Been Tested?

Added unit tests for the same

Checklist

Please, go through these checks before submitting the PR.

  • [x] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [x] You have commented your code, particularly in hard-to-understand areas
  • [x] You have performed a self-review of your own code
  • [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [x] UI Changes: You have tested your change using the Google Accessibility Scanner

Nishthajain7 avatar Dec 04 '25 06:12 Nishthajain7

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

welcome[bot] avatar Dec 04 '25 06:12 welcome[bot]

CI is failing. Comments haven't been answered

david-allison avatar Dec 04 '25 07:12 david-allison