IT. Expert System.

Android Reference

StorageManagerBaseTest


android.os.storage

Class StorageManagerBaseTest

    • Field Detail

      • mContext

        protected Context mContext
      • OBB_FILE_1

        protected static String OBB_FILE_1
      • OBB_FILE_1_CONTENTS_1

        protected static String OBB_FILE_1_CONTENTS_1
      • OBB_FILE_2

        protected static String OBB_FILE_2
      • OBB_FILE_3

        protected static String OBB_FILE_3
      • OBB_FILE_1_PASSWORD

        protected static String OBB_FILE_1_PASSWORD
      • OBB_FILE_1_ENCRYPTED

        protected static String OBB_FILE_1_ENCRYPTED
      • OBB_FILE_2_UNSIGNED

        protected static String OBB_FILE_2_UNSIGNED
      • OBB_FILE_3_PASSWORD

        protected static String OBB_FILE_3_PASSWORD
      • OBB_FILE_3_ENCRYPTED

        protected static String OBB_FILE_3_ENCRYPTED
      • OBB_FILE_3_BAD_PACKAGENAME

        protected static String OBB_FILE_3_BAD_PACKAGENAME
      • FORCE

        protected static boolean FORCE
      • DONT_FORCE

        protected static boolean DONT_FORCE
    • Constructor Detail

      • StorageManagerBaseTest

        public StorageManagerBaseTest()
    • Method Detail

      • createObbFile

        protected File createObbFile(String name,
                         int rawResId)
        Creates an OBB file (with the given name), into the app's standard files directory
        Parameters:
        name - The name of the OBB file we want to create/write to
        rawResId - The raw resource ID of the OBB file in the package
        Returns:
        A File representing the file to write to
      • openFileOnMountedObb

        protected DataInputStream openFileOnMountedObb(String obbPath,
                                           String fileName)
        Mounts an OBB file and opens a file located on it
        Parameters:
        obbPath - Path to OBB image
        fileName - The full name and path to the file on the OBB to open once the OBB is mounted
        Returns:
        The DataInputStream representing the opened file, if successful in opening the file, or null of unsuccessful.
      • mountObb

        protected String mountObb(String obbFilePath,
                      String key,
                      int expectedState)
        Mounts an OBB file
        Parameters:
        obbFilePath - The full path to the OBB file to mount
        key - (optional) The key to use to unencrypt the OBB; pass null for no encryption
        expectedState - The expected state resulting from trying to mount the OBB
        Returns:
        A String representing the normalized path to OBB file that was mounted
      • mountObb

        protected String mountObb(String obbFilePath)
        Mounts an OBB file with default options (no encryption, mounting succeeds)
        Parameters:
        obbFilePath - The full path to the OBB file to mount
        Returns:
        A String representing the normalized path to OBB file that was mounted
      • doWaitForObbStateChange

        protected boolean doWaitForObbStateChange(StorageManagerBaseTest.ObbListener obbListener)
        Synchronously waits for an OBB listener to be signaled of a state change, but does not throw
        Parameters:
        obbListener - The listener for the OBB file
        Returns:
        true if the listener was signaled of a state change by the system, else returns false if we time out.
      • doMountObb_noThrow

        protected String doMountObb_noThrow(String obbFilePath,
                                String key,
                                int expectedState)
        Synchronously waits for an OBB listener to be signaled of a state change
        Parameters:
        obbListener - The listener for the OBB file
        Returns:
        true if the listener was signaled of a state change by the system; else a fail() is triggered if we timed out
      • doMountObb

        protected String doMountObb(String obbFilePath,
                        String key,
                        int expectedState)
        Mounts an OBB file without throwing and synchronously waits for it to finish mounting
        Parameters:
        obbFilePath - The full path to the OBB file to mount
        key - (optional) The key to use to unencrypt the OBB; pass null for no encryption
        expectedState - The expected state resulting from trying to mount the OBB
        Returns:
        A String representing the actual normalized path to OBB file that was mounted, or null if the mounting failed
      • unmountObb_noThrow

        protected boolean unmountObb_noThrow(String obbFilePath,
                                 boolean force)
        Unmounts an OBB file without throwing, and synchronously waits for it to finish unmounting
        Parameters:
        obbFilePath - The full path to the OBB file to mount
        force - true if we shuold force the unmount, false otherwise
        Returns:
        true if the unmount was successful, false otherwise
      • unmountObb

        protected void unmountObb(String obbFilePath,
                      boolean force)
        Unmounts an OBB file and synchronously waits for it to finish unmounting
        Parameters:
        obbFilePath - The full path to the OBB file to mount
        force - true if we shuold force the unmount, false otherwise
      • doValidateIntContents

        protected void doValidateIntContents(String path,
                                 String filename,
                                 int start,
                                 int end)
        Helper to validate the contents of an "int" file in an OBB. The format of the files are sequential int's, in the range of: [start..end)
        Parameters:
        path - The full path to the file (path to OBB)
        filename - The filename containing the ints to validate
        start - The first int expected to be found in the file
        end - The last int + 1 expected to be found in the file
      • doValidateTextContents

        protected void doValidateTextContents(String path,
                                  String filename,
                                  String contents)
        Helper to validate the contents of a text file in an OBB
        Parameters:
        path - The full path to the file (path to OBB)
        filename - The filename containing the ints to validate
        contents - A String containing the expected contents of the file
      • doValidateZeroLongFile

        protected void doValidateZeroLongFile(String path,
                                  String filename,
                                  long size,
                                  boolean checkContents)
        Helper to validate the contents of a "long" file on our OBBs The format of the files are sequential 0's of type long
        Parameters:
        path - The full path to the file (path to OBB)
        filename - The filename containing the ints to validate
        size - The number of zero's expected in the file
        checkContents - If true, the contents of the file are actually verified; if false, we simply verify that the file can be opened
      • doWaitForPath

        protected String doWaitForPath(String filePath)
        Helper to synchronously wait until we can get a path for a given OBB file
        Parameters:
        filePath - The full normalized path to the OBB file
        Returns:
        The mounted path of the OBB, used to access contents in it
      • verifyObb1Contents

        protected void verifyObb1Contents(String filePath)
        Verifies the pre-defined contents of our first OBB (OBB_FILE_1) The OBB contains 4 files and no subdirectories
        Parameters:
        filePath - The normalized path to the already-mounted OBB file
      • verifyObb2Contents

        protected void verifyObb2Contents(String filename)
        Verifies the pre-defined contents of our second OBB (OBB_FILE_2) The OBB contains 2 files and no subdirectories
        Parameters:
        filePath - The normalized path to the already-mounted OBB file
      • verifyObb3Contents

        protected void verifyObb3Contents(String filename)
        Verifies the pre-defined contents of our third OBB (OBB_FILE_3) The OBB contains nested files and subdirectories
        Parameters:
        filePath - The normalized path to the already-mounted OBB file


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 111 / 158749463. Delta: 0.03925 с