aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrashant Malani2016-03-08 15:18:45 -0600
committerPrashant Malani2016-03-08 16:37:49 -0600
commit7d9fd96dc99a6008979811e36bb06f3afad18508 (patch)
tree8f428bb0debeb61b70cfbf5e9b43b58cf5935465 /wear_ui.cpp
parent1731f2980bfadb29105ffd566dd78885889501d8 (diff)
downloadplatform-bootable-recovery-7d9fd96dc99a6008979811e36bb06f3afad18508.tar.gz
platform-bootable-recovery-7d9fd96dc99a6008979811e36bb06f3afad18508.tar.xz
platform-bootable-recovery-7d9fd96dc99a6008979811e36bb06f3afad18508.zip
recovery: Begin refactor of WearUI to use ScreenRecoveryUI
This is the first of a series of changes which move WearUI to subclass ScreenRecoveryUI, to take advantage of several functions which are common between the two recovery UI implementations, and already defined in ScreenRecoveryUI. This patch changes the base class of WearUI, removes redundant header includes, and also removes a common function. Bug: 27407422 Change-Id: I8fd90826900f69272a82e23bd099790e8004d511
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 8a57cfff..65bcd849 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -16,9 +16,7 @@
16 16
17#include <errno.h> 17#include <errno.h>
18#include <fcntl.h> 18#include <fcntl.h>
19#include <pthread.h>
20#include <stdarg.h> 19#include <stdarg.h>
21#include <stdio.h>
22#include <stdlib.h> 20#include <stdlib.h>
23#include <string.h> 21#include <string.h>
24#include <sys/stat.h> 22#include <sys/stat.h>
@@ -31,9 +29,7 @@
31 29
32#include "common.h" 30#include "common.h"
33#include "device.h" 31#include "device.h"
34#include "minui/minui.h"
35#include "wear_ui.h" 32#include "wear_ui.h"
36#include "ui.h"
37#include "cutils/properties.h" 33#include "cutils/properties.h"
38#include "android-base/strings.h" 34#include "android-base/strings.h"
39#include "android-base/stringprintf.h" 35#include "android-base/stringprintf.h"
@@ -370,29 +366,6 @@ void WearRecoveryUI::Init()
370 RecoveryUI::Init(); 366 RecoveryUI::Init();
371} 367}
372 368
373void WearRecoveryUI::SetLocale(const char* locale) {
374 if (locale) {
375 char* lang = strdup(locale);
376 for (char* p = lang; *p; ++p) {
377 if (*p == '_') {
378 *p = '\0';
379 break;
380 }
381 }
382
383 // A bit cheesy: keep an explicit list of supported languages
384 // that are RTL.
385 if (strcmp(lang, "ar") == 0 || // Arabic
386 strcmp(lang, "fa") == 0 || // Persian (Farsi)
387 strcmp(lang, "he") == 0 || // Hebrew (new language code)
388 strcmp(lang, "iw") == 0 || // Hebrew (old language code)
389 strcmp(lang, "ur") == 0) { // Urdu
390 rtl_locale = true;
391 }
392 free(lang);
393 }
394}
395
396void WearRecoveryUI::SetBackground(Icon icon) 369void WearRecoveryUI::SetBackground(Icon icon)
397{ 370{
398 pthread_mutex_lock(&updateMutex); 371 pthread_mutex_lock(&updateMutex);