OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_ANDROID_BUILD_INFO_H_ |
| 6 #define BASE_ANDROID_BUILD_INFO_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 #include <string> |
| 10 |
| 11 namespace base { |
| 12 namespace android { |
| 13 |
| 14 |
| 15 // BuildInfo is a singleton class that stores android build and device |
| 16 // information. |
| 17 class BuildInfo { |
| 18 public: |
| 19 |
| 20 // Static factory method for getting the singleton BuildInfo instance. |
| 21 static const BuildInfo* const GetInstance(); |
| 22 |
| 23 ~BuildInfo() {}; |
| 24 |
| 25 // We use const char* instead of std::strings because we need to have these |
| 26 // values available even if the process is in a crash state. Sadly |
| 27 // std::string.c_str() doesn't guarantee that memory won't be allocated when |
| 28 // it is called. |
| 29 const char* device; |
| 30 const char* model; |
| 31 const char* brand; |
| 32 const char* android_build_id; |
| 33 const char* android_build_fp; |
| 34 const char* package_version_code; |
| 35 const char* package_version_name; |
| 36 |
| 37 private: |
| 38 static BuildInfo* instance_; |
| 39 |
| 40 BuildInfo( |
| 41 const char* device, |
| 42 const char* model, |
| 43 const char* brand, |
| 44 const char* android_build_id, |
| 45 const char* android_build_fp, |
| 46 const char* package_version_code, |
| 47 const char* package_version_name); |
| 48 |
| 49 }; |
| 50 |
| 51 bool RegisterBuildInfo(JNIEnv* env); |
| 52 |
| 53 } // namespace android |
| 54 } // namespace base |
| 55 |
| 56 |
| 57 #endif // BASE_ANDROID_BUILD_INFO_H_ |
OLD | NEW |