release-request-d9d65d1a-80f5-45e5-a00f-5a3915c3d445-for-git_pi-release-4303984 snap-temp-L75600000097489288

Change-Id: Ifa0985c357a8e238d049516a1a13d8faabc4aee5
diff --git a/Android.mk b/Android.mk
index 776e6ea..aaae6a0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -159,6 +159,7 @@
     libmounts \
     libz \
     libminadbd \
+    libasyncio \
     libfusesideload \
     libminui \
     libpng \
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 169ef20..e480671 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <pthread.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,11 +39,6 @@
 #include "common.h"
 #include "device.h"
 
-// There's only (at most) one of these objects, and global callbacks
-// (for pthread_create, and the input event system) need to find it,
-// so use a global variable.
-static WearRecoveryUI* self = NULL;
-
 // Return the current time as a double (including fractions of a second).
 static double now() {
   struct timeval tv;
@@ -63,8 +59,6 @@
   touch_screen_allowed_ = true;
 
   for (size_t i = 0; i < 5; i++) backgroundIcon[i] = NULL;
-
-  self = this;
 }
 
 int WearRecoveryUI::GetProgressBaseline() const {
@@ -191,20 +185,6 @@
   gr_flip();
 }
 
-bool WearRecoveryUI::InitTextParams() {
-  if (!ScreenRecoveryUI::InitTextParams()) {
-    return false;
-  }
-
-  text_cols_ = (gr_fb_width() - (kMarginWidth * 2)) / char_width_;
-
-  if (text_rows_ > kMaxRows) text_rows_ = kMaxRows;
-  if (text_cols_ > kMaxCols) text_cols_ = kMaxCols;
-
-  visible_text_rows = (gr_fb_height() - (kMarginHeight * 2)) / char_height_;
-  return true;
-}
-
 bool WearRecoveryUI::Init(const std::string& locale) {
   if (!ScreenRecoveryUI::Init(locale)) {
     return false;
@@ -269,7 +249,7 @@
     show_menu = true;
     menu_sel = initial_selection;
     menu_start = 0;
-    menu_end = visible_text_rows - 1 - kMenuUnusableRows;
+    menu_end = text_rows_ - 1 - kMenuUnusableRows;
     if (menu_items <= menu_end) menu_end = menu_items;
     update_screen_locked();
   }
diff --git a/wear_ui.h b/wear_ui.h
index 3bd90b6..9731f41 100644
--- a/wear_ui.h
+++ b/wear_ui.h
@@ -50,8 +50,6 @@
 
   int GetProgressBaseline() const override;
 
-  bool InitTextParams() override;
-
   void update_progress_locked() override;
 
   void PrintV(const char*, bool, va_list) override;
@@ -59,17 +57,8 @@
  private:
   GRSurface* backgroundIcon[5];
 
-  static const int kMaxCols = 96;
-  static const int kMaxRows = 96;
-
-  // Number of text rows seen on screen
-  int visible_text_rows;
-
-  const char* const* menu_headers_;
   int menu_start, menu_end;
 
-  pthread_t progress_t;
-
   void draw_background_locked() override;
   void draw_screen_locked() override;