Skip to content

fix: minor Android Studio warnings#20412

Draft
aadityarshah wants to merge 1 commit intoankidroid:mainfrom
aadityarshah:fix/android-studio-warnings
Draft

fix: minor Android Studio warnings#20412
aadityarshah wants to merge 1 commit intoankidroid:mainfrom
aadityarshah:fix/android-studio-warnings

Conversation

@aadityarshah
Copy link

@aadityarshah aadityarshah commented Mar 6, 2026

Purpose / Description

As a new contributor, I wanted to get familiar with the codebase and wanted to have my first pull request merged. Fixes #13282 seemed to be a good starting point and hence, I decided to fix some Android Studio warnings.

Fixes

  • Fixed a problem/error in 1 file (AnkiDroid/src/test/java/com/ichi2/anki/CardBrowserTest.kt)
  • Fixed simple warnings in 3 other files

Approach

Ran Code/Inspect Code in Android Studio and reviewed the warnings/problems in the code and made the following changes:

  • In CardBrowserTest.kt in the directory AnkiDroid/src/test/java/com/ichi2/anki, added a space between 'current' and 'use' since it was a problem in the file
  • In AnalyticalWidgetProviderTest.kt in the directory AnkiDroid/src/test/java/com/ichi2/anki/widget and Utils.kt in the directory AnkiDroid/src/main/java/com/ichi2/anki/dialogs, added the package com.ichi2.anki ... line to resolve the warning "Package directive does not match the file location"
  • In Test21And26.kt in the directory AnkiDroid/src/test/java/com/ichi2/compat, removed the redundant inner call on the class PermissionDenied.

How Has This Been Tested?

  • ./gradlew assembleDebug was ran using OpenJDK 24 version on Windows 11 and since it executed successfully, it was concluded that the changes have worked successfully.
  • Checked by deploying the :AnkiDroid module to an emulator which ran successfully

Checklist

Please, go through these checks before submitting the PR.

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

@welcome
Copy link

welcome bot commented Mar 6, 2026

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.

@aadityarshah aadityarshah changed the title fix minor Android Studio warnings fix: minor Android Studio warnings Mar 6, 2026
This commit fixes some basic warnings or problems in the codebase.
@aadityarshah aadityarshah force-pushed the fix/android-studio-warnings branch from ea74373 to 325cb50 Compare March 6, 2026 21:15
@Alok-Silswal
Copy link

@aadityarshah It is not a review. But you do not have to omit items that are not ticked in the checklist.

Also, have you noticed that it has failed Unit Tests?

@aadityarshah
Copy link
Author

@Alok-Silswal Thank you for notifying me about the fact that we do not have to omit items that are not ticked in the checklist.
I am working on resolving the error that occurred during the unit tests.

@Alok-Silswal
Copy link

If this PR is not complete, then you may mark this as a draft for the meantime.

@aadityarshah
Copy link
Author

@Alok-Silswal okay thank you for your advice, I will convert to draft.

@aadityarshah aadityarshah marked this pull request as draft March 7, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cleanup]: Fix Android Studio Warnings

2 participants