summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-11-19 18:51:42 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-19 18:51:42 -0800
commitd465bc877e66774c93da626db4879dc93c514318 (patch)
tree3ae6503fc9175f0d184e037e2b8060bd0f083be5
parent39b3db4f264fa5a1108ac2ab7986193daf2f3a70 (diff)
parent3f534c27706a15c5b6c80ffd6ee44d169a529fd7 (diff)
downloadandroid_packages_apps_BluetoothExt-d465bc877e66774c93da626db4879dc93c514318.tar.gz
android_packages_apps_BluetoothExt-d465bc877e66774c93da626db4879dc93c514318.tar.bz2
android_packages_apps_BluetoothExt-d465bc877e66774c93da626db4879dc93c514318.zip
Merge "FTP: Fix klockwork reported issues."
-rw-r--r--src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java8
-rw-r--r--src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java2
-rw-r--r--src/org/codeaurora/bluetooth/ftp/FileUtils.java3
3 files changed, 7 insertions, 6 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java
index 78a7483..b602eec 100644
--- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java
+++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java
@@ -767,7 +767,7 @@ public class BluetoothFtpObexServer extends ServerRequestHandler {
*
* Else call the routine to send the requested file names contents
*/
- if(type.equals(TYPE_LISTING)){
+ if(type.equals(TYPE_LISTING)) {
if(!validName || ( mCurrentPath!= null && ( mCurrentPath.equals(rootPrimaryStoragePath) ||
mCurrentPath.equals(rootSecondaryStoragePath)) ) ) {
if (D) Log.d(TAG,"Not having a name ");
@@ -790,7 +790,7 @@ public class BluetoothFtpObexServer extends ServerRequestHandler {
}
} else {
if (D) Log.d(TAG,"Non Root Folder");
- if(type.equals(TYPE_LISTING)){
+ if(type.equals(TYPE_LISTING) && mCurrentPath != null) {
File currentfolder = new File(mCurrentPath);
if (D) Log.d(TAG,"Current folder name = " +
currentfolder.getName() +
@@ -876,6 +876,10 @@ public class BluetoothFtpObexServer extends ServerRequestHandler {
outputStream = op.openOutputStream();
} catch(IOException e) {
Log.e(TAG,"SendFilecontents open stream "+ e.toString());
+ if(outputStream != null ) {
+ closeStream(outputStream, op);
+ outputStream = null;
+ }
return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
} finally {
if (fileInputStream != null && outputStream == null) {
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
index cd2f583..5daa67e 100644
--- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
+++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
@@ -366,7 +366,7 @@ public class BluetoothFtpService extends Service {
removeTimeoutMsg = false;
}
- if (removeTimeoutMsg) {
+ if (removeTimeoutMsg && mSessionStatusHandler != null) {
mSessionStatusHandler.removeMessages(MSG_INTERNAL_USER_TIMEOUT);
}
}
diff --git a/src/org/codeaurora/bluetooth/ftp/FileUtils.java b/src/org/codeaurora/bluetooth/ftp/FileUtils.java
index 03b5b31..fb598d2 100644
--- a/src/org/codeaurora/bluetooth/ftp/FileUtils.java
+++ b/src/org/codeaurora/bluetooth/ftp/FileUtils.java
@@ -159,9 +159,6 @@ public class FileUtils {
} catch(FileNotFoundException e) {
Log.e(TAG,"copyFile file not found "+ e.toString());
return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
- } catch(IOException e) {
- Log.e(TAG,"copyFile open stream failed "+ e.toString());
- return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
} finally {
if (null != reader && null == writer) {
try {