change recovery images to android with spinner

Also make writing the locale a bit more robust.

Change-Id: I803dd0aa0b9d6661fad74ea13fb085682402323c
diff --git a/recovery.cpp b/recovery.cpp
index e374c7d..70817d3 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -277,6 +277,18 @@
         }
     }
 
+    // Save the locale to cache, so if recovery is next started up
+    // without a --locale argument (eg, directly from the bootloader)
+    // it will use the last-known locale.
+    if (locale != NULL) {
+        LOGI("Saving locale \"%s\"\n", locale);
+        FILE* fp = fopen_path(LOCALE_FILE, "w");
+        fwrite(locale, 1, strlen(locale), fp);
+        fflush(fp);
+        fsync(fileno(fp));
+        check_and_fclose(fp, LOCALE_FILE);
+    }
+
     // Copy logs to cache so the system can find out what happened.
     copy_log_file(TEMPORARY_LOG_FILE, LOG_FILE, true);
     copy_log_file(TEMPORARY_LOG_FILE, LAST_LOG_FILE, false);
@@ -286,15 +298,6 @@
     chmod(LAST_LOG_FILE, 0640);
     chmod(LAST_INSTALL_FILE, 0644);
 
-    // Save the locale to cache, so if recovery is next started up
-    // without a --locale argument (eg, directly from the bootloader)
-    // it will use the last-known locale.
-    if (locale != NULL) {
-        FILE* fp = fopen(LOCALE_FILE, "w");
-        fwrite(locale, 1, strlen(locale), fp);
-        fclose(fp);
-    }
-
     // Reset to normal system boot so recovery won't cycle indefinitely.
     struct bootloader_message boot;
     memset(&boot, 0, sizeof(boot));
diff --git a/res/images/icon_error.png b/res/images/icon_error.png
index cb3d1ab..7000d4d 100644
--- a/res/images/icon_error.png
+++ b/res/images/icon_error.png
Binary files differ
diff --git a/res/images/icon_installing.png b/res/images/icon_installing.png
index 571eb8b..ad79277 100644
--- a/res/images/icon_installing.png
+++ b/res/images/icon_installing.png
Binary files differ
diff --git a/res/images/icon_installing_overlay01.png b/res/images/icon_installing_overlay01.png
index e762d6c..c9f6125 100644
--- a/res/images/icon_installing_overlay01.png
+++ b/res/images/icon_installing_overlay01.png
Binary files differ
diff --git a/res/images/icon_installing_overlay02.png b/res/images/icon_installing_overlay02.png
index f7a8530..c87e5fa 100644
--- a/res/images/icon_installing_overlay02.png
+++ b/res/images/icon_installing_overlay02.png
Binary files differ
diff --git a/res/images/icon_installing_overlay03.png b/res/images/icon_installing_overlay03.png
index 1a1d738..30e9580 100644
--- a/res/images/icon_installing_overlay03.png
+++ b/res/images/icon_installing_overlay03.png
Binary files differ
diff --git a/res/images/icon_installing_overlay04.png b/res/images/icon_installing_overlay04.png
index a74903d..6f1f9cf 100644
--- a/res/images/icon_installing_overlay04.png
+++ b/res/images/icon_installing_overlay04.png
Binary files differ
diff --git a/res/images/icon_installing_overlay05.png b/res/images/icon_installing_overlay05.png
index d17bdc0..8791abd 100644
--- a/res/images/icon_installing_overlay05.png
+++ b/res/images/icon_installing_overlay05.png
Binary files differ
diff --git a/res/images/icon_installing_overlay06.png b/res/images/icon_installing_overlay06.png
index 1200b75..08a0133 100644
--- a/res/images/icon_installing_overlay06.png
+++ b/res/images/icon_installing_overlay06.png
Binary files differ
diff --git a/res/images/icon_installing_overlay07.png b/res/images/icon_installing_overlay07.png
index 3838a85..15b53d9 100644
--- a/res/images/icon_installing_overlay07.png
+++ b/res/images/icon_installing_overlay07.png
Binary files differ
diff --git a/res/images/icon_installing_overlay08.png b/res/images/icon_installing_overlay08.png
new file mode 100644
index 0000000..bb49878
--- /dev/null
+++ b/res/images/icon_installing_overlay08.png
Binary files differ
diff --git a/res/images/icon_installing_overlay09.png b/res/images/icon_installing_overlay09.png
new file mode 100644
index 0000000..e8715fc
--- /dev/null
+++ b/res/images/icon_installing_overlay09.png
Binary files differ
diff --git a/res/images/icon_installing_overlay10.png b/res/images/icon_installing_overlay10.png
new file mode 100644
index 0000000..4ad81bf
--- /dev/null
+++ b/res/images/icon_installing_overlay10.png
Binary files differ
diff --git a/res/images/icon_installing_overlay11.png b/res/images/icon_installing_overlay11.png
new file mode 100644
index 0000000..b3ae7e3
--- /dev/null
+++ b/res/images/icon_installing_overlay11.png
Binary files differ
diff --git a/res/images/icon_installing_overlay12.png b/res/images/icon_installing_overlay12.png
new file mode 100644
index 0000000..5e7fd04
--- /dev/null
+++ b/res/images/icon_installing_overlay12.png
Binary files differ
diff --git a/res/images/icon_installing_overlay13.png b/res/images/icon_installing_overlay13.png
new file mode 100644
index 0000000..4e4dbe9
--- /dev/null
+++ b/res/images/icon_installing_overlay13.png
Binary files differ
diff --git a/res/images/icon_installing_overlay14.png b/res/images/icon_installing_overlay14.png
new file mode 100644
index 0000000..55e19b5
--- /dev/null
+++ b/res/images/icon_installing_overlay14.png
Binary files differ
diff --git a/res/images/icon_installing_overlay15.png b/res/images/icon_installing_overlay15.png
new file mode 100644
index 0000000..ac5fb99
--- /dev/null
+++ b/res/images/icon_installing_overlay15.png
Binary files differ
diff --git a/res/images/icon_installing_overlay16.png b/res/images/icon_installing_overlay16.png
new file mode 100644
index 0000000..6461d70
--- /dev/null
+++ b/res/images/icon_installing_overlay16.png
Binary files differ
diff --git a/res/images/icon_installing_overlay17.png b/res/images/icon_installing_overlay17.png
new file mode 100644
index 0000000..cc981d3
--- /dev/null
+++ b/res/images/icon_installing_overlay17.png
Binary files differ
diff --git a/res/images/icon_installing_overlay18.png b/res/images/icon_installing_overlay18.png
new file mode 100644
index 0000000..2b32214
--- /dev/null
+++ b/res/images/icon_installing_overlay18.png
Binary files differ
diff --git a/res/images/icon_installing_overlay19.png b/res/images/icon_installing_overlay19.png
new file mode 100644
index 0000000..d379e51
--- /dev/null
+++ b/res/images/icon_installing_overlay19.png
Binary files differ
diff --git a/res/images/icon_installing_overlay20.png b/res/images/icon_installing_overlay20.png
new file mode 100644
index 0000000..362a8ca
--- /dev/null
+++ b/res/images/icon_installing_overlay20.png
Binary files differ
diff --git a/res/images/icon_installing_overlay21.png b/res/images/icon_installing_overlay21.png
new file mode 100644
index 0000000..0b65592
--- /dev/null
+++ b/res/images/icon_installing_overlay21.png
Binary files differ
diff --git a/res/images/icon_installing_overlay22.png b/res/images/icon_installing_overlay22.png
new file mode 100644
index 0000000..51d5cba
--- /dev/null
+++ b/res/images/icon_installing_overlay22.png
Binary files differ
diff --git a/res/images/icon_installing_overlay23.png b/res/images/icon_installing_overlay23.png
new file mode 100644
index 0000000..59148e5
--- /dev/null
+++ b/res/images/icon_installing_overlay23.png
Binary files differ
diff --git a/res/images/icon_installing_overlay24.png b/res/images/icon_installing_overlay24.png
new file mode 100644
index 0000000..d315673
--- /dev/null
+++ b/res/images/icon_installing_overlay24.png
Binary files differ
diff --git a/res/images/icon_installing_overlay25.png b/res/images/icon_installing_overlay25.png
new file mode 100644
index 0000000..1eb7843
--- /dev/null
+++ b/res/images/icon_installing_overlay25.png
Binary files differ
diff --git a/res/images/icon_installing_overlay26.png b/res/images/icon_installing_overlay26.png
new file mode 100644
index 0000000..14a024d
--- /dev/null
+++ b/res/images/icon_installing_overlay26.png
Binary files differ
diff --git a/res/images/icon_installing_overlay27.png b/res/images/icon_installing_overlay27.png
new file mode 100644
index 0000000..035c163
--- /dev/null
+++ b/res/images/icon_installing_overlay27.png
Binary files differ
diff --git a/res/images/icon_installing_overlay28.png b/res/images/icon_installing_overlay28.png
new file mode 100644
index 0000000..7548386
--- /dev/null
+++ b/res/images/icon_installing_overlay28.png
Binary files differ
diff --git a/res/images/icon_installing_overlay29.png b/res/images/icon_installing_overlay29.png
new file mode 100644
index 0000000..836d313
--- /dev/null
+++ b/res/images/icon_installing_overlay29.png
Binary files differ
diff --git a/res/images/icon_installing_overlay30.png b/res/images/icon_installing_overlay30.png
new file mode 100644
index 0000000..e470a7e
--- /dev/null
+++ b/res/images/icon_installing_overlay30.png
Binary files differ
diff --git a/res/images/icon_installing_overlay31.png b/res/images/icon_installing_overlay31.png
new file mode 100644
index 0000000..bed0c65
--- /dev/null
+++ b/res/images/icon_installing_overlay31.png
Binary files differ
diff --git a/res/images/icon_installing_overlay32.png b/res/images/icon_installing_overlay32.png
new file mode 100644
index 0000000..51811e0
--- /dev/null
+++ b/res/images/icon_installing_overlay32.png
Binary files differ
diff --git a/res/images/icon_installing_overlay33.png b/res/images/icon_installing_overlay33.png
new file mode 100644
index 0000000..f1fc656
--- /dev/null
+++ b/res/images/icon_installing_overlay33.png
Binary files differ
diff --git a/res/images/icon_installing_overlay34.png b/res/images/icon_installing_overlay34.png
new file mode 100644
index 0000000..5791a7d
--- /dev/null
+++ b/res/images/icon_installing_overlay34.png
Binary files differ
diff --git a/res/images/icon_installing_overlay35.png b/res/images/icon_installing_overlay35.png
new file mode 100644
index 0000000..0769ec9
--- /dev/null
+++ b/res/images/icon_installing_overlay35.png
Binary files differ
diff --git a/res/images/icon_installing_overlay36.png b/res/images/icon_installing_overlay36.png
new file mode 100644
index 0000000..28a692b
--- /dev/null
+++ b/res/images/icon_installing_overlay36.png
Binary files differ
diff --git a/res/images/icon_installing_overlay37.png b/res/images/icon_installing_overlay37.png
new file mode 100644
index 0000000..12b21cf
--- /dev/null
+++ b/res/images/icon_installing_overlay37.png
Binary files differ
diff --git a/res/images/icon_installing_overlay38.png b/res/images/icon_installing_overlay38.png
new file mode 100644
index 0000000..f8ef996
--- /dev/null
+++ b/res/images/icon_installing_overlay38.png
Binary files differ
diff --git a/res/images/icon_installing_overlay39.png b/res/images/icon_installing_overlay39.png
new file mode 100644
index 0000000..f929119
--- /dev/null
+++ b/res/images/icon_installing_overlay39.png
Binary files differ
diff --git a/res/images/icon_installing_overlay40.png b/res/images/icon_installing_overlay40.png
new file mode 100644
index 0000000..ceed457
--- /dev/null
+++ b/res/images/icon_installing_overlay40.png
Binary files differ
diff --git a/res/images/icon_installing_overlay41.png b/res/images/icon_installing_overlay41.png
new file mode 100644
index 0000000..34cf1ae
--- /dev/null
+++ b/res/images/icon_installing_overlay41.png
Binary files differ
diff --git a/res/images/icon_installing_overlay42.png b/res/images/icon_installing_overlay42.png
new file mode 100644
index 0000000..d622417
--- /dev/null
+++ b/res/images/icon_installing_overlay42.png
Binary files differ
diff --git a/res/images/icon_installing_overlay43.png b/res/images/icon_installing_overlay43.png
new file mode 100644
index 0000000..9902df1
--- /dev/null
+++ b/res/images/icon_installing_overlay43.png
Binary files differ
diff --git a/res/images/icon_installing_overlay44.png b/res/images/icon_installing_overlay44.png
new file mode 100644
index 0000000..b5d7911
--- /dev/null
+++ b/res/images/icon_installing_overlay44.png
Binary files differ
diff --git a/res/images/icon_installing_overlay45.png b/res/images/icon_installing_overlay45.png
new file mode 100644
index 0000000..dfbf408
--- /dev/null
+++ b/res/images/icon_installing_overlay45.png
Binary files differ
diff --git a/res/images/icon_installing_overlay46.png b/res/images/icon_installing_overlay46.png
new file mode 100644
index 0000000..495bb90
--- /dev/null
+++ b/res/images/icon_installing_overlay46.png
Binary files differ
diff --git a/res/images/icon_installing_overlay47.png b/res/images/icon_installing_overlay47.png
new file mode 100644
index 0000000..9d69378
--- /dev/null
+++ b/res/images/icon_installing_overlay47.png
Binary files differ
diff --git a/res/images/icon_installing_overlay48.png b/res/images/icon_installing_overlay48.png
new file mode 100644
index 0000000..a5080af
--- /dev/null
+++ b/res/images/icon_installing_overlay48.png
Binary files differ
diff --git a/res/images/indeterminate01.png b/res/images/indeterminate01.png
index 933528d..4db3843 100644
--- a/res/images/indeterminate01.png
+++ b/res/images/indeterminate01.png
Binary files differ
diff --git a/res/images/indeterminate02.png b/res/images/indeterminate02.png
index d760e2b..761b233 100644
--- a/res/images/indeterminate02.png
+++ b/res/images/indeterminate02.png
Binary files differ
diff --git a/res/images/indeterminate03.png b/res/images/indeterminate03.png
index 0e97399..e2617ab 100644
--- a/res/images/indeterminate03.png
+++ b/res/images/indeterminate03.png
Binary files differ
diff --git a/res/images/indeterminate04.png b/res/images/indeterminate04.png
index c7d5b4e..132940e 100644
--- a/res/images/indeterminate04.png
+++ b/res/images/indeterminate04.png
Binary files differ
diff --git a/res/images/indeterminate05.png b/res/images/indeterminate05.png
index d6fb2a0..a17032c 100644
--- a/res/images/indeterminate05.png
+++ b/res/images/indeterminate05.png
Binary files differ
diff --git a/res/images/indeterminate06.png b/res/images/indeterminate06.png
index 4486761..efaac42 100644
--- a/res/images/indeterminate06.png
+++ b/res/images/indeterminate06.png
Binary files differ
diff --git a/res/images/indeterminate07.png b/res/images/indeterminate07.png
new file mode 100644
index 0000000..6e84a5a
--- /dev/null
+++ b/res/images/indeterminate07.png
Binary files differ
diff --git a/res/images/indeterminate08.png b/res/images/indeterminate08.png
new file mode 100644
index 0000000..58c112e
--- /dev/null
+++ b/res/images/indeterminate08.png
Binary files differ
diff --git a/res/images/indeterminate09.png b/res/images/indeterminate09.png
new file mode 100644
index 0000000..b25145f
--- /dev/null
+++ b/res/images/indeterminate09.png
Binary files differ
diff --git a/res/images/indeterminate10.png b/res/images/indeterminate10.png
new file mode 100644
index 0000000..4ff7e25
--- /dev/null
+++ b/res/images/indeterminate10.png
Binary files differ
diff --git a/res/images/indeterminate11.png b/res/images/indeterminate11.png
new file mode 100644
index 0000000..4860c2a
--- /dev/null
+++ b/res/images/indeterminate11.png
Binary files differ
diff --git a/res/images/indeterminate12.png b/res/images/indeterminate12.png
new file mode 100644
index 0000000..a249c22
--- /dev/null
+++ b/res/images/indeterminate12.png
Binary files differ
diff --git a/res/images/indeterminate13.png b/res/images/indeterminate13.png
new file mode 100644
index 0000000..1b70dc0
--- /dev/null
+++ b/res/images/indeterminate13.png
Binary files differ
diff --git a/res/images/indeterminate14.png b/res/images/indeterminate14.png
new file mode 100644
index 0000000..a5f779f
--- /dev/null
+++ b/res/images/indeterminate14.png
Binary files differ
diff --git a/res/images/indeterminate15.png b/res/images/indeterminate15.png
new file mode 100644
index 0000000..018fa68
--- /dev/null
+++ b/res/images/indeterminate15.png
Binary files differ
diff --git a/res/images/indeterminate16.png b/res/images/indeterminate16.png
new file mode 100644
index 0000000..e8e05b6
--- /dev/null
+++ b/res/images/indeterminate16.png
Binary files differ
diff --git a/screen_ui.cpp b/screen_ui.cpp
index bb879df..1f2471a 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -75,10 +75,10 @@
     // that overrides Init() to set these values appropriately and
     // then call the superclass Init().
     animation_fps(20),
-    indeterminate_frames(6),
-    installing_frames(7),
-    install_overlay_offset_x(13),
-    install_overlay_offset_y(190) {
+    indeterminate_frames(16),
+    installing_frames(48),
+    install_overlay_offset_x(65),
+    install_overlay_offset_y(106) {
     pthread_mutex_init(&updateMutex, NULL);
     self = this;
 }