android/src/com/mapswithme/maps/settings/StoragePathManager.java
public void checkExternalStoragePathOnKitkat(Context context, MoveFilesListener listener)
  {
    if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT)
      return;

    final String settingsDir = Framework.nativeGetSettingsDir();
    final String writableDir = Framework.nativeGetWritableDir();

    if (settingsDir.equals(writableDir) || StorageUtils.isDirWritable(writableDir))
      return;

    final long size = StorageUtils.getWritableDirSize();
    updateExternalStorages();
    for (StorageItem item : mItems)
    {
      if (item.mFreeSize > size)
      {
        setStoragePath(context, listener, item, new StorageItem(StorageUtils.getWritableDirRoot(), 0),
                       R.string.kitkat_optimization_in_progress);
        return;
      }
    }

    listener.moveFilesFailed(UNKNOWN_KITKAT_ERROR);
  }
/**
   * Checks whether current directory is actually writable on Kitkat devices. On earlier versions of android ( < 4.4 ) the root of external
   * storages was writable, but on Kitkat it isn't, so we should move our maps to other directory.
   * http://www.doubleencore.com/2014/03/android-external-storage/ check that link for explanations
   */
Checks whether current directory is actually writable on Kitkat devices. On earlier versions of android ( < 4.4 ) the root of external
storages was writable, but on Kitkat it isn't, so we should move our maps to other directory.
Checks whether current directory is actually writable on Kitkat devices . On earlier versions of android ( < 4 . 4 ) the root of external storages was writable but on Kitkat it isn ' t so we should move our maps to other directory .
public void checkExternalStoragePathOnKitkat(Context context, MoveFilesListener listener)
  {
    if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT)
      return;
    final String settingsDir = Framework.nativeGetSettingsDir();
    final String writableDir = Framework.nativeGetWritableDir();
    if (settingsDir.equals(writableDir) || StorageUtils.isDirWritable(writableDir))
      return;
    final long size = StorageUtils.getWritableDirSize();
    updateExternalStorages();
    for (StorageItem item : mItems)
    {
      if (item.mFreeSize > size)
      {
        setStoragePath(context, listener, item, new StorageItem(StorageUtils.getWritableDirRoot(), 0),
                       R.string.kitkat_optimization_in_progress);
        return;
      }
    }
    listener.moveFilesFailed(UNKNOWN_KITKAT_ERROR);
  }
public void checkExternalStoragePathOnKitkat ( Context context , MoveFilesListener listener ) { if ( Build . VERSION . SDK_INT < android . os . Build . VERSION_CODES . KITKAT ) return ; final String settingsDir = Framework . nativeGetSettingsDir ( ) ; final String writableDir = Framework . nativeGetWritableDir ( ) ; if ( settingsDir . equals ( writableDir ) || StorageUtils . isDirWritable ( writableDir ) ) return ; final long size = StorageUtils . getWritableDirSize ( ) ; updateExternalStorages ( ) ; for ( StorageItem item : mItems ) { if ( item . mFreeSize > size ) { setStoragePath ( context , listener , item , new StorageItem ( StorageUtils . getWritableDirRoot ( ) , 0 ) , R . string . kitkat_optimization_in_progress ) ; return ; } } listener . moveFilesFailed ( UNKNOWN_KITKAT_ERROR ) ; }
Checks whether current directory is actually writable on Kitkat devices.
Checks whether current directory is actually writable on Kitkat devices .