Chromium Code Reviews| Index: base/android/build_info.h |
| diff --git a/base/android/build_info.h b/base/android/build_info.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a10f4e02f70b48bc04df3b4d492dbcb6cf282461 |
| --- /dev/null |
| +++ b/base/android/build_info.h |
| @@ -0,0 +1,57 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
|
Yaron
2012/04/03 23:54:20
2012 (throughout your change)
carlosvaldivia
2012/04/04 20:52:34
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_ANDROID_BUILD_INFO_H_ |
| +#define BASE_ANDROID_BUILD_INFO_H_ |
| + |
| +#include <jni.h> |
| +#include <string> |
| + |
| +namespace base { |
| +namespace android { |
| + |
| + |
| +// BuildInfo is a singleton class that stores android build and device |
| +// information. |
| +class BuildInfo { |
| + public: |
| + |
| + // Static factory method for getting the singleton BuildInfo instance. |
| + static const BuildInfo* const GetInstance(); |
| + |
| + ~BuildInfo() {}; |
| + |
| + // We use const char* instead of std::strings because we need to have these |
| + // values available even if the process is in a crash state. Sadly |
| + // std::string.c_str() doesn't guarantee that memory won't be allocated when |
| + // it is called. |
| + const char* device; |
| + const char* model; |
| + const char* brand; |
| + const char* android_build_id; |
| + const char* android_build_fp; |
| + const char* package_version_code; |
| + const char* package_version_name; |
| + |
| + private: |
| + static BuildInfo* instance_; |
| + |
| + BuildInfo( |
| + const char* device, |
| + const char* model, |
| + const char* brand, |
| + const char* android_build_id, |
| + const char* android_build_fp, |
| + const char* package_version_code, |
| + const char* package_version_name); |
| + |
| +}; |
| + |
| +bool RegisterBuildInfo(JNIEnv* env); |
| + |
| +} // namespace android |
| +} // namespace base |
| + |
| + |
| +#endif // BASE_ANDROID_BUILD_INFO_H_ |