android.os.storage.OnObbStateChangeListener Java Examples

The following examples show how to use android.os.storage.OnObbStateChangeListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AliteFiles.java    From Alite with GNU General Public License v3.0 6 votes vote down vote up
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;        
       }
    }
   });
}
 
Example #2
Source File: ObbExpansionsManager.java    From Alite with GNU General Public License v3.0 4 votes vote down vote up
private void unmountMain(OnObbStateChangeListener listener) {
    sm.unmountObb(mainFile.getAbsolutePath(), true, listener);        
}
 
Example #3
Source File: ObbExpansionsManager.java    From Alite with GNU General Public License v3.0 4 votes vote down vote up
public static void destroyInstance(OnObbStateChangeListener listener) {
    instance.unmountMain(listener);
    instance = null;
}