summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-08-11 17:42:17 -0700
committerJeff Sharkey <jsharkey@android.com>2013-08-11 17:42:17 -0700
commit7f392defccfae54dc8169e5ad82c2616e0713c8e (patch)
tree3d647e7c869d6cb60f08c3ddaabff33aa12d4906 /packages
parent1abdb7123025e52512b2ed7a518f8c754c35f50a (diff)
downloadframeworks_base-7f392defccfae54dc8169e5ad82c2616e0713c8e.zip
frameworks_base-7f392defccfae54dc8169e5ad82c2616e0713c8e.tar.gz
frameworks_base-7f392defccfae54dc8169e5ad82c2616e0713c8e.tar.bz2
Catch a few extra users of UserEnvironment.
Change-Id: I3112773b72c329893e4118ef1c4f4087d899139e
Diffstat (limited to 'packages')
-rw-r--r--packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java12
-rw-r--r--packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ObbBackupService.java4
2 files changed, 11 insertions, 5 deletions
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
index 6343d0a..6e34bbb 100644
--- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
+++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
@@ -295,10 +295,10 @@ public class DefaultContainerService extends IntentService {
try {
while ((item = pm.nextPackageToClean(item)) != null) {
final UserEnvironment userEnv = new UserEnvironment(item.userId);
- eraseFiles(userEnv.getExternalStorageAppDataDirectory(item.packageName));
- eraseFiles(userEnv.getExternalStorageAppMediaDirectory(item.packageName));
+ eraseFiles(userEnv.buildExternalStorageAppDataDirs(item.packageName));
+ eraseFiles(userEnv.buildExternalStorageAppMediaDirs(item.packageName));
if (item.andCode) {
- eraseFiles(userEnv.getExternalStorageAppObbDirectory(item.packageName));
+ eraseFiles(userEnv.buildExternalStorageAppObbDirs(item.packageName));
}
}
} catch (RemoteException e) {
@@ -306,6 +306,12 @@ public class DefaultContainerService extends IntentService {
}
}
+ void eraseFiles(File[] paths) {
+ for (File path : paths) {
+ eraseFiles(path);
+ }
+ }
+
void eraseFiles(File path) {
if (path.isDirectory()) {
String[] files = path.list();
diff --git a/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ObbBackupService.java b/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ObbBackupService.java
index 7ebe096..0485334 100644
--- a/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ObbBackupService.java
+++ b/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ObbBackupService.java
@@ -57,7 +57,7 @@ public class ObbBackupService extends Service {
int token, IBackupManager callbackBinder) {
final FileDescriptor outFd = data.getFileDescriptor();
try {
- File obbDir = Environment.getExternalStorageAppObbDirectory(packageName);
+ File obbDir = Environment.buildExternalStorageAppObbDirs(packageName)[0];
if (obbDir != null) {
if (obbDir.exists()) {
ArrayList<File> obbList = allFileContents(obbDir);
@@ -106,7 +106,7 @@ public class ObbBackupService extends Service {
long fileSize, int type, String path, long mode, long mtime,
int token, IBackupManager callbackBinder) {
try {
- File outFile = Environment.getExternalStorageAppObbDirectory(packageName);
+ File outFile = Environment.buildExternalStorageAppObbDirs(packageName)[0];
if (outFile != null) {
outFile = new File(outFile, path);
}