| Index: runtime/embedders/android/resource.h
|
| diff --git a/samples/android_sample/jni/resource.h b/runtime/embedders/android/resource.h
|
| similarity index 82%
|
| rename from samples/android_sample/jni/resource.h
|
| rename to runtime/embedders/android/resource.h
|
| index eeec42410a824d55d81c31295f65e46285d29074..6e440d329ad79b86fcb530dd8591205a79e229f1 100644
|
| --- a/samples/android_sample/jni/resource.h
|
| +++ b/runtime/embedders/android/resource.h
|
| @@ -2,12 +2,12 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -#ifndef RESOURCE_H
|
| -#define RESOURCE_H
|
| +#ifndef EMBEDDERS_ANDROID_RESOURCE_H_
|
| +#define EMBEDDERS_ANDROID_RESOURCE_H_
|
|
|
| #include <android_native_app_glue.h>
|
|
|
| -#include "jni/log.h"
|
| +#include "embedders/android/log.h"
|
|
|
| class Resource {
|
| public:
|
| @@ -41,7 +41,8 @@ class Resource {
|
| if (asset_ != NULL) {
|
| descriptor_ = AAsset_openFileDescriptor(asset_, &start_, &length_);
|
| LOGI("%s has start %d, length %d, fd %d",
|
| - path_, start_, length_, descriptor_);
|
| + path_, static_cast<int>(start_),
|
| + static_cast<int>(length_), descriptor_);
|
| return 0;
|
| }
|
| return -1;
|
| @@ -55,17 +56,17 @@ class Resource {
|
| }
|
|
|
| int32_t read(void* buffer, size_t count) {
|
| - int32_t actual = AAsset_read(asset_, buffer, count);
|
| + size_t actual = AAsset_read(asset_, buffer, count);
|
| return (actual == count) ? 0 : -1;
|
| }
|
|
|
| private:
|
| - const char* path_;
|
| AAssetManager* asset_manager_;
|
| + const char* path_;
|
| AAsset* asset_;
|
| int32_t descriptor_;
|
| off_t start_;
|
| off_t length_;
|
| };
|
|
|
| -#endif
|
| +#endif // EMBEDDERS_ANDROID_RESOURCE_H_
|
|
|