summaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r--screen_ui.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 95b97d15c..a7b03c50d 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -31,9 +31,10 @@
#include <vector>
+#include <android-base/logging.h>
+#include <android-base/properties.h>
#include <android-base/strings.h>
#include <android-base/stringprintf.h>
-#include <cutils/properties.h>
#include "common.h"
#include "device.h"
@@ -292,8 +293,8 @@ void ScreenRecoveryUI::draw_screen_locked() {
int y = 0;
if (show_menu) {
- char recovery_fingerprint[PROPERTY_VALUE_MAX];
- property_get("ro.bootimage.build.fingerprint", recovery_fingerprint, "");
+ std::string recovery_fingerprint =
+ android::base::GetProperty("ro.bootimage.build.fingerprint", "");
SetColor(INFO);
DrawTextLine(TEXT_INDENT, &y, "Android Recovery", true);
@@ -410,21 +411,21 @@ void ScreenRecoveryUI::ProgressThreadLoop() {
// minimum of 20ms delay between frames
double delay = interval - (end-start);
if (delay < 0.02) delay = 0.02;
- usleep((long)(delay * 1000000));
+ usleep(static_cast<useconds_t>(delay * 1000000));
}
}
void ScreenRecoveryUI::LoadBitmap(const char* filename, GRSurface** surface) {
int result = res_create_display_surface(filename, surface);
if (result < 0) {
- LOGE("couldn't load bitmap %s (error %d)\n", filename, result);
+ LOG(ERROR) << "couldn't load bitmap " << filename << " (error " << result << ")";
}
}
void ScreenRecoveryUI::LoadLocalizedBitmap(const char* filename, GRSurface** surface) {
int result = res_create_localized_alpha_surface(filename, locale, surface);
if (result < 0) {
- LOGE("couldn't load bitmap %s (error %d)\n", filename, result);
+ LOG(ERROR) << "couldn't load bitmap " << filename << " (error " << result << ")";
}
}
@@ -459,7 +460,7 @@ void ScreenRecoveryUI::Init() {
RecoveryUI::Init();
InitTextParams();
- density_ = static_cast<float>(property_get_int32("ro.sf.lcd_density", 160)) / 160.f;
+ density_ = static_cast<float>(android::base::GetIntProperty("ro.sf.lcd_density", 160)) / 160.f;
// Are we portrait or landscape?
layout_ = (gr_fb_width() > gr_fb_height()) ? LANDSCAPE : PORTRAIT;
@@ -675,8 +676,8 @@ void ScreenRecoveryUI::ClearText() {
}
void ScreenRecoveryUI::ShowFile(FILE* fp) {
- std::vector<long> offsets;
- offsets.push_back(ftell(fp));
+ std::vector<off_t> offsets;
+ offsets.push_back(ftello(fp));
ClearText();
struct stat sb;
@@ -686,7 +687,7 @@ void ScreenRecoveryUI::ShowFile(FILE* fp) {
while (true) {
if (show_prompt) {
PrintOnScreenOnly("--(%d%% of %d bytes)--",
- static_cast<int>(100 * (double(ftell(fp)) / double(sb.st_size))),
+ static_cast<int>(100 * (double(ftello(fp)) / double(sb.st_size))),
static_cast<int>(sb.st_size));
Redraw();
while (show_prompt) {
@@ -705,7 +706,7 @@ void ScreenRecoveryUI::ShowFile(FILE* fp) {
if (feof(fp)) {
return;
}
- offsets.push_back(ftell(fp));
+ offsets.push_back(ftello(fp));
}
}
ClearText();