Skip to content
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

show basic app info #2

Closed
kkoshin opened this issue Apr 11, 2022 · 2 comments
Closed

show basic app info #2

kkoshin opened this issue Apr 11, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@kkoshin
Copy link
Member

kkoshin commented Apr 11, 2022

  • build branch+commit id
  • target android version
@kkoshin kkoshin added enhancement New feature or request P1 High priority labels Apr 11, 2022
@kkoshin
Copy link
Member Author

kkoshin commented Jun 20, 2023

list major features in each Android version

@kkoshin kkoshin removed the P1 High priority label Aug 27, 2023
@kkoshin kkoshin moved this to 🆕 New in devtools project Aug 28, 2023
@kkoshin kkoshin added this to the v0.1.1 milestone Aug 29, 2023
@kkoshin kkoshin linked a pull request Aug 29, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in devtools project Aug 29, 2023
@kkoshin kkoshin moved this from ✅ Done to 🆕 New in devtools project Aug 29, 2023
@kkoshin kkoshin reopened this Aug 29, 2023
@kkoshin
Copy link
Member Author

kkoshin commented Dec 6, 2023

query app file/cache storage

LaunchedEffect(Unit) {
        internalFileSize = context.filesDir.getFolderSize()
        externalFileSize = context.getExternalFilesDir(null)!!.getFolderSize()
        val storageStatsManager =
            context.getSystemService(Context.STORAGE_STATS_SERVICE) as StorageStatsManager
        val storageManager = context.getSystemService(Context.STORAGE_SERVICE) as StorageManager
        withContext(Dispatchers.IO) {
            val storageVolumes: List<StorageVolume> = storageManager.storageVolumes
            val user = Process.myUserHandle()
            for (storageVolume: StorageVolume in storageVolumes) {
                val uuidStr = storageVolume.uuid
                val uuid =
                    if (uuidStr == null) StorageManager.UUID_DEFAULT else UUID.fromString(uuidStr)

                val storageStats: StorageStats =
                    storageStatsManager.queryStatsForPackage(uuid, context.packageName, user)

                kotlin.runCatching {
                    debugLog {
                        """
                    ${"storage:" + uuid + " : " + storageVolume.getDescription(context) + " : " + storageVolume.state} 
                    getAppBytes: ${storageStats.appBytes.bytesToMB()} MB
                    getDataBytes: ${storageStats.dataBytes.bytesToMB()} MB
                    getCacheBytes: ${storageStats.cacheBytes.bytesToMB()} MB
                    """.trimIndent()
                    }
                }
            }
        }

@kkoshin kkoshin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: 🆕 New
Development

No branches or pull requests

1 participant