diff --git a/Android.mk b/Android.mk
index 967b9df..b1ee244 100644
--- a/Android.mk
+++ b/Android.mk
@@ -79,7 +79,6 @@
     ui.cpp \
     vr_ui.cpp \
     wear_ui.cpp \
-    wear_touch.cpp \
 
 LOCAL_MODULE := recovery
 
@@ -120,6 +119,18 @@
 LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=90
 endif
 
+ifneq ($(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE),)
+LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=$(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE)
+else
+LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=259
+endif
+
+ifneq ($(TARGET_RECOVERY_UI_ANIMATION_FPS),)
+LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=$(TARGET_RECOVERY_UI_ANIMATION_FPS)
+else
+LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=30
+endif
+
 ifneq ($(TARGET_RECOVERY_UI_VR_STEREO_OFFSET),)
 LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=$(TARGET_RECOVERY_UI_VR_STEREO_OFFSET)
 else
@@ -216,6 +227,16 @@
 LOCAL_CFLAGS := -Werror
 include $(BUILD_STATIC_LIBRARY)
 
+# Wear default device
+# ===============================
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := wear_device.cpp
+
+# Should match TARGET_RECOVERY_UI_LIB in BoardConfig.mk.
+LOCAL_MODULE := librecovery_ui_wear
+
+include $(BUILD_STATIC_LIBRARY)
+
 # vr headset default device
 # ===============================
 include $(CLEAR_VARS)
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 8f792f1..c83a765 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -53,6 +53,7 @@
 ScreenRecoveryUI::ScreenRecoveryUI()
     : kMarginWidth(RECOVERY_UI_MARGIN_WIDTH),
       kMarginHeight(RECOVERY_UI_MARGIN_HEIGHT),
+      kAnimationFps(RECOVERY_UI_ANIMATION_FPS),
       density_(static_cast<float>(android::base::GetIntProperty("ro.sf.lcd_density", 160)) / 160.f),
       currentIcon(NONE),
       progressBarType(EMPTY),
@@ -77,7 +78,6 @@
       loop_frames(0),
       current_frame(0),
       intro_done(false),
-      animation_fps(30),  // TODO: there's currently no way to infer this.
       stage(-1),
       max_stage(-1),
       updateMutex(PTHREAD_MUTEX_INITIALIZER) {}
@@ -375,7 +375,7 @@
 }
 
 void ScreenRecoveryUI::ProgressThreadLoop() {
-  double interval = 1.0 / animation_fps;
+  double interval = 1.0 / kAnimationFps;
   while (true) {
     double start = now();
     pthread_mutex_lock(&updateMutex);
diff --git a/screen_ui.h b/screen_ui.h
index 8402fac..1f40164 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -84,6 +84,9 @@
   const int kMarginWidth;
   const int kMarginHeight;
 
+  // Number of frames per sec (default: 30) for both parts of the animation.
+  const int kAnimationFps;
+
   // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi.
   const float density_;
 
@@ -141,9 +144,6 @@
   size_t current_frame;
   bool intro_done;
 
-  // Number of frames per sec (default: 30) for both parts of the animation.
-  int animation_fps;
-
   int stage, max_stage;
 
   int char_width_;
diff --git a/wear_device.cpp b/wear_device.cpp
new file mode 100644
index 0000000..3268130
--- /dev/null
+++ b/wear_device.cpp
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "device.h"
+#include "wear_ui.h"
+
+Device* make_device() {
+  return new Device(new WearRecoveryUI);
+}
+
diff --git a/wear_touch.cpp b/wear_touch.cpp
deleted file mode 100644
index e2ab44d..0000000
--- a/wear_touch.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-
-#include <android-base/logging.h>
-#include <linux/input.h>
-
-#include "wear_touch.h"
-
-#define DEVICE_PATH "/dev/input"
-
-WearSwipeDetector::WearSwipeDetector(int low, int high, OnSwipeCallback callback, void* cookie):
-    mLowThreshold(low),
-    mHighThreshold(high),
-    mCallback(callback),
-    mCookie(cookie),
-    mCurrentSlot(-1) {
-    pthread_create(&mThread, NULL, touch_thread, this);
-}
-
-WearSwipeDetector::~WearSwipeDetector() {
-}
-
-void WearSwipeDetector::detect(int dx, int dy) {
-    enum SwipeDirection direction;
-
-    if (abs(dy) < mLowThreshold && abs(dx) > mHighThreshold) {
-        direction = dx < 0 ? LEFT : RIGHT;
-    } else if (abs(dx) < mLowThreshold && abs(dy) > mHighThreshold) {
-        direction = dy < 0 ? UP : DOWN;
-    } else {
-        LOG(DEBUG) << "Ignore " << dx << " " << dy;
-        return;
-    }
-
-    LOG(DEBUG) << "Swipe direction=" << direction;
-    mCallback(mCookie, direction);
-}
-
-void WearSwipeDetector::process(struct input_event *event) {
-    if (mCurrentSlot < 0) {
-        mCallback(mCookie, UP);
-        mCurrentSlot = 0;
-    }
-
-    if (event->type == EV_ABS) {
-        if (event->code == ABS_MT_SLOT)
-            mCurrentSlot = event->value;
-
-        // Ignore other fingers
-        if (mCurrentSlot > 0) {
-            return;
-        }
-
-        switch (event->code) {
-        case ABS_MT_POSITION_X:
-            mX = event->value;
-            mFingerDown = true;
-            break;
-
-        case ABS_MT_POSITION_Y:
-            mY = event->value;
-            mFingerDown = true;
-            break;
-
-        case ABS_MT_TRACKING_ID:
-            if (event->value < 0)
-                mFingerDown = false;
-            break;
-        }
-    } else if (event->type == EV_SYN) {
-        if (event->code == SYN_REPORT) {
-            if (mFingerDown && !mSwiping) {
-                mStartX = mX;
-                mStartY = mY;
-                mSwiping = true;
-            } else if (!mFingerDown && mSwiping) {
-                mSwiping = false;
-                detect(mX - mStartX, mY - mStartY);
-            }
-        }
-    }
-}
-
-void WearSwipeDetector::run() {
-    int fd = findDevice(DEVICE_PATH);
-    if (fd < 0) {
-        LOG(ERROR) << "no input devices found";
-        return;
-    }
-
-    struct input_event event;
-    while (read(fd, &event, sizeof(event)) == sizeof(event)) {
-        process(&event);
-    }
-
-    close(fd);
-}
-
-void* WearSwipeDetector::touch_thread(void* cookie) {
-    (static_cast<WearSwipeDetector*>(cookie))->run();
-    return NULL;
-}
-
-#define test_bit(bit, array)    ((array)[(bit)/8] & (1<<((bit)%8)))
-
-int WearSwipeDetector::openDevice(const char *device) {
-    int fd = open(device, O_RDONLY);
-    if (fd < 0) {
-        PLOG(ERROR) << "could not open " << device;
-        return false;
-    }
-
-    char name[80];
-    name[sizeof(name) - 1] = '\0';
-    if (ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) < 1) {
-        PLOG(ERROR) << "could not get device name for " << device;
-        name[0] = '\0';
-    }
-
-    uint8_t bits[512];
-    memset(bits, 0, sizeof(bits));
-    int ret = ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(bits)), bits);
-    if (ret > 0) {
-        if (test_bit(ABS_MT_POSITION_X, bits) && test_bit(ABS_MT_POSITION_Y, bits)) {
-            LOG(DEBUG) << "Found " << device << " " << name;
-            return fd;
-        }
-    }
-
-    close(fd);
-    return -1;
-}
-
-int WearSwipeDetector::findDevice(const char* path) {
-    DIR* dir = opendir(path);
-    if (dir == NULL) {
-        PLOG(ERROR) << "Could not open directory " << path;
-        return false;
-    }
-
-    struct dirent* entry;
-    int ret = -1;
-    while (ret < 0 && (entry = readdir(dir)) != NULL) {
-        if (entry->d_name[0] == '.') continue;
-
-        char device[PATH_MAX];
-        device[PATH_MAX-1] = '\0';
-        snprintf(device, PATH_MAX-1, "%s/%s", path, entry->d_name);
-
-        ret = openDevice(device);
-    }
-
-    closedir(dir);
-    return ret;
-}
-
diff --git a/wear_touch.h b/wear_touch.h
deleted file mode 100644
index 9a1d315..0000000
--- a/wear_touch.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __WEAR_TOUCH_H
-#define __WEAR_TOUCH_H
-
-#include <pthread.h>
-
-class WearSwipeDetector {
-
-public:
-    enum SwipeDirection { UP, DOWN, RIGHT, LEFT };
-    typedef void (*OnSwipeCallback)(void* cookie, enum SwipeDirection direction);
-
-    WearSwipeDetector(int low, int high, OnSwipeCallback cb, void* cookie);
-    ~WearSwipeDetector();
-
-private:
-    void run();
-    void process(struct input_event *event);
-    void detect(int dx, int dy);
-
-    pthread_t mThread;
-    static void* touch_thread(void* cookie);
-
-    int findDevice(const char* path);
-    int openDevice(const char* device);
-
-    int mLowThreshold;
-    int mHighThreshold;
-
-    OnSwipeCallback mCallback;
-    void *mCookie;
-
-    int mX;
-    int mY;
-    int mStartX;
-    int mStartY;
-
-    int mCurrentSlot;
-    bool mFingerDown;
-    bool mSwiping;
-};
-
-#endif // __WEAR_TOUCH_H
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 18c30d3..b8801a0 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -51,10 +51,15 @@
 }
 
 WearRecoveryUI::WearRecoveryUI()
-    : progress_bar_y(259), outer_height(0), outer_width(0), menu_unusable_rows(0) {
+    : kProgressBarBaseline(RECOVERY_UI_PROGRESS_BAR_BASELINE), menu_unusable_rows(9) {
+  // TODO: menu_unusable_rows should be computed based on the lines in draw_screen_locked().
+
+  // TODO: The following three variables are likely not needed. The first two are detected
+  // automatically in ScreenRecoveryUI::LoadAnimation(), based on the actual files seen on device.
   intro_frames = 22;
   loop_frames = 60;
-  animation_fps = 30;
+
+  touch_screen_allowed_ = true;
 
   for (size_t i = 0; i < 5; i++) backgroundIcon[i] = NULL;
 
@@ -62,7 +67,7 @@
 }
 
 int WearRecoveryUI::GetProgressBaseline() const {
-  return progress_bar_y;
+  return kProgressBarBaseline;
 }
 
 // Draw background frame on the screen.  Does not flip pages.
@@ -113,8 +118,8 @@
     SetColor(TEXT_FILL);
     gr_fill(0, 0, gr_fb_width(), gr_fb_height());
 
-    int y = outer_height;
-    int x = outer_width;
+    int y = kMarginHeight;
+    int x = kMarginWidth;
     if (show_menu) {
       std::string recovery_fingerprint =
           android::base::GetProperty("ro.bootimage.build.fingerprint", "");
@@ -170,7 +175,7 @@
     int ty;
     int row = (text_top_ + text_rows_ - 1) % text_rows_;
     size_t count = 0;
-    for (int ty = gr_fb_height() - char_height_ - outer_height; ty > y + 2 && count < text_rows_;
+    for (int ty = gr_fb_height() - char_height_ - kMarginHeight; ty > y + 2 && count < text_rows_;
          ty -= char_height_, ++count) {
       gr_text(gr_sys_font(), x + 4, ty, text_[row], 0);
       --row;
@@ -190,12 +195,12 @@
     return false;
   }
 
-  text_cols_ = (gr_fb_width() - (outer_width * 2)) / char_width_;
+  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() - (outer_height * 2)) / char_height_;
+  visible_text_rows = (gr_fb_height() - (kMarginHeight * 2)) / char_height_;
   return true;
 }
 
diff --git a/wear_ui.h b/wear_ui.h
index a814118..c2bbdb6 100644
--- a/wear_ui.h
+++ b/wear_ui.h
@@ -42,10 +42,7 @@
 
  protected:
   // progress bar vertical position, it's centered horizontally
-  int progress_bar_y;
-
-  // outer of window
-  int outer_height, outer_width;
+  const int kProgressBarBaseline;
 
   // Unusable rows when displaying the recovery menu, including the lines for headers (Android
   // Recovery, build id and etc) and the bottom lines that may otherwise go out of the screen.
