Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f2296a8 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Extract strict literals into constants.

Bug: 143559646
Test: atest cts/tests/BlobStore/src/com/android/cts/blob/BlobStoreManagerTest.java
Change-Id: Id8ccd06bb08592138372fd1203dac51dfbc2e3eb
parent 424ad907
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -27,6 +27,11 @@ class BlobStoreConfig {


    public static final int CURRENT_XML_VERSION = 1;
    public static final int CURRENT_XML_VERSION = 1;


    private static final String ROOT_DIR_NAME = "blobstore";
    private static final String BLOBS_DIR_NAME = "blobs";
    private static final String SESSIONS_INDEX_FILE_NAME = "sessions_index.xml";
    private static final String BLOBS_INDEX_FILE_NAME = "blobs_index.xml";

    @Nullable
    @Nullable
    public static File prepareBlobFile(long sessionId) {
    public static File prepareBlobFile(long sessionId) {
        final File blobsDir = prepareBlobsDir();
        final File blobsDir = prepareBlobsDir();
@@ -60,7 +65,7 @@ class BlobStoreConfig {


    @NonNull
    @NonNull
    private static File getBlobsDir(File blobsRootDir) {
    private static File getBlobsDir(File blobsRootDir) {
        return new File(blobsRootDir, "blobs");
        return new File(blobsRootDir, BLOBS_DIR_NAME);
    }
    }


    @Nullable
    @Nullable
@@ -69,7 +74,7 @@ class BlobStoreConfig {
        if (blobStoreRootDir == null) {
        if (blobStoreRootDir == null) {
            return null;
            return null;
        }
        }
        return new File(blobStoreRootDir, "sessions_index.xml");
        return new File(blobStoreRootDir, SESSIONS_INDEX_FILE_NAME);
    }
    }


    @Nullable
    @Nullable
@@ -78,7 +83,7 @@ class BlobStoreConfig {
        if (blobsStoreRootDir == null) {
        if (blobsStoreRootDir == null) {
            return null;
            return null;
        }
        }
        return new File(blobsStoreRootDir, "blobs_index.xml");
        return new File(blobsStoreRootDir, BLOBS_INDEX_FILE_NAME);
    }
    }


    @Nullable
    @Nullable
@@ -93,6 +98,6 @@ class BlobStoreConfig {


    @NonNull
    @NonNull
    public static File getBlobStoreRootDir() {
    public static File getBlobStoreRootDir() {
        return new File(Environment.getDataSystemDirectory(), "blobstore");
        return new File(Environment.getDataSystemDirectory(), ROOT_DIR_NAME);
    }
    }
}
}