mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
fix NPE (and unnecessary auto-boxing)
This commit is contained in:
parent
63b52c1d92
commit
15a2439769
1 changed files with 11 additions and 18 deletions
|
@ -94,11 +94,9 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
if(savedInstanceState != null) {
|
if(savedInstanceState != null) {
|
||||||
mCurrentDir = new File(savedInstanceState.getString(
|
mCurrentDir = new File(savedInstanceState.getString(UploadFilesActivity.KEY_DIRECTORY_PATH, Environment
|
||||||
UploadFilesActivity.KEY_DIRECTORY_PATH));
|
.getExternalStorageDirectory().getAbsolutePath()));
|
||||||
mSelectAll = savedInstanceState.getBoolean(
|
mSelectAll = savedInstanceState.getBoolean(UploadFilesActivity.KEY_ALL_SELECTED, false);
|
||||||
UploadFilesActivity.KEY_ALL_SELECTED, false);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mCurrentDir = Environment.getExternalStorageDirectory();
|
mCurrentDir = Environment.getExternalStorageDirectory();
|
||||||
}
|
}
|
||||||
|
@ -355,7 +353,6 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -372,7 +369,6 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
return mCurrentDir;
|
return mCurrentDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs corresponding action when user presses 'Cancel' or 'Upload' button
|
* Performs corresponding action when user presses 'Cancel' or 'Upload' button
|
||||||
*
|
*
|
||||||
|
@ -390,7 +386,6 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asynchronous task checking if there is space enough to copy all the files chosen
|
* Asynchronous task checking if there is space enough to copy all the files chosen
|
||||||
* to upload into the ownCloud local folder.
|
* to upload into the ownCloud local folder.
|
||||||
|
@ -409,7 +404,6 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
mCurrentDialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);
|
mCurrentDialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks the available space
|
* Checks the available space
|
||||||
*
|
*
|
||||||
|
@ -424,7 +418,7 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
File localFile = new File(localPath);
|
File localFile = new File(localPath);
|
||||||
total += localFile.length();
|
total += localFile.length();
|
||||||
}
|
}
|
||||||
return (new Boolean(FileStorageUtils.getUsableSpace(mAccountOnCreation.name) >= total));
|
return FileStorageUtils.getUsableSpace(mAccountOnCreation.name) >= total;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -437,8 +431,10 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Boolean result) {
|
protected void onPostExecute(Boolean result) {
|
||||||
|
if(mCurrentDialog != null) {
|
||||||
mCurrentDialog.dismiss();
|
mCurrentDialog.dismiss();
|
||||||
mCurrentDialog = null;
|
mCurrentDialog = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
// return the list of selected files (success)
|
// return the list of selected files (success)
|
||||||
|
@ -480,20 +476,17 @@ public class UploadFilesActivity extends FileActivity implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeutral(String callerTag) {
|
public void onNeutral(String callerTag) {
|
||||||
Log_OC.d(TAG, "Phantom neutral button in dialog was clicked; dialog tag is " + callerTag);
|
Log_OC.d(TAG, "Phantom neutral button in dialog was clicked; dialog tag is " + callerTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCancel(String callerTag) {
|
public void onCancel(String callerTag) {
|
||||||
/// nothing to do; don't finish, let the user change the selection
|
/// nothing to do; don't finish, let the user change the selection
|
||||||
Log_OC.d(TAG, "Negative button in dialog was clicked; dialog tag is " + callerTag);
|
Log_OC.d(TAG, "Negative button in dialog was clicked; dialog tag is " + callerTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onAccountSet(boolean stateWasRecovered) {
|
protected void onAccountSet(boolean stateWasRecovered) {
|
||||||
super.onAccountSet(stateWasRecovered);
|
super.onAccountSet(stateWasRecovered);
|
||||||
|
|
Loading…
Reference in a new issue