From source codes,
Vold sets the device as adoptable or not based on the flag(encryptable/forceencrypt) as shown
below.
231 if (fs_mgr_is_encryptable(&fstab->recs[i])) {
232 flags |= android::vold::Disk::Flags::kAdoptable;
233 has_adoptable = true;
234 }
Which is further passed to Mountservice, which marks only the adoptable volumes as Visible
devices.
1285 } else if (vol.type == VolumeInfo.TYPE_PUBLIC) {
1286 // TODO: only look at first public partition
1287 if (Objects.equals(StorageManager.UUID_PRIMARY_PHYSICAL, mPrimaryStorageUuid)
1288 && vol.disk.isDefaultPrimary()) {
1289 Slog.v(TAG, "Found primary storage at " + vol);
1290 vol.mountFlags |= VolumeInfo.MOUNT_FLAG_PRIMARY;
1291 vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
1292 }
1293
1294 // Adoptable public disks are visible to apps, since they meet
1295 // public API requirement of being in a stable location.
1296 if (vol.disk.isAdoptable()) {
1297 vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
1298 }
Non adoptable volumes are NOT exposed to apps.
And hence, in vold, while Mounting(), the app-exposed-mountpoint -> /storage/<ID> is not mounted
for invisible devices.
120 if (getMountFlags() & MountFlags::kVisible) {
121 setPath(StringPrintf("/storage/%s", stableName.c_str()));
122 } else {
Settings is a privileged Platform app, shared system uid, so it can call frameworks APIs directly,
which can't be done by CMFilemanager(which is just system app)
[解决方案]
If we want to see the the non-adoptable volumes (like UDisk and Pen-driver via OTG) in
FileManager app, we can modify MountService.java as below , then have a try.
1294 // Adoptable public disks are visible to apps, since they meet
1295 // public API requirement of being in a stable location
- if (vol.disk.isAdoptable()) {
+ if (vol.disk.isAdoptable() || vol.disk.isUsb()) {
1297 vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
1298 }
上传图片有两种方式: 1.fileReader 可以把图片解析成base64码的格式,简单粗暴 ...
phpstorm是由JetBrains公司开发的一款功能强大的PHP集成开发工具,可深刻理解用...
当下,大数据方面的就业主要有三大方向: 一是数据分析类大数据人才, 二是系统...
在刚刚过去的 Flutter Engage 活动上,我们正式发布了 Flutter 2 : 为任何平台创...
整除 ASP(VBScript) 中整除用“\”,比如 m = 5 \ 2,结果为 2。 取余 ASP(VBScr...
说明 本章主要说明如何使用Magicodes.IE.Csv进行Csv导入导出. 关于Magicodes.IE ...
按照惯例,先来段废话:CKEditor是新一代的FCKeditor,是一个重新开发的版本。CK...
复制代码 代码如下: !--[if !IE]!-- 除IE外都可识别 !--![endif]-- !--[if IE] ...
前言 有位朋友去阿里面试,他说面试官给了几条查询SQL,问:需要执行几次树搜索操...
如果你想了解React Navigation 5.x的基本的概念,可以查看我之前的发的一篇文章...