New external storage APIs.

This implements the spec for external storage organization, and
properly reflects how the media scanner organizes the files it finds.

Also includes package manager support for removing app private
files from external storage when the application is uninstalled.

For the new APIs and paths, the main place to look is Environment
and Context.
This commit is contained in:
Dianne Hackborn
2010-02-04 17:38:14 -08:00
parent 72e5a8820a
commit e83cefcef0
15 changed files with 855 additions and 45 deletions

View File

@@ -320,14 +320,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
}
tag = parser.getName();
if ("admin".equals(tag)) {
DeviceAdminInfo dai = findAdmin(
ComponentName.unflattenFromString(
parser.getAttributeValue(null, "name")));
if (dai != null) {
ActiveAdmin ap = new ActiveAdmin(dai);
ap.readFromXml(parser);
mAdminMap.put(ap.info.getComponent(), ap);
mAdminList.add(ap);
String name = parser.getAttributeValue(null, "name");
try {
DeviceAdminInfo dai = findAdmin(
ComponentName.unflattenFromString(name));
if (dai != null) {
ActiveAdmin ap = new ActiveAdmin(dai);
ap.readFromXml(parser);
mAdminMap.put(ap.info.getComponent(), ap);
mAdminList.add(ap);
}
} catch (RuntimeException e) {
Log.w(TAG, "Failed loading admin " + name, e);
}
} else if ("failed-password-attempts".equals(tag)) {
mFailedPasswordAttempts = Integer.parseInt(