-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Project] Manage Downloaded Episodes - Display Modal when running on low storage and turn on Auto Download #3151
base: main
Are you sure you want to change the base?
Conversation
📲 You can test the changes from this Pull Request in 📱 Mobile by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in 🚗 Automotive by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in ⌚ Wear by scanning the QR code below to install the corresponding build.
|
...ices/views/src/main/java/au/com/shiftyjelly/pocketcasts/views/lowstorage/LowStorageDialog.kt
Outdated
Show resolved
Hide resolved
...ices/views/src/main/java/au/com/shiftyjelly/pocketcasts/views/lowstorage/LowStorageDialog.kt
Outdated
Show resolved
Hide resolved
...ices/views/src/main/java/au/com/shiftyjelly/pocketcasts/views/lowstorage/LowStorageDialog.kt
Outdated
Show resolved
Hide resolved
app/lint-baseline.xml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a question for my knowledge, are we meant to update this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes we need to regenerate it. Like in this case where onAttach()
got reported incorrectly by Lint. However, due to GH Lint integration we need to un-comment this line first.
pocket-casts-android/build.gradle.kts
Lines 193 to 194 in 435a262
// Uncomment this when regenerating baseline files | |
// ignoreWarnings = true |
…casts/views/lowstorage/LowStorageDialog.kt Co-authored-by: Philip Simpson <[email protected]>
…casts/views/lowstorage/LowStorageDialog.kt Co-authored-by: Philip Simpson <[email protected]>
5cf6b4b
to
088d085
Compare
In 5497a6b --- suspend fun isDeviceRunningOnLowStorage(statFs: StatFs = StatFs(Environment.getExternalStorageDirectory().path)): Boolean = withContext(Dispatchers.IO) {
+++ suspend fun isDeviceRunningOnLowStorage(file: File = Environment.getExternalStorageDirectory()): Boolean = withContext(Dispatchers.IO) {
+++ val statFs = StatFs(file.path) The expensive part isn't reading all the properties of the |
dff28c2
to
022d930
Compare
@MiSikora I am struggling to make this change because it breaks the unit tests https://github.com/Automattic/pocket-casts-android/blob/main/modules/services/utils/src/test/java/au/com/shiftyjelly/pocketcasts/utils/StorageUtilTest.kt I can not inject a mock after this. |
Description
Fixes #3150
Testing Instructions
Modify the code bellow to always return
true
to make the tests faster. This will mock the low storage checkpocket-casts-android/modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/StorageUtil.kt
Line 11 in 565d4f7
Screenshots or Screencast
Screen_recording_20241101_133738.webm
Checklist
./gradlew spotlessApply
to automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xml
I have tested any UI changes...