微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > Storage中,Phone storage 、ExternalStorag...

Storage中,Phone storage 、ExternalStorag...

时间:10-02 整理:3721RD 点击:
【sdcard-application】【Limitation】Storage中,Phone storage 、ExternalStorage出现usagebar比例与实际不一致,"MISC"项不显示
[DESCRIPTION]
1.在SDShared 、SDSwap featureoption均不开启的load上:
1>. 有internal storage、phone storage、external SD三个volume category
2>. 此时phone storage 为primary storage,所以internal storage 和 phone storage 会显示detail itEMS, 如
APPs、Pictures&videos、Audio等
3>. 通过adb push 或者file manger等方式往phone storage的根目录填充文件,发现phone storage 的usage bar比例
不更新,"MISC"项不显示
2.在SDShared featureoption开启的load上:
1>. 有phone storage(JB3之前版本名称有些差别)、external SD 两个volume category
2>. 此时phone storage 为primary storage,只有phone storage显示details items
3>. phone storage usage bar 比例显示正确,"MISC"项可以正常显示
3.在SDSwap featureoption开启的load上:
1>. 有internal storage 、phone storage、external SD三个volume category
2>. 在未插入外部SD卡时,phone storage 为primary storage,所以internal storage、phone storage会显示detail
items
在插入外部SD卡时,external SD为primary storage,所以internal storage、external SD会显示detail items
3>. 在未插入外部SD卡时,phone storage usage bar 比例显示不更新,MISC项不显示
在插入外部SD卡时,external SD usage bar 比例不更新,MISC项不显示
4.在SDShared、SDSwap featureoption均开启的load上
1>. 有phone storage、external SD两个volume category
2>. 在未插入外部SD卡时,phone storage 为primary storage,所以phone storage 会显示detail items
在插入外部SD卡时,external SD为primary storage,所以external SD会显示detail items
3>. 在插入外部SD卡时,external SD usagebar 比例显示不更新,MISC不显示
所以在场景1、3、4均会出现部分volume category中usage bar与实际不一致,MISC项不显示
[SOLUTION]
1. Settings 是负责系统配置设置的APP,sharedUid为system,运行在system process
2. storage volume 在unmount 时会杀死当前访问该volume 的所有process, 但是settings 是system process,系统
是不允许system process 去访问具有unmount 能力的volume,所以在settings中是无法访问这些具有unmount能力的
storage volume
3. storage中MISC项的计算是在settings实现的,在
\alps\packages\apps\Settings\src\com\android\settings\deviceinfo\
StorageMeasurement.java# measureMisc()方法中通过file.listfiles()罗列出当前volume中,根目录下除
APPS\Pictures\
Audios等category中已经罗列过的路径之外所以file和directory,计算其大小并相加,结果作为MISC项大小
4. 因为settings不能访问具有unmount 能力的volume,所以无法进行file.lists()操作,导致MISC项大小计算值总
为0.而在
storage 中,当MISC项大小为0时,就不会去显示MISC项,而且在计算usage bar 时认为MISC大小为0,所以比例与实际
不一致
5. 因为google 本身只支持internal storage,可参考nexus S,对应分区为/data/,不存unmount问题,所以可以正常
显示。在开启
了SDShared featureoption的load上,此时/data/与phone storage同处一片分区,也不存在unmount问题,所以也可以
正常显示。
其他情况下,受制与这个limitation,无法正确显示usage bar 和 MISC项
【问题结论】
目前这个问题属于limitation,尚未完善的解决方案,建议忽略。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top