微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > 应用无法访问副卡的android/data/packagename目录

应用无法访问副卡的android/data/packagename目录

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]

第三方应用无法访问副卡的android/data/packagename目录,但google官方反馈说可以访问。

[SOLUTION]

之所以不能在副卡上创建私有目录,是因为环境变量里面没有SECONDARY_STORAGE(可以用set |
grep SECONDARY_STORAGE查看)
之所以环境变量里面没有SECONDARY_STORAGE,是因为Google有提到:
# Refer to http://source.android.com/devices/tech/storage/index.html
# It said, "Starting in Android 4.4, multiple external storage devices are surfaced to
developers through
# Context.getExternalFilesDirs(), Context.getExternalCacheDirs(), and
Context.getObbDirs().
# External storage devices surfaced through these APIs must be a semi-permanent part of
the device (such as an SD card slot in a Battery compartment).
# Developers expect data stored in these locations to be available over long periods of
time."
# Therefore, if the target doesn't support sd hot-plugging (Ex: the SD card slot in a
battery compartment), we need to export SECONDARY_STORAGE in 'boot' section
也就是说Google建议不支持SD卡热插拔的机子才export SECONDARY_STORAGE
如果不关心Google讲的SD卡热插拔导致的风险,一定要让apk可以在副卡上的私有目录存取资料,可
以做下面修改:
alps\mediatek\config\${Project}\init.project.rc

谢谢分享

谢谢分享

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

网站地图

Top