Update the system update animation.
Switch to a Wear-like intro/loop system. We don't have an intro yet, but hopefully this will let Wear delete more code when they move to N. Unlike them, we don't hard-code the number of frames: we just look to see what we have available. We do hard-code the fps though. Also add a graphics test mode so you can see a demo of the UI components without having to actually apply an OTA. Also fix a bug where default locale is null rather than en-US: it's more useful to show _some_ text if we don't have a locale (which should only be during development anyway). Bug: http://b/26548285 Change-Id: I63422e3fef3c41109f924d96fb5ded0b3ae7815d
|
@ -25,6 +25,7 @@ static const char* MENU_ITEMS[] = {
|
||||||
"Wipe cache partition",
|
"Wipe cache partition",
|
||||||
"Mount /system",
|
"Mount /system",
|
||||||
"View recovery logs",
|
"View recovery logs",
|
||||||
|
"Run graphics test",
|
||||||
"Power off",
|
"Power off",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -43,7 +44,8 @@ Device::BuiltinAction Device::InvokeMenuItem(int menu_position) {
|
||||||
case 5: return WIPE_CACHE;
|
case 5: return WIPE_CACHE;
|
||||||
case 6: return MOUNT_SYSTEM;
|
case 6: return MOUNT_SYSTEM;
|
||||||
case 7: return VIEW_RECOVERY_LOGS;
|
case 7: return VIEW_RECOVERY_LOGS;
|
||||||
case 8: return SHUTDOWN;
|
case 8: return RUN_GRAPHICS_TEST;
|
||||||
|
case 9: return SHUTDOWN;
|
||||||
default: return NO_ACTION;
|
default: return NO_ACTION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
device.h
|
@ -68,6 +68,7 @@ class Device {
|
||||||
SHUTDOWN = 8,
|
SHUTDOWN = 8,
|
||||||
VIEW_RECOVERY_LOGS = 9,
|
VIEW_RECOVERY_LOGS = 9,
|
||||||
MOUNT_SYSTEM = 10,
|
MOUNT_SYSTEM = 10,
|
||||||
|
RUN_GRAPHICS_TEST = 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Return the list of menu items (an array of strings,
|
// Return the list of menu items (an array of strings,
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
|
|
||||||
#include "minui.h"
|
#include "minui.h"
|
||||||
|
|
||||||
extern char* locale;
|
|
||||||
|
|
||||||
#define SURFACE_DATA_ALIGNMENT 8
|
#define SURFACE_DATA_ALIGNMENT 8
|
||||||
|
|
||||||
static GRSurface* malloc_surface(size_t data_size) {
|
static GRSurface* malloc_surface(size_t data_size) {
|
||||||
|
|
37
recovery.cpp
|
@ -103,7 +103,7 @@ static const int BATTERY_OK_PERCENTAGE = 20;
|
||||||
static const int BATTERY_WITH_CHARGER_OK_PERCENTAGE = 15;
|
static const int BATTERY_WITH_CHARGER_OK_PERCENTAGE = 15;
|
||||||
|
|
||||||
RecoveryUI* ui = NULL;
|
RecoveryUI* ui = NULL;
|
||||||
char* locale = NULL;
|
static const char* locale = "en_US";
|
||||||
char* stage = NULL;
|
char* stage = NULL;
|
||||||
char* reason = NULL;
|
char* reason = NULL;
|
||||||
bool modified_flash = false;
|
bool modified_flash = false;
|
||||||
|
@ -910,6 +910,37 @@ static void choose_recovery_file(Device* device) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void run_graphics_test(Device* device) {
|
||||||
|
// Switch to graphics screen.
|
||||||
|
ui->ShowText(false);
|
||||||
|
|
||||||
|
ui->SetProgressType(RecoveryUI::INDETERMINATE);
|
||||||
|
ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
ui->SetBackground(RecoveryUI::ERROR);
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
ui->SetBackground(RecoveryUI::NO_COMMAND);
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
ui->SetBackground(RecoveryUI::ERASING);
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
|
||||||
|
|
||||||
|
ui->SetProgressType(RecoveryUI::DETERMINATE);
|
||||||
|
ui->ShowProgress(1.0, 10.0);
|
||||||
|
float fraction = 0.0;
|
||||||
|
for (size_t i = 0; i < 100; ++i) {
|
||||||
|
fraction += .01;
|
||||||
|
ui->SetProgress(fraction);
|
||||||
|
usleep(100000);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->ShowText(true);
|
||||||
|
}
|
||||||
|
|
||||||
// How long (in seconds) we wait for the fuse-provided package file to
|
// How long (in seconds) we wait for the fuse-provided package file to
|
||||||
// appear, before timing out.
|
// appear, before timing out.
|
||||||
#define SDCARD_INSTALL_TIMEOUT 10
|
#define SDCARD_INSTALL_TIMEOUT 10
|
||||||
|
@ -1068,6 +1099,10 @@ prompt_and_wait(Device* device, int status) {
|
||||||
choose_recovery_file(device);
|
choose_recovery_file(device);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Device::RUN_GRAPHICS_TEST:
|
||||||
|
run_graphics_test(device);
|
||||||
|
break;
|
||||||
|
|
||||||
case Device::MOUNT_SYSTEM:
|
case Device::MOUNT_SYSTEM:
|
||||||
char system_root_image[PROPERTY_VALUE_MAX];
|
char system_root_image[PROPERTY_VALUE_MAX];
|
||||||
property_get("ro.build.system_root_image", system_root_image, "");
|
property_get("ro.build.system_root_image", system_root_image, "");
|
||||||
|
|
Before Width: | Height: | Size: 127 KiB |
BIN
res-hdpi/images/loop00.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop01.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop02.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
res-hdpi/images/loop03.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
res-hdpi/images/loop04.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
res-hdpi/images/loop05.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
res-hdpi/images/loop06.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
res-hdpi/images/loop07.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
res-hdpi/images/loop08.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
res-hdpi/images/loop09.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
res-hdpi/images/loop10.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
res-hdpi/images/loop11.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
res-hdpi/images/loop12.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop13.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop14.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop15.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop16.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop17.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop18.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop19.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop20.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop21.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop22.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
res-hdpi/images/loop23.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
res-hdpi/images/loop24.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
res-hdpi/images/loop25.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
res-hdpi/images/loop26.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop27.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop28.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop29.png
Normal file
After Width: | Height: | Size: 9 KiB |
BIN
res-hdpi/images/loop30.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
res-hdpi/images/loop31.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
res-hdpi/images/loop32.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
res-hdpi/images/loop33.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
res-hdpi/images/loop34.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
res-hdpi/images/loop35.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
res-hdpi/images/loop36.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
res-hdpi/images/loop37.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
res-hdpi/images/loop38.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
res-hdpi/images/loop39.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
res-hdpi/images/loop40.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
res-hdpi/images/loop41.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
res-hdpi/images/loop42.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop43.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
res-hdpi/images/loop44.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
res-hdpi/images/loop45.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop46.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
res-hdpi/images/loop47.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop48.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop49.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
res-hdpi/images/loop50.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
res-hdpi/images/loop51.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop52.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
res-hdpi/images/loop53.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
res-hdpi/images/loop54.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
res-hdpi/images/loop55.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop56.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
res-hdpi/images/loop57.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
res-hdpi/images/loop58.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
res-hdpi/images/loop59.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop60.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop61.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop62.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop63.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop64.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop65.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop66.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop67.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop68.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
res-hdpi/images/loop69.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
res-hdpi/images/loop70.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop71.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop72.png
Normal file
After Width: | Height: | Size: 9 KiB |
BIN
res-hdpi/images/loop73.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
res-hdpi/images/loop74.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
res-hdpi/images/loop75.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
res-hdpi/images/loop76.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
res-hdpi/images/loop77.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
res-hdpi/images/loop78.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
res-hdpi/images/loop79.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
res-hdpi/images/loop80.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
res-hdpi/images/loop81.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
res-hdpi/images/loop82.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
res-hdpi/images/loop83.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop84.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
res-hdpi/images/loop85.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
res-hdpi/images/loop86.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
res-hdpi/images/loop87.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
res-hdpi/images/loop88.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
res-hdpi/images/loop89.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
res-hdpi/images/loop90.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 127 KiB |
BIN
res-mdpi/images/loop00.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
res-mdpi/images/loop01.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
res-mdpi/images/loop02.png
Normal file
After Width: | Height: | Size: 6.2 KiB |