screen_ui: Drop the dependency on common.h.

Remove the use of fopen_path() in screen_ui.cpp, as this is the only
place that requires the dependency on common.h. The mounting work should
be done by the caller.

Also change the parameter in RecoveryUI::ShowFile() from const char* to
const std::string&.

Test: mmma -j bootable/recovery
Test: Build and boot into recovery image on angler. Choose 'View
      recovery logs'.
Change-Id: I8e63f14a8e2b12b856e5a92476e4226cd6ea39fb
diff --git a/screen_ui.cpp b/screen_ui.cpp
index aaeb18c..00ed45d 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -42,7 +42,6 @@
 #include <android-base/strings.h>
 #include <minui/minui.h>
 
-#include "common.h"
 #include "device.h"
 #include "ui.h"
 
@@ -951,10 +950,10 @@
   }
 }
 
-void ScreenRecoveryUI::ShowFile(const char* filename) {
-  FILE* fp = fopen_path(filename, "re");
-  if (fp == nullptr) {
-    Print("  Unable to open %s: %s\n", filename, strerror(errno));
+void ScreenRecoveryUI::ShowFile(const std::string& filename) {
+  std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(filename.c_str(), "re"), fclose);
+  if (!fp) {
+    Print("  Unable to open %s: %s\n", filename.c_str(), strerror(errno));
     return;
   }
 
@@ -966,8 +965,7 @@
   text_ = file_viewer_text_;
   ClearText();
 
-  ShowFile(fp);
-  fclose(fp);
+  ShowFile(fp.get());
 
   text_ = old_text;
   text_col_ = old_text_col;