Code example for StorageManager

Methods: getMountedObbPathisObbMountedmountObb

0
    } 
 
    private void mountPatch() { 
        if (patchFile.exists()) {
            Log.d(TAG, "Mounting patch file...");
            sm.mountObb(patchFile.getAbsolutePath(), null, new OnObbStateChangeListener() {
                @Override 
                public void onObbStateChange(String path, int state) {
                    super.onObbStateChange(path, state);
                    if (state == MOUNTED) {
                        Log.d(TAG, "Mounting patch file done.");
                        patch = sm.getMountedObbPath(patchFile.getAbsolutePath());
                    } else { 
                        Log.d(TAG, "Mounting patch file failed with state = " + state);
                        listener.onObbStateChange(path, state);
                    } 
                } 
            }); 
            if (sm.isObbMounted(patchFile.getAbsolutePath())) {
                patch = sm.getMountedObbPath(patchFile.getAbsolutePath());
                listener.onMountSuccess();
            } 
        } else { 
            Log.d(TAG, "Patch file not found");
        }