Loading packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +9 −3 Original line number Original line Diff line number Diff line Loading @@ -295,10 +295,10 @@ public class DefaultContainerService extends IntentService { try { try { while ((item = pm.nextPackageToClean(item)) != null) { while ((item = pm.nextPackageToClean(item)) != null) { final UserEnvironment userEnv = new UserEnvironment(item.userId); final UserEnvironment userEnv = new UserEnvironment(item.userId); eraseFiles(userEnv.getExternalStorageAppDataDirectory(item.packageName)); eraseFiles(userEnv.buildExternalStorageAppDataDirs(item.packageName)); eraseFiles(userEnv.getExternalStorageAppMediaDirectory(item.packageName)); eraseFiles(userEnv.buildExternalStorageAppMediaDirs(item.packageName)); if (item.andCode) { if (item.andCode) { eraseFiles(userEnv.getExternalStorageAppObbDirectory(item.packageName)); eraseFiles(userEnv.buildExternalStorageAppObbDirs(item.packageName)); } } } } } catch (RemoteException e) { } catch (RemoteException e) { Loading @@ -306,6 +306,12 @@ public class DefaultContainerService extends IntentService { } } } } void eraseFiles(File[] paths) { for (File path : paths) { eraseFiles(path); } } void eraseFiles(File path) { void eraseFiles(File path) { if (path.isDirectory()) { if (path.isDirectory()) { String[] files = path.list(); String[] files = path.list(); Loading packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ObbBackupService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class ObbBackupService extends Service { int token, IBackupManager callbackBinder) { int token, IBackupManager callbackBinder) { final FileDescriptor outFd = data.getFileDescriptor(); final FileDescriptor outFd = data.getFileDescriptor(); try { try { File obbDir = Environment.getExternalStorageAppObbDirectory(packageName); File obbDir = Environment.buildExternalStorageAppObbDirs(packageName)[0]; if (obbDir != null) { if (obbDir != null) { if (obbDir.exists()) { if (obbDir.exists()) { ArrayList<File> obbList = allFileContents(obbDir); ArrayList<File> obbList = allFileContents(obbDir); Loading Loading @@ -106,7 +106,7 @@ public class ObbBackupService extends Service { long fileSize, int type, String path, long mode, long mtime, long fileSize, int type, String path, long mode, long mtime, int token, IBackupManager callbackBinder) { int token, IBackupManager callbackBinder) { try { try { File outFile = Environment.getExternalStorageAppObbDirectory(packageName); File outFile = Environment.buildExternalStorageAppObbDirs(packageName)[0]; if (outFile != null) { if (outFile != null) { outFile = new File(outFile, path); outFile = new File(outFile, path); } } Loading test-runner/src/android/test/mock/MockContext.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -577,4 +577,19 @@ public class MockContext extends Context { public DisplayAdjustments getDisplayAdjustments(int displayId) { public DisplayAdjustments getDisplayAdjustments(int displayId) { throw new UnsupportedOperationException(); throw new UnsupportedOperationException(); } } @Override public File[] getExternalFilesDirs(String type) { throw new UnsupportedOperationException(); } @Override public File[] getObbDirs() { throw new UnsupportedOperationException(); } @Override public File[] getExternalCacheDirs() { throw new UnsupportedOperationException(); } } } Loading
packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +9 −3 Original line number Original line Diff line number Diff line Loading @@ -295,10 +295,10 @@ public class DefaultContainerService extends IntentService { try { try { while ((item = pm.nextPackageToClean(item)) != null) { while ((item = pm.nextPackageToClean(item)) != null) { final UserEnvironment userEnv = new UserEnvironment(item.userId); final UserEnvironment userEnv = new UserEnvironment(item.userId); eraseFiles(userEnv.getExternalStorageAppDataDirectory(item.packageName)); eraseFiles(userEnv.buildExternalStorageAppDataDirs(item.packageName)); eraseFiles(userEnv.getExternalStorageAppMediaDirectory(item.packageName)); eraseFiles(userEnv.buildExternalStorageAppMediaDirs(item.packageName)); if (item.andCode) { if (item.andCode) { eraseFiles(userEnv.getExternalStorageAppObbDirectory(item.packageName)); eraseFiles(userEnv.buildExternalStorageAppObbDirs(item.packageName)); } } } } } catch (RemoteException e) { } catch (RemoteException e) { Loading @@ -306,6 +306,12 @@ public class DefaultContainerService extends IntentService { } } } } void eraseFiles(File[] paths) { for (File path : paths) { eraseFiles(path); } } void eraseFiles(File path) { void eraseFiles(File path) { if (path.isDirectory()) { if (path.isDirectory()) { String[] files = path.list(); String[] files = path.list(); Loading
packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ObbBackupService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class ObbBackupService extends Service { int token, IBackupManager callbackBinder) { int token, IBackupManager callbackBinder) { final FileDescriptor outFd = data.getFileDescriptor(); final FileDescriptor outFd = data.getFileDescriptor(); try { try { File obbDir = Environment.getExternalStorageAppObbDirectory(packageName); File obbDir = Environment.buildExternalStorageAppObbDirs(packageName)[0]; if (obbDir != null) { if (obbDir != null) { if (obbDir.exists()) { if (obbDir.exists()) { ArrayList<File> obbList = allFileContents(obbDir); ArrayList<File> obbList = allFileContents(obbDir); Loading Loading @@ -106,7 +106,7 @@ public class ObbBackupService extends Service { long fileSize, int type, String path, long mode, long mtime, long fileSize, int type, String path, long mode, long mtime, int token, IBackupManager callbackBinder) { int token, IBackupManager callbackBinder) { try { try { File outFile = Environment.getExternalStorageAppObbDirectory(packageName); File outFile = Environment.buildExternalStorageAppObbDirs(packageName)[0]; if (outFile != null) { if (outFile != null) { outFile = new File(outFile, path); outFile = new File(outFile, path); } } Loading
test-runner/src/android/test/mock/MockContext.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -577,4 +577,19 @@ public class MockContext extends Context { public DisplayAdjustments getDisplayAdjustments(int displayId) { public DisplayAdjustments getDisplayAdjustments(int displayId) { throw new UnsupportedOperationException(); throw new UnsupportedOperationException(); } } @Override public File[] getExternalFilesDirs(String type) { throw new UnsupportedOperationException(); } @Override public File[] getObbDirs() { throw new UnsupportedOperationException(); } @Override public File[] getExternalCacheDirs() { throw new UnsupportedOperationException(); } } }