summaryrefslogtreecommitdiffstats
path: root/native/android
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-12-13 11:58:55 -0800
committerKenny Root <kroot@google.com>2010-12-13 12:02:19 -0800
commit06ea4d65e81123832d2ae547538d612b0e6b90fa (patch)
treea120b2dee9218ebc5814dc3bbe58d46b29a6b45c /native/android
parent14b0a6bc0ec8814291751b2b8e80da606cfa12b3 (diff)
downloadframeworks_base-06ea4d65e81123832d2ae547538d612b0e6b90fa.zip
frameworks_base-06ea4d65e81123832d2ae547538d612b0e6b90fa.tar.gz
frameworks_base-06ea4d65e81123832d2ae547538d612b0e6b90fa.tar.bz2
Introduce NDK API for 64-bit assets
Assets were switched to using 64-bit all through the system, so switch the NDK to using this new API as well. Change-Id: I2817b11369db3a4dd504b839ef1a3a9780b83533
Diffstat (limited to 'native/android')
-rw-r--r--native/android/asset_manager.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/native/android/asset_manager.cpp b/native/android/asset_manager.cpp
index 33f088d..f5db57c 100644
--- a/native/android/asset_manager.cpp
+++ b/native/android/asset_manager.cpp
@@ -178,6 +178,11 @@ off_t AAsset_seek(AAsset* asset, off_t offset, int whence)
return asset->mAsset->seek(offset, whence);
}
+off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence)
+{
+ return asset->mAsset->seek(offset, whence);
+}
+
void AAsset_close(AAsset* asset)
{
asset->mAsset->close();
@@ -194,14 +199,35 @@ off_t AAsset_getLength(AAsset* asset)
return asset->mAsset->getLength();
}
+off64_t AAsset_getLength64(AAsset* asset)
+{
+ return asset->mAsset->getLength();
+}
+
off_t AAsset_getRemainingLength(AAsset* asset)
{
return asset->mAsset->getRemainingLength();
}
+off64_t AAsset_getRemainingLength64(AAsset* asset)
+{
+ return asset->mAsset->getRemainingLength();
+}
+
int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength)
{
- return asset->mAsset->openFileDescriptor((off64_t*)outStart, (off64_t*)outLength);
+ off64_t outStart64, outLength64;
+
+ int ret = asset->mAsset->openFileDescriptor(&outStart64, &outLength64);
+
+ *outStart = off_t(outStart64);
+ *outLength = off_t(outLength64);
+ return ret;
+}
+
+int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength)
+{
+ return asset->mAsset->openFileDescriptor(outStart, outLength);
}
int AAsset_isAllocated(AAsset* asset)