Invalid UUID of storage gained from Android StorageManager?

谁说胖子不能爱 提交于 2019-12-05 16:27:17

Actually the fromString(uuid_string) takes a "long" UUID (with like 4 or 8 parts can't remember exactly).

However the following works perfectly:

UUID.nameUUIDFromBytes(sv.getUuid().getBytes());

I think the application Info of each package has Storage Volume UUID on which this application is being hosted.

You can get it by ,

ApplicationInfo ai = context.getPackageManager().getApplicationInfo(packagename, 0);
StorageStats storageStats = storageStatsManager.queryStatsForUid(ai.storageUuid, uid);

This is introduced in Oreo Version

I found that this is raised already bug on Android: https://issuetracker.google.com/issues/62982912 so I think that my questions is unanswerable.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!