close file in PersistentDataBlockService jni

The opened file should be closed.

Change-Id: I8a43b338c5c9eb0a5b1b5329eec767c6395bc7eb
Signed-off-by: Lianwei Wang <lianwei.wang@gmail.com>
diff --git a/services/core/jni/com_android_server_PersistentDataBlockService.cpp b/services/core/jni/com_android_server_PersistentDataBlockService.cpp
index 06de592..f94e5d9 100644
--- a/services/core/jni/com_android_server_PersistentDataBlockService.cpp
+++ b/services/core/jni/com_android_server_PersistentDataBlockService.cpp
@@ -84,7 +84,11 @@
         if (fd < 0)
             return 0;
 
-        return get_block_device_size(fd);
+        const uint64_t size = get_block_device_size(fd);
+
+        close(fd);
+
+        return size;
     }
 
     static int com_android_server_PersistentDataBlockService_wipe(JNIEnv *env, jclass, jstring jpath) {
@@ -94,7 +98,11 @@
         if (fd < 0)
             return 0;
 
-        return wipe_block_device(fd);
+        const int ret = wipe_block_device(fd);
+
+        close(fd);
+
+        return ret;
     }
 
     static const JNINativeMethod sMethods[] = {