[Android-Frameworks] Implement the Internal Partition of Storage

本文探讨了Android系统中内部存储与SD卡的分区管理方式,包括如何通过Settings应用查看存储信息,以及不同存储区域如/data、/mnt/sdcard等的文件系统配置和使用情况。

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

Implement Internal partition and SD-card Partition

PURPOSE:    查看Settings->Storage如何调用&显示storage分区信息
DATE :      20130117
FILE :      BYD47/vendor/BYD/app/Settings/res/values/strings.xml
LINE :      2126
CONTEXT:
-
    <!-- SD card & phone storage settings screen, label for check box to erase SD card [CHAR LIMIT=30] -->
    <string name="erase_external_storage" product ="default"> Erase Internal Storage</string>
    <!-- SD card & phone storage settings screen, description for check box to erase USB storage [CHAR LIMIT=NONE] -->
    <string name="erase_external_storage_description" product ="nosdcard"> Erase all the data on the internal USB storage, such as music or photos</ string>
    <!-- SD card & phone storage settings screen, description for check box to erase USB storage [CHAR LIMIT=NONE] -->
    <string name="erase_external_storage_description" product ="default"> Erases all data on the Internal Storage, such as music or photos</ string>
-
--------------------------------------------------------------------------
Search the "erase_external_storage" keyword, got the Settings source code
is: BYD 未公开settings source code
--------------------------------------------------------------------------



PURPOSE:   Thinking..
COMMAND:   adb shell
NOTE:      插入sdcard状况下,此时没有/mnt/sdcard_ext分区
-
# df
/data                    1G   119M   916M   4096
/mnt/asec              485M     0K   485M   4096
/mnt/obb               485M     0K   485M   4096
/factory                 7M     4M     3M   4096
/mnt/sdcard              1G     4M     1G   4096
-
/data -> volume object

COMMAND: cat /proc/mounts
#cat /proc/mounts
/dev/block/mmcblk0p8 /data ext4 rw,nosuid,nodev,noatime,user_xattr,barrier=1,dat
a=ordered,noauto_da_alloc 0 0
/dev/block/vold/179:7 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,u
id=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset
=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
-

"block partition -> volumes", vold接收管理8支partition,其中:
  • partition 8对应着/data分区(FileSystem),对应着Application Storage(AS)
  • partition 7对应着/sdcard分区(FileSystem),对应着Internal Storage(AS)
  • partition 10,11对应着/sdcard_ext分区(FileSystem),未插入sdcard,故未显示之


-
DEVICE: XT920
COMMAND: df

shell@android:/ $ df
df
Filesystem             Size   Used   Free   Blksi
/dev                   488M    84K   488M   4096
/mnt/asec              488M     0K   488M   4096
/mnt/obb               488M     0K   488M   4096
/system                504M   384M   119M   4096
/data                    2G   838M     1G   4096
/cache                 293M     5M   288M   4096
/flex                  252M   173M    78M   4096
/misc/phone            252M   173M    78M   4096
/storage/sdcard0         2G   838M     1G   4096
/storage/sdcard1         7G     5G     2G   32768
-

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值