public static void performUnmount() { if (ObbExpansionsManager.getInstance() == null) { return; } AliteLog.d("Performing Unmount", "Unmounting obb"); ObbExpansionsManager.destroyInstance(new OnObbStateChangeListener() { public void onObbStateChange(String path, int state) { super.onObbStateChange(path, state); switch (state) { case MOUNTED: AliteLog.e("Obb UNmount callback", "New OBB state is mounted! Fishy..."); break; case UNMOUNTED: AliteLog.d("Obb UNmount callback", "OBB unmounted successfully."); break; case ERROR_INTERNAL: AliteLog.e("Obb UNmount callback", "Internal Error"); break; case ERROR_COULD_NOT_MOUNT: AliteLog.e("Obb UNmount callback", "Could not mount"); break; case ERROR_COULD_NOT_UNMOUNT: AliteLog.e("Obb UNmount callback", "Could not unmount"); break; case ERROR_NOT_MOUNTED: AliteLog.e("Obb UNmount callback", "OBB was not mounted"); break; case ERROR_ALREADY_MOUNTED: AliteLog.e("Obb UNmount callback", "OBB already mounted"); break; case ERROR_PERMISSION_DENIED: AliteLog.e("Obb UNmount callback", "Permission denied"); break; } } }); }
@Override public void onObbStateChange(String path, int state) { Log.d(TAG, "path=" + path + "; state=" + state); mStatus.setText(String.valueOf(state)); if (state == OnObbStateChangeListener.MOUNTED) { mPath.setText(mSM.getMountedObbPath(mObbPath)); } else { mPath.setText(""); } }
private void unmountMain(OnObbStateChangeListener listener) { sm.unmountObb(mainFile.getAbsolutePath(), true, listener); }
public static void destroyInstance(OnObbStateChangeListener listener) { instance.unmountMain(listener); instance = null; }