8.0otg链接u盘,媒体库不更新

本文探讨了Android 7.0与8.0版本中关于存储通知的日志差异,特别是mountFlags参数的变化,从不可见变为可见状态,并展示了具体的代码实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

7.0和8.0log对比

不同在于 mountFlags=VISIBLE

04-08 17:13:07.560  1897  1897 D StorageNotification: Notifying about public volume: VolumeInfo{public:8,3}:04-08 17:13:07.560  1897  1897 D StorageNotification:     type=PUBLIC diskId=disk:8,0 partGuid=null mountFlags=0 mountUserId=0

04-08 17:13:07.560  1897  1897 D StorageNotification:     state=MOUNTED
04-08 17:13:07.560  1897  1897 D StorageNotification:     fsType=vfat fsUuid=6433-427D fsLabel=EFI
04-08 17:13:07.560  1897  1897 D StorageNotification:     path=/mnt/media_rw/6433-427D internalPath=/mnt/media_rw/6433-427D

04-08 17:48:59.126  5224  5224 D StorageNotification: Notifying about public volume: VolumeInfo{public:8,3}:
04-08 17:48:59.126  5224  5224 D StorageNotification:     type=PUBLIC diskId=disk:8,0 partGuid=null mountFlags=VISIBLE mountUserId=0
04-08 17:48:59.126  5224  5224 D StorageNotification:     state=MOUNTED
04-08 17:48:59.126  5224  5224 D StorageNotification:     fsType=vfat fsUuid=6433-427D fsLabel=EFI
04-08 17:48:59.126  5224  5224 D StorageNotification:     path=/storage/6433-427D internalPath=/mnt/media_rw/6433-427D  


修改如下

StorageManagerService.java

if (vol.disk.isAdoptable() ||vol.disk.isUsb()) {

   vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值