Skip to content

fix: minor Android Studio warnings#20412

Merged
david-allison merged 1 commit intoankidroid:mainfrom
aadityarshah:fix/android-studio-warnings
Mar 8, 2026
Merged

fix: minor Android Studio warnings#20412
david-allison merged 1 commit intoankidroid:mainfrom
aadityarshah:fix/android-studio-warnings

Conversation

@aadityarshah
Copy link
Contributor

@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 2 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 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?

  • Performed Github Actions' workflows on the changes in the branch which ran successfully helping me conclude changes were made 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
@aadityarshah aadityarshah force-pushed the fix/android-studio-warnings branch from ea74373 to 325cb50 Compare March 6, 2026 21:15
@Alok-Silswal
Copy link
Contributor

@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
Contributor 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
Contributor

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

@aadityarshah
Copy link
Contributor Author

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

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers! Test looks flaky, I'll merge if it goes green

@aadityarshah aadityarshah marked this pull request as ready for review March 7, 2026 23:42
@aadityarshah
Copy link
Contributor Author

@david-allison Thank you sir! I have opened the pull request since it was a draft earlier. Can you see if you can merge it now?

@david-allison
Copy link
Member

I can't reproduce the CI issue, but it looks persistent, could you split the change into separate commits so you can figure out which change is causing the CI break? We can get the others in without issue.

@aadityarshah aadityarshah force-pushed the fix/android-studio-warnings branch from 325cb50 to c912daf Compare March 8, 2026 00:58
@aadityarshah
Copy link
Contributor Author

@david-allison I have separated each of the commits as you suggested, thank you for your advice!

@david-allison
Copy link
Member

Which one broke CI?

You can test using GitHub Actions on your fork

@aadityarshah aadityarshah force-pushed the fix/android-studio-warnings branch 2 times, most recently from aefb3d1 to b802430 Compare March 8, 2026 05:04
@aadityarshah
Copy link
Contributor Author

aadityarshah commented Mar 8, 2026

@david-allison On reviewing each of the commits individually using Github Actions, I found out that the change I was trying to make by adding package for AnalyticalWidgetProviderTest.kt was causing the error, I couldn't figure out the reason and decided to push the remaining commits after reviewing that they were successful in the Unit tests I ran in my fork. Thanks a lot for your suggestions and guidance.

@david-allison david-allison self-assigned this Mar 8, 2026
@david-allison david-allison added the squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. label Mar 8, 2026
@david-allison
Copy link
Member

david-allison commented Mar 8, 2026

@aadityarshah

Before I merge this

  • your git.name is "unknown"
  • your git.email is your Gmail, not the GitHub supplied noreply address
    • optional: 12345678+username@users.noreply.github.com

  • ❓ Could you pick the name you want this PR assigned to
    • Anything is other than unknown is fine; aadityarshah or Aaditya [Rushabh] Shah
  • ❓ Could you specify if you're fine with your gmail ***7@gmail appearing in git history?
    • If not, could you provide your GitHub noreply address from the GitHub settings

Cheers!

@david-allison david-allison removed their assignment Mar 8, 2026
@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. and removed Needs Review squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. labels Mar 8, 2026
@aadityarshah aadityarshah force-pushed the fix/android-studio-warnings branch from b802430 to 66a479d Compare March 8, 2026 10:31
@aadityarshah
Copy link
Contributor Author

@david-allison I didn't notice that, I am sorry for that. Thank you for informing, I have updated those fields after deciding to keep my email private. Can you check the updates and see if you can merge it now?

fix: Changed PermissionDenied from inner class to class
fix: Fixed spacing in `@Ignore` message
fix: Added missing package declaration to Utils.kt
@david-allison david-allison force-pushed the fix/android-studio-warnings branch from 66a479d to b2b0023 Compare March 8, 2026 14:48
@david-allison david-allison removed Needs Author Reply Waiting for a reply from the original author squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. labels Mar 8, 2026
@david-allison david-allison enabled auto-merge March 8, 2026 14:48
@david-allison
Copy link
Member

Thanks so much!!

@david-allison david-allison added this pull request to the merge queue Mar 8, 2026
Merged via the queue into ankidroid:main with commit 39a9654 Mar 8, 2026
15 checks passed
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Mar 8, 2026
@github-actions github-actions bot added this to the 2.24 release milestone Mar 8, 2026
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.

[Cleanup]: Fix Android Studio Warnings

3 participants