6

I want to mount .obb file from external storage. I wrote these codes.

storageManager.mountObb(obbPath, key, new OnObbStateChangeListener() {
    @Override
    public void onObbStateChange(String path, int state) {
        switch (state) {
            case ERROR_ALREADY_MOUNTED:
                storageManager.unmountObb(rawPath, true, this);
                break;
            case UNMOUNTED:
                storageManager.mountObb(rawPath, key, this);
                break;
            case MOUNTED:
                File mountedDir = new File(storageManager.getMountedObbPath(path));
                // do something with mountedDir
                break;
            case ERROR_COULD_NOT_MOUNT:
            case ERROR_INTERNAL:
            case ERROR_PERMISSION_DENIED:
                // Error occurred!!
                break;
        }
    }
});

Now I execute this, my OnObbStateChangeListener gets state = ERROR_INTERNAL (20).

What is this error code? How to fix this?


Addition: I found this post: What causes jobb tool to throw FAT Full IOException? Probably this is an answer. My obb file is broken.

thank you.

Community
  • 1
  • 1
Yuya Matsuo
  • 258
  • 1
  • 5
  • 11
  • http://developer.android.com/reference/android/os/storage/OnObbStateChangeListener.html#ERROR_INTERNAL – firelynx Jul 28 '15 at 08:22
  • A link to the documentation is not very useful here. What are possible " internal system error" 's? Why do they occur? – daemmie Jul 28 '15 at 08:26
  • I'm experiencing this exact same issue, and this question is the only related source of info I can find. Did you ever find a solution for what the potential causes are? – ez4nick Jun 17 '16 at 21:52

1 Answers1

-1

It looks like this constant is set in the MountService class (package com.android.server). You can take a look at the source code here : http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.1_r1/com/android/server/MountService.java but as you can see, there are various reasons for setting the state at ERROR_INTERNAL

Nicolas Mauti
  • 506
  • 3
  • 13