Revert "Revert "Some cleanups to recovery.""

This reverts commit 8584fcf677dd45b30121bd0490b06297e6be1871.

This CL re-lands commit c0319b60f56d445c2d1c74f551e01f069b028fe6.
The "stage" and "reason" variables are now declared as global by
dropping the static qualifier, because they may be used by vendor
recovery libraries.

Test: lunch aosp_angler-userdebug; mmma bootable/recovery
Test: lunch aosp_dragon-userdebug; mmma bootable/recovery

Change-Id: I252c346f450079478cff22bbff01590b8ab2e2b3
diff --git a/common.h b/common.h
index a948fb1..319af3d 100644
--- a/common.h
+++ b/common.h
@@ -17,15 +17,22 @@
-#include <stdbool.h>
 #include <stdio.h>
 #include <stdarg.h>
 #define STRINGIFY(x) #x
 #define EXPAND(x) STRINGIFY(x)
+class RecoveryUI;
+extern RecoveryUI* ui;
 extern bool modified_flash;
-typedef struct fstab_rec Volume;
+// The current stage, e.g. "1/2".
+extern const char* stage;
+// The reason argument provided in "--reason=".
+extern const char* reason;
 // fopen a file, mounting volumes and making parent dirs as necessary.
 FILE* fopen_path(const char *path, const char *mode);