diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-09-23 18:25:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-23 18:25:47 -0700 |
commit | 49397ac93ce3cf4fc38d00b1099a6cd9075cee8a (patch) | |
tree | c23a8316dc9418079f8bd7cf5500cfcabab368f5 /packages | |
parent | 6b3292ce5b3908c7433503f64c852cf2b27718ed (diff) | |
parent | 752cd922f7091dfd5401faf70dc248934a9dbb6d (diff) | |
download | frameworks_base-49397ac93ce3cf4fc38d00b1099a6cd9075cee8a.zip frameworks_base-49397ac93ce3cf4fc38d00b1099a6cd9075cee8a.tar.gz frameworks_base-49397ac93ce3cf4fc38d00b1099a6cd9075cee8a.tar.bz2 |
Merge "Always bind to DefaultContainerService as OWNER." into jb-mr1-dev
Diffstat (limited to 'packages')
-rw-r--r-- | packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java index b36bd55..24a9d71 100644 --- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java @@ -35,6 +35,7 @@ import android.content.res.ObbInfo; import android.content.res.ObbScanner; import android.net.Uri; import android.os.Environment; +import android.os.Environment.UserEnvironment; import android.os.FileUtils; import android.os.IBinder; import android.os.ParcelFileDescriptor; @@ -268,15 +269,16 @@ public class DefaultContainerService extends IntentService { @Override protected void onHandleIntent(Intent intent) { if (PackageManager.ACTION_CLEAN_EXTERNAL_STORAGE.equals(intent.getAction())) { - IPackageManager pm = IPackageManager.Stub.asInterface( + final IPackageManager pm = IPackageManager.Stub.asInterface( ServiceManager.getService("package")); - PackageCleanItem pkg = null; + PackageCleanItem item = null; try { - while ((pkg=pm.nextPackageToClean(pkg)) != null) { - eraseFiles(Environment.getExternalStorageAppDataDirectory(pkg.packageName)); - eraseFiles(Environment.getExternalStorageAppMediaDirectory(pkg.packageName)); - if (pkg.andCode) { - eraseFiles(Environment.getExternalStorageAppObbDirectory(pkg.packageName)); + while ((item = pm.nextPackageToClean(item)) != null) { + final UserEnvironment userEnv = new UserEnvironment(item.userId); + eraseFiles(userEnv.getExternalStorageAppDataDirectory(item.packageName)); + eraseFiles(userEnv.getExternalStorageAppMediaDirectory(item.packageName)); + if (item.andCode) { + eraseFiles(userEnv.getExternalStorageAppObbDirectory(item.packageName)); } } } catch (RemoteException e) { |