/frameworks/base/core/java/android/os/ |
D | Environment.java | 40 import java.io.File; 97 private static final File DIR_ANDROID_ROOT = getDirectory(ENV_ANDROID_ROOT, "/system"); 99 private static final File DIR_ANDROID_DATA = new File(DIR_ANDROID_DATA_PATH); 100 private static final File DIR_ANDROID_EXPAND = getDirectory(ENV_ANDROID_EXPAND, "/mnt/expand"); 101 private static final File DIR_ANDROID_STORAGE = getDirectory(ENV_ANDROID_STORAGE, "/storage"); 102 private static final File DIR_DOWNLOAD_CACHE = getDirectory(ENV_DOWNLOAD_CACHE, "/cache"); 103 private static final File DIR_METADATA = new File("/metadata"); 104 private static final File DIR_OEM_ROOT = getDirectory(ENV_OEM_ROOT, "/oem"); 105 private static final File DIR_ODM_ROOT = getDirectory(ENV_ODM_ROOT, "/odm"); 106 private static final File DIR_VENDOR_ROOT = getDirectory(ENV_VENDOR_ROOT, "/vendor"); [all …]
|
D | FileUtils.java | 70 import java.io.File; 152 public static int setPermissions(File path, int mode, int uid, int gid) { in setPermissions() 223 public static void copyPermissions(@NonNull File from, @NonNull File to) throws IOException { in copyPermissions() 270 public static boolean copyFile(File srcFile, File destFile) { in copyFile() 284 public static void copyFileOrThrow(File srcFile, File destFile) throws IOException { in copyFileOrThrow() 296 public static boolean copyToFile(InputStream inputStream, File destFile) { in copyToFile() 310 public static void copyToFileOrThrow(InputStream in, File destFile) throws IOException { in copyToFileOrThrow() 333 public static long copy(@NonNull File from, @NonNull File to) throws IOException { in copy() 349 public static long copy(@NonNull File from, @NonNull File to, in copy() 619 public static boolean isFilenameSafe(File file) { in isFilenameSafe() [all …]
|
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/ |
D | TaskSnapshotLowResDisabledTest.java | 38 import java.io.File; 71 final File[] files = new File[]{ in testPersistAndLoadSnapshot() 72 new File(FILES_DIR.getPath() + "/snapshots/1.proto"), in testPersistAndLoadSnapshot() 73 new File(FILES_DIR.getPath() + "/snapshots/1.jpg")}; in testPersistAndLoadSnapshot() 74 final File[] nonExistsFiles = new File[]{ in testPersistAndLoadSnapshot() 75 new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg")}; in testPersistAndLoadSnapshot() 76 assertTrueForFiles(files, File::exists, " must exist"); in testPersistAndLoadSnapshot() 95 final File[] existsFiles = new File[]{ in testRemoveObsoleteFiles() 96 new File(FILES_DIR.getPath() + "/snapshots/1.proto"), in testRemoveObsoleteFiles() 97 new File(FILES_DIR.getPath() + "/snapshots/1.jpg")}; in testRemoveObsoleteFiles() [all …]
|
D | TaskSnapshotPersisterLoaderTest.java | 51 import java.io.File; 76 final File[] files = new File[]{new File(FILES_DIR.getPath() + "/snapshots/1.proto"), in testPersistAndLoadSnapshot() 77 new File(FILES_DIR.getPath() + "/snapshots/1.jpg"), in testPersistAndLoadSnapshot() 78 new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg")}; in testPersistAndLoadSnapshot() 79 assertTrueForFiles(files, File::exists, " must exist"); in testPersistAndLoadSnapshot() 99 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1.proto").exists()); in testTaskRemovedFromRecents() 100 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1.jpg").exists()); in testTaskRemovedFromRecents() 101 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg").exists()); in testTaskRemovedFromRecents() 137 final File[] existsFiles = new File[]{ in testPurging() 138 new File(FILES_DIR.getPath() + "/snapshots/3.proto"), in testPurging() [all …]
|
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/ |
D | LicenseHtmlLoaderCompatTest.java | 35 import java.io.File; 60 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackground() 61 xmlFiles.add(new File("test.xml")); in testLoadInBackground() 62 File cachedHtmlFile = new File("test.html"); in testLoadInBackground() 71 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackgroundWithNoVaildXmlFiles() 72 File cachedHtmlFile = new File("test.html"); in testLoadInBackgroundWithNoVaildXmlFiles() 81 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackgroundWithNonOutdatedCachedHtmlFile() 82 xmlFiles.add(new File("test.xml")); in testLoadInBackgroundWithNonOutdatedCachedHtmlFile() 83 File cachedHtmlFile = new File("test.html"); in testLoadInBackgroundWithNonOutdatedCachedHtmlFile() 92 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackgroundWithGenerateHtmlFileFailed() [all …]
|
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/license/ |
D | LicenseHtmlLoaderCompat.java | 25 import java.io.File; 32 public class LicenseHtmlLoaderCompat extends AsyncLoaderCompat<File> { 55 public File loadInBackground() { in loadInBackground() 60 protected void onDiscardResult(File f) { in onDiscardResult() 63 private File generateHtmlFromDefaultXmlFiles() { in generateHtmlFromDefaultXmlFiles() 64 final List<File> xmlFiles = getVaildXmlFiles(); in generateHtmlFromDefaultXmlFiles() 70 File cachedHtmlFile = getCachedHtmlFile(mContext); in generateHtmlFromDefaultXmlFiles() 79 private List<File> getVaildXmlFiles() { in getVaildXmlFiles() 80 final List<File> xmlFiles = new ArrayList(); in getVaildXmlFiles() 82 File file = new File(xmlPath); in getVaildXmlFiles() [all …]
|
/frameworks/base/services/tests/PackageManagerServiceTests/server/src/com/android/server/ |
D | UserDataPreparerTest.java | 42 import java.io.File; 89 File userDeDir = mUserDataPreparer.getDataUserDeDirectory(null, TEST_USER_ID); in testPrepareUserData_De() 91 File systemDeDir = mUserDataPreparer.getDataSystemDeDirectory(TEST_USER_ID); in testPrepareUserData_De() 107 File userCeDir = mUserDataPreparer.getDataUserCeDirectory(null, TEST_USER_ID); in testPrepareUserData_Ce() 109 File systemCeDir = mUserDataPreparer.getDataSystemCeDirectory(TEST_USER_ID); in testPrepareUserData_Ce() 126 File systemCeDir = mUserDataPreparer.getDataSystemCeDirectory(TEST_USER_ID); in testDestroyUserData() 128 File ceFile = new File(systemCeDir, "file"); in testDestroyUserData() 144 File systemDir = mUserDataPreparer.getUserSystemDirectory(TEST_USER_ID); in testDestroyUserData_De() 146 writeFile(new File(systemDir, "file"), "-----" ); in testDestroyUserData_De() 147 File systemDeDir = mUserDataPreparer.getDataSystemDeDirectory(TEST_USER_ID); in testDestroyUserData_De() [all …]
|
/frameworks/base/services/backup/java/com/android/server/backup/ |
D | UserBackupManagerFiles.java | 22 import java.io.File; 30 private static File getBaseDir(int userId) { in getBaseDir() 34 static File getBaseStateDir(int userId) { in getBaseStateDir() 36 return new File(getBaseDir(userId), BACKUP_PERSISTENT_DIR); in getBaseStateDir() 40 return new File(Environment.getDataDirectory(), BACKUP_PERSISTENT_DIR); in getBaseStateDir() 43 static File getDataDir(int userId) { in getDataDir() 45 return new File(getBaseDir(userId), BACKUP_STAGING_DIR); in getDataDir() 49 return new File(Environment.getDownloadCacheDirectory(), BACKUP_STAGING_DIR); in getDataDir() 53 static File getStateDirInSystemDir(int userId) { in getStateDirInSystemDir() 54 return new File(getBaseStateDir(UserHandle.USER_SYSTEM), "" + userId); in getStateDirInSystemDir() [all …]
|
/frameworks/base/core/java/com/android/internal/content/ |
D | F2fsUtils.java | 27 import java.io.File; 41 private static final File sKernelFeatures = 42 new File("/sys/fs/f2fs/features"); 44 private static final File sUserDataFeatures = 45 new File("/dev/sys/fs/by-name/userdata/features"); 46 private static final File sDataDirectory = Environment.getDataDirectory(); 85 public static void releaseCompressedBlocks(ContentResolver resolver, File file) { in releaseCompressedBlocks() 109 final File[] files = getFilesToRelease(file); in releaseCompressedBlocks() 133 private static boolean isCompressionAllowed(@NonNull File file) { in isCompressionAllowed() 164 private static boolean isChild(@NonNull File base, @NonNull String childPath) { in isChild() [all …]
|
/frameworks/base/services/core/java/com/android/server/integrity/ |
D | IntegrityFileManager.java | 39 import java.io.File; 61 private final File mDataDir; 63 private final File mRulesDir; 66 private final File mStagingDir; 87 IntegrityFileManager(RuleParser ruleParser, RuleSerializer ruleSerializer, File dataDir) { in IntegrityFileManager() 92 mRulesDir = new File(dataDir, "integrity_rules"); in IntegrityFileManager() 93 mStagingDir = new File(dataDir, "integrity_staging"); in IntegrityFileManager() 100 File metadataFile = new File(mRulesDir, METADATA_FILE); in IntegrityFileManager() 118 return new File(mRulesDir, RULES_FILE).exists() in initialized() 119 && new File(mRulesDir, METADATA_FILE).exists() in initialized() [all …]
|
/frameworks/base/core/tests/coretests/src/android/os/ |
D | FileUtilsTest.java | 72 import java.io.File; 85 private File mDir; 86 private File mTestFile; 87 private File mCopyFile; 88 private File mTarget; 99 mTestFile = new File(mDir, "test.file"); in setUp() 100 mCopyFile = new File(mDir, "copy.file"); in setUp() 135 final File src = new File(mTarget, "src"); in testCopy_FileToFile() 136 final File dest = new File(mTarget, "dest"); in testCopy_FileToFile() 156 final File src = new File(mTarget, "src"); in testCopy_FileToPipe() [all …]
|
/frameworks/multidex/library/src/androidx/multidex/ |
D | MultiDex.java | 28 import java.io.File; 76 private static final Set<File> installedApk = new HashSet<File>(); 114 new File(applicationInfo.sourceDir), in install() 115 new File(applicationInfo.dataDir), in install() 172 File dataDir = new File(applicationInfo.dataDir); in installInstrumentation() 175 new File(instrumentationInfo.sourceDir), in installInstrumentation() 182 new File(applicationInfo.sourceDir), in installInstrumentation() 207 private static void doInstallation(Context mainContext, File sourceApk, File dataDir, in doInstallation() 243 File dexDir = getDexDir(mainContext, dataDir, secondaryFolderName); in doInstallation() 250 List<? extends File> files = in doInstallation() [all …]
|
/frameworks/base/core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests/src/com/android/framework/multidexlegacytestservices/test/ |
D | ServicesTests.java | 23 import java.io.File; 38 File targetFilesDir = getInstrumentation().getTargetContext().getFilesDir(); in testStressConcurentFirstLaunch() 40 File resultFile = new File(targetFilesDir, "Service" + i); in testStressConcurentFirstLaunch() 44 File completeFile = new File(targetFilesDir, "Service" + i + ".complete"); in testStressConcurentFirstLaunch() 73 File resultFile = new File(targetFilesDir, "Service" + i); in testStressConcurentFirstLaunch() 79 private static boolean areAllServicesRunning(File tagetFilesDir) { in areAllServicesRunning() 81 File completeFile = new File(tagetFilesDir, "Service" + i + ".complete"); in areAllServicesRunning()
|
/frameworks/base/core/java/com/android/internal/util/ |
D | FileRotator.java | 25 import java.io.File; 57 private final File mBasePath; 101 public FileRotator(File basePath, String prefix, long rotateAgeMillis, long deleteAgeMillis) { in FileRotator() 117 final File backupFile = new File(mBasePath, name); in FileRotator() 118 final File file = new File( in FileRotator() 127 final File noBackupFile = new File(mBasePath, name); in FileRotator() 128 final File file = new File( in FileRotator() 146 new File(mBasePath, name).delete(); in deleteAll() 163 final File file = new File(mBasePath, name); in dumpAll() 238 final File file = new File(mBasePath, name); in rewriteSingle() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/powerstats/ |
D | PowerStatsServiceTest.java | 54 import java.io.File; 93 private File mDataStorageDir; 101 File createDataStoragePath() { 150 File dataStoragePath, String meterFilename, String meterCacheFilename, 298 File incidentReport = new File(mDataStorageDir, PROTO_OUTPUT_FILENAME); in testWrittenMeterDataMatchesReadIncidentReportData() 342 File incidentReport = new File(mDataStorageDir, PROTO_OUTPUT_FILENAME); in testWrittenModelDataMatchesReadIncidentReportData() 389 File incidentReport = new File(mDataStorageDir, PROTO_OUTPUT_FILENAME); in testWrittenResidencyDataMatchesReadIncidentReportData() 443 File onDeviceStorageFile = new File(mDataStorageDir, METER_FILENAME + ".1234-2234"); in testCorruptOnDeviceMeterStorage() 449 File incidentReport = new File(mDataStorageDir, PROTO_OUTPUT_FILENAME); in testCorruptOnDeviceMeterStorage() 486 File onDeviceStorageFile = new File(mDataStorageDir, MODEL_FILENAME + ".1234-2234"); in testCorruptOnDeviceModelStorage() [all …]
|
/frameworks/base/packages/LocalTransport/src/com/android/localtransport/ |
D | LocalTransport.java | 41 import java.io.File; 80 private File mDataDir; 81 private File mCurrentSetDir; 82 protected File mCurrentSetIncrementalDir; 83 private File mCurrentSetFullDir; 88 private File mRestoreSetDir; 89 protected File mRestoreSetIncrementalDir; 90 private File mRestoreSetFullDir; 106 mCurrentSetDir = new File(mDataDir, Long.toString(CURRENT_SET_TOKEN)); in makeDataDirs() 107 mCurrentSetIncrementalDir = new File(mCurrentSetDir, INCREMENTAL_DIR); in makeDataDirs() [all …]
|
/frameworks/base/core/java/android/content/pm/ |
D | PackagePartitions.java | 30 import java.io.File; 113 private static File canonicalize(File path) { in canonicalize() 160 private final File mNonConicalFolder; 162 private SystemPartition(@NonNull File folder, @PartitionType int type, String name, in SystemPartition() 189 public SystemPartition(@NonNull File rootFolder, @NonNull SystemPartition partition) { in SystemPartition() 205 public File getFolder() { in getFolder() 211 public File getNonConicalFolder() { in getNonConicalFolder() 217 public File getAppFolder() { in getAppFolder() 223 public File getPrivAppFolder() { in getPrivAppFolder() 229 public File getOverlayFolder() { in getOverlayFolder() [all …]
|
/frameworks/base/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ |
D | ObbBackupService.java | 30 import java.io.File; 60 File obbDir = Environment.buildExternalStorageAppObbDirs(packageName)[0]; 63 ArrayList<File> obbList = allFileContents(obbDir); 71 for (File f : obbList) { 109 File outFile = Environment.buildExternalStorageAppObbDirs(packageName)[0]; 111 outFile = new File(outFile, path); 128 ArrayList<File> allFileContents(File rootDir) { 129 final ArrayList<File> files = new ArrayList<File>(); 130 final ArrayList<File> dirs = new ArrayList<File>(); 134 File dir = dirs.remove(0); [all …]
|
/frameworks/base/core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests2/src/com/android/framework/multidexlegacytestservices/test2/ |
D | ServicesTests.java | 33 import java.io.File; 60 public boolean accept(File file) { in accept() 71 public boolean accept(File file) { in accept() 84 private File targetFilesDir; 91 File applicationDataDir = in setup() 92 new File(InstrumentationRegistry.getTargetContext().getApplicationInfo().dataDir); in setup() 195 private static void clearDirContent(File dir) { in clearDirContent() 196 for (File subElement : dir.listFiles()) { in clearDirContent() 225 File resultFile = new File(targetFilesDir, "Service" + i); in initServicesWorkFiles() 230 File completeFile = new File(targetFilesDir, "Service" + i + ".complete"); in initServicesWorkFiles() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
D | LockSettingsStorageTestable.java | 30 import java.io.File; 35 public File mStorageDir; 39 public LockSettingsStorageTestable(Context context, File storageDir) { in LockSettingsStorageTestable() 95 protected File getSyntheticPasswordDirectoryForUser(int userId) { in getSyntheticPasswordDirectoryForUser() 105 private File makeDirs(File baseDir, String filePath) { in makeDirs() 106 File path = new File(filePath); in makeDirs() 108 return new File(baseDir, filePath); in makeDirs() 110 File mappedDir = new File(baseDir, path.getParent()); in makeDirs() 112 return new File(mappedDir, path.getName()); in makeDirs()
|
/frameworks/base/media/tests/MtpTests/src/android/mtp/ |
D | MtpDatabaseTest.java | 43 import java.io.File; 58 private static final File mBaseDir = InstrumentationRegistry.getContext().getExternalCacheDir(); 67 private static final File mMainStorageDir = new File(MAIN_STORAGE_DIR); 76 private static File createNewDir(File parent, String name) { in createNewDir() 77 File ret = new File(parent, name); in createNewDir() 84 private static void writeNewFile(File newFile) { in writeNewFile() 92 private static void writeNewFileFromByte(File newFile, byte[] byteData) { in writeNewFileFromByte() 156 private File stageFile(int resId, File file) throws IOException { in stageFile() 209 private void testThumbnail(int fileHandle, File imgFile, boolean isGoodThumb) in testThumbnail() 243 File baseDir = new File(baseTestDirStr); in testMtpDatabaseThumbnail() [all …]
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/blob/ |
D | BlobStoreManagerServiceTest.java | 54 import java.io.File; 67 private File mBlobsDir; 92 doReturn(new File[0]).when(mBlobsDir).listFiles(); in setUp() 114 final File sessionFile1 = mock(File.class); in testHandlePackageRemoved() 120 final File sessionFile2 = mock(File.class); in testHandlePackageRemoved() 126 final File sessionFile3 = mock(File.class); in testHandlePackageRemoved() 132 final File sessionFile4 = mock(File.class); in testHandlePackageRemoved() 140 final File blobFile1 = mock(File.class); in testHandlePackageRemoved() 149 final File blobFile2 = mock(File.class); in testHandlePackageRemoved() 158 final File blobFile3 = mock(File.class); in testHandlePackageRemoved() [all …]
|
/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/chunking/ |
D | ProtoStore.java | 30 import java.io.File; 51 private final File mStoreFolder; 59 new File(context.getFilesDir().getAbsoluteFile(), CHUNK_LISTING_FOLDER)); in createChunkListingStore() 67 new File(context.getFilesDir().getAbsoluteFile(), KEY_VALUE_LISTING_FOLDER)); in createKeyValueListingStore() 76 ProtoStore(Class<T> clazz, File storeFolder) throws IOException { in ProtoStore() 81 private static File ensureDirectoryExistsOrThrow(File directory) throws IOException { in ensureDirectoryExistsOrThrow() 100 File file = getFileForPackage(packageName); in loadProto() 121 File file = getFileForPackage(packageName); in saveProto() 143 File file = getFileForPackage(packageName); in deleteProto() 149 File[] files = mStoreFolder.listFiles(); in deleteAllProtos() [all …]
|
/frameworks/base/services/core/java/com/android/server/pm/parsing/ |
D | PackageCacher.java | 37 import java.io.File; 52 private File mCacheDir; 54 public PackageCacher(@NonNull File cacheDir) { in PackageCacher() 61 private String getCacheKey(File packageFile, int flags) { in getCacheKey() 121 private static boolean isCacheUpToDate(File packageFile, File cacheFile) { in isCacheUpToDate() 126 File backingApexFile = ApexManager.getInstance().getBackingApexFile(packageFile); in isCacheUpToDate() 163 public ParsedPackage getCachedResult(File packageFile, int flags) { in getCachedResult() 165 final File cacheFile = new File(mCacheDir, cacheKey); in getCachedResult() 188 public void cacheResult(File packageFile, int flags, ParsedPackage parsed) { in cacheResult() 191 final File cacheFile = new File(mCacheDir, cacheKey); in cacheResult() [all …]
|
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/ |
D | TemporaryFileManager.java | 26 import java.io.File; 43 public static File getStagedFile(@NonNull Context context) throws IOException { in getStagedFile() 44 return File.createTempFile("package", ".apk", context.getNoBackupFilesDir()); in getStagedFile() 55 public static File getInstallStateFile(@NonNull Context context) { in getInstallStateFile() 56 return new File(context.getNoBackupFilesDir(), "install_results.xml"); in getInstallStateFile() 67 public static File getUninstallStateFile(@NonNull Context context) { in getUninstallStateFile() 68 return new File(context.getNoBackupFilesDir(), "uninstall_results.xml"); in getUninstallStateFile() 75 File[] filesOnBoot = context.getNoBackupFilesDir().listFiles(); in onReceive() 82 File fileOnBoot = filesOnBoot[i]; in onReceive()
|