diff options
author | Tianjie Xu <xunchang@google.com> | 2019-12-06 23:58:34 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-12-06 23:58:34 +0100 |
commit | 517c86e68a7cef533e887c0b6fda675d81b5897d (patch) | |
tree | 42789ac5f75fdf8a1242b646fc32e28b4d7c549a | |
parent | Merge "Merge Android10 QPR1 into AOSP master" am: 2a9ddbb108 am: 9cc8880f6e (diff) | |
parent | Merge "Add mechanism for device-specific loop images" am: d81bb36b5b (diff) | |
download | android_bootable_recovery-517c86e68a7cef533e887c0b6fda675d81b5897d.tar android_bootable_recovery-517c86e68a7cef533e887c0b6fda675d81b5897d.tar.gz android_bootable_recovery-517c86e68a7cef533e887c0b6fda675d81b5897d.tar.bz2 android_bootable_recovery-517c86e68a7cef533e887c0b6fda675d81b5897d.tar.lz android_bootable_recovery-517c86e68a7cef533e887c0b6fda675d81b5897d.tar.xz android_bootable_recovery-517c86e68a7cef533e887c0b6fda675d81b5897d.tar.zst android_bootable_recovery-517c86e68a7cef533e887c0b6fda675d81b5897d.zip |
Diffstat (limited to '')
-rw-r--r-- | recovery_ui/screen_ui.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/recovery_ui/screen_ui.cpp b/recovery_ui/screen_ui.cpp index 087fc0e84..b3ef113a7 100644 --- a/recovery_ui/screen_ui.cpp +++ b/recovery_ui/screen_ui.cpp @@ -941,17 +941,27 @@ void ScreenRecoveryUI::LoadAnimation() { closedir); dirent* de; std::vector<std::string> intro_frame_names; - std::vector<std::string> loop_frame_names; + std::vector<std::string> default_loop_frame_names; + std::vector<std::string> device_loop_frame_names; + // Create string format for device-specific loop animations. + std::string deviceformat = android::base::GetProperty("ro.product.product.name", ""); + deviceformat += "%d%n.png"; while ((de = readdir(dir.get())) != nullptr) { int value, num_chars; if (sscanf(de->d_name, "intro%d%n.png", &value, &num_chars) == 1) { intro_frame_names.emplace_back(de->d_name, num_chars); } else if (sscanf(de->d_name, "loop%d%n.png", &value, &num_chars) == 1) { - loop_frame_names.emplace_back(de->d_name, num_chars); + default_loop_frame_names.emplace_back(de->d_name, num_chars); + } else if (sscanf(de->d_name, deviceformat.c_str(), &value, &num_chars) == 1) { + device_loop_frame_names.emplace_back(de->d_name, num_chars); } } + // Favor device-specific loop frames, if they exist. + auto& loop_frame_names = + device_loop_frame_names.empty() ? default_loop_frame_names : device_loop_frame_names; + size_t intro_frames = intro_frame_names.size(); size_t loop_frames = loop_frame_names.size(); |