9 Commits

Author SHA1 Message Date
Daichi Hirono
b36b15586a Fix bugs that prevent from using AppFuse.
* Allow buffer size that is greater than requested read size in JNI,
   because we reuse fixed-size buffer among multiple requests.
 * Fix condition to check if the file size is greater than 4GB or
   not. We need to use 0xffffffffl instead of 0xffffffff because
   0xffffffff is int and its value is -1.

BUG=None
Change-Id: I155916e139353b15dc1ab535234faf50d942996d
2016-01-26 16:30:08 +09:00
Daichi Hirono
af6b66529e Ensure to release local reference in AppFuse JNI.
Previously get_object_bytes() leaked local reference of Java buffer
array.

BUG=None

Change-Id: Ic27e57281f984fee4aa285ad21de522ccb0fe4ed
2016-01-21 11:07:48 +09:00
Daichi Hirono
e6054c0ff0 Fix race in AppFuseTest.
Previously IllegalStateException is thrown in app fuse main loop, if the
loop thread starts just after closing device FD.

BUG=None

Change-Id: Ia5232857d29f9f324446aa38acf3c062f359d406
2016-01-21 10:51:25 +09:00
Daichi Hirono
fab4a97a79 Fix compile error introduced by ag/842950.
BUG=25756419

Change-Id: I8ac270946b3915c02b21a07cf0a9c5b62d69effc
2016-01-15 16:54:24 +09:00
Daichi Hirono
2153e822ee Fix AppFuse JNI.
* Return attributes for all files as well as root.
 * Fix buffer size for reading and add a check for reading size.

BUG=25756419

Change-Id: I572f718bc01d96616ec94f85d800b8b57eedd2ea
2016-01-15 13:45:47 +09:00
Daichi Hirono
cc9a7d78d5 Implement FUSE operations in AppFuse JNI.
The CL adds the following operations.

 * FUSE_LOOKUP
 * FUSE_OPEN
 * FUSE_READ
 * FUSE_RELEASE
 * FUSE_FLUSH

BUG=25756145

Change-Id: Ib57d7d0ade3343a604a1c40e4b2c2a2d089f3715
2015-12-24 11:11:27 +09:00
Daichi Hirono
91e3b50636 Unmount appfuse when the device FD is closed.
The CL lets MountService to observe device FD, and request unmount to
vold when the device FD was closed, or remote application providing
appfuse is crashed.

BUG=25756420

Change-Id: I7990694d32affa7f89e3f40badb25098d74d744d
2015-12-22 13:41:33 +09:00
Daichi Hirono
01cf378e04 Fix compiler error on com_android_mtp_AppFuse.cpp.
The CL adds explicit assigning for reply_size to prevent 'unused'
compiler error.

Change-Id: I307758debb23b5bf56ddf71d54813b8cd81d8f49
2015-12-21 13:13:57 +09:00
Daichi Hirono
bee50c0543 Add AppFuse class and its JNI module.
BUG=25756145

Change-Id: I10597e3377cf860412e006a118cd979b6f108af3
2015-12-21 12:07:13 +09:00