Java 类android.os.storage.OnObbStateChangeListener 实例源码

项目:Alite    文件:AliteFiles.java   
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;        
       }
    }
   });
}
项目:buildAPKsSamples    文件:ObbMountActivity.java   
@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("");
    }
}
项目:Alite    文件:ObbExpansionsManager.java   
private void unmountMain(OnObbStateChangeListener listener) {
    sm.unmountObb(mainFile.getAbsolutePath(), true, listener);        
}
项目:Alite    文件:ObbExpansionsManager.java   
public static void destroyInstance(OnObbStateChangeListener listener) {
    instance.unmountMain(listener);
    instance = null;
}