summaryrefslogtreecommitdiffstats
path: root/minui (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-01-25minui: add hall sensor eventJack Wu2-0/+31
Bug: 191831427 Bug: 200907986 Test: manual test Signed-off-by: Jack Wu <wjack@google.com> Change-Id: Ibb6f1e13344d33586398ac2e09430281bbe6d718
2022-01-25minui: Add support for multiple connectorsWeizhung Ding7-76/+153
Add support for multiple connectors. Bug: 194732653 Test: charging animation can be displayed on different connectors Change-Id: If9b9eac25ce6e4c582aeb7c52e94ca266f623438
2021-12-06minui: Add support for ARGB (LSB alpha)Patrik Torstensson3-21/+91
- Called RGBA to follow convention in minui where big-endian description of format is used and to avoid conflict with existing ARGB - Handle alpha being LSB in png and text rendering Change-Id: I0d9afef55aad05028ed0b8b4204f1d52aaa683c3 (cherry picked from commit cd1c327427febe7cf76e6fa4835847f0d4f398e3)
2021-11-25Do not write past end of inotify event structure.Christopher Ferris1-3/+5
Bug: 202159709 Test: None yet. Change-Id: If80ed957aaa93c03a97b57e818e7783fa6e38242 (cherry picked from commit ce87c786116557e89f9da95f550d6816aeaca67e) (cherry picked from commit 85d7266a7273f962f40987c5e07370c5e7dc0c72) Merged-In:If80ed957aaa93c03a97b57e818e7783fa6e38242
2021-10-21libminui for vendorYifan Hong1-0/+12
Build a static variant of libminui for vendor to use. It depends on libdrm statically, and libsync from NDK. This is needed to move charger to vendor partition. Test: builds Bug: 203246116 Change-Id: I0aa7783121502bef6ed98d9060a395931523b34c
2021-10-12Do not write past end of inotify event structure.Christopher Ferris1-3/+5
Bug: 202159709 Test: None yet. Change-Id: If80ed957aaa93c03a97b57e818e7783fa6e38242 (cherry picked from commit ce87c786116557e89f9da95f550d6816aeaca67e)
2021-10-12Do not write past end of inotify event structure.Christopher Ferris1-3/+5
Bug: 202159709 Test: None yet. Change-Id: If80ed957aaa93c03a97b57e818e7783fa6e38242 (cherry picked from commit ce87c786116557e89f9da95f550d6816aeaca67e)
2021-10-12Do not write past end of inotify event structure.Christopher Ferris1-3/+5
Bug: 202159709 Test: None yet. Change-Id: If80ed957aaa93c03a97b57e818e7783fa6e38242 (cherry picked from commit ce87c786116557e89f9da95f550d6816aeaca67e)
2021-10-12Do not write past end of inotify event structure.Christopher Ferris1-3/+5
Bug: 202159709 Test: None yet. Change-Id: If80ed957aaa93c03a97b57e818e7783fa6e38242 (cherry picked from commit ce87c786116557e89f9da95f550d6816aeaca67e)
2021-10-11Do not write past end of inotify event structure.Christopher Ferris1-3/+5
Bug: 202159709 Test: None yet. Change-Id: If80ed957aaa93c03a97b57e818e7783fa6e38242 (cherry picked from commit ce87c786116557e89f9da95f550d6816aeaca67e)
2021-10-08Do not write past end of inotify event structure.Christopher Ferris1-3/+5
Bug: 202159709 Test: None yet. Change-Id: If80ed957aaa93c03a97b57e818e7783fa6e38242
2021-09-23Add support to use preferred graphics backendChihhang Chuang2-10/+40
- Add #gr_init(backends) for users to use preferred graphics backend. Bug: 196777741 Test: build, flash, and boot device. Change-Id: I2621e879bbc7dce926a263a97a1013985d75592a
2021-07-27Remove magic code to flash the screenKelvin Zhang1-2/+0
The code is originally introduced in aosp/87740 , not sure why it's necessary to do `blank(true); blank(false);` . Partners have complained that such code causes device's screen to flicker, so remove it. Test: th Bug: 194757527 Change-Id: I271883ea8c96a5612283aa34806b18e1590288f6
2021-05-17use create_dumb.size as size of bufferKelvin Zhang1-2/+12
According to `man drm-memory` , "The size field contains the absolute size in bytes of the buffer. This can normally also be computed with (height * pitch + width) * bpp / 4". Which suggests that we should use the .size field to allocate buffer. Test: th Test: go to recovery, make sure contents are properly displayed. BYPASS_INCLUSIVE_LANGUAGE_REASON=commit message referenced "man", which is a linux command for lookup manual pages. Change-Id: I512be6b7d493ef1783f2b7f746e279bc1dfe65f2
2021-02-14[LSC] Add LOCAL_LICENSE_KINDS to bootable/recoveryBob Badour1-0/+9
Added SPDX-license-identifier-Apache-2.0 to: applypatch/Android.bp bootloader_message/Android.bp edify/Android.bp fuse_sideload/Android.bp install/Android.bp minadbd/Android.bp minui/Android.bp otautil/Android.bp recovery_ui/Android.bp recovery_utils/Android.bp tests/Android.bp tools/image_generator/Android.bp tools/recovery_l10n/Android.bp uncrypt/Android.bp update_verifier/Android.bp updater/Android.bp updater/Android.mk updater_sample/Android.bp updater_sample/tests/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT SPDX-license-identifier-OFL to: Android.bp Android.mk Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I3da761b525452838977297f773974000d4de7bd6
2021-01-21minui: remove libadf since it is no longer supportedMarissa Wall4-285/+1
Libadf is being removed since there are no android common kernels that support adf. Remove support from miniui. Test: Compiles and boots Bug: 150467766 Change-Id: Ic66ea7a012b0466810ddeb8f884150b50c8ae769
2020-12-23minui: fix mem leakage issuelijiazi1-1/+1
Use free to release GRSurface object will not call data_'s DataDeleter, then the buf data_ points to will leakage. Use delete release GRSurface object. Test: manual Change-Id: I53a9ea5a4ad67de1662c707a5ea59d738bd9c2d8 Signed-off-by: lijiazi <lijiazi@xiaomi.com>
2020-02-28minui: remove libadf since it is no longer supportedMarissa Wall4-285/+1
Libadf is being removed since there are no android common kernels that support adf. Remove support from miniui. Test: Compiles and boots Bug: 150467766 Change-Id: Ic66ea7a012b0466810ddeb8f884150b50c8ae769
2020-01-14Fix ioctl FIONREAD call parameters to use int instead of size_tStephane Lee1-2/+4
Test: Ensure that calls to inotify_cb succeed; Ensure charger does not crash Change-Id: I9a7ca304057313c74ef02fd97223d0ed570c6206
2019-12-13minui: add ARGB_8888 formatAdrian Salido4-4/+11
Minui currently really only supports composing in 2 different formats (see gr_color()) with ALPHA always as MSB. However, some devices interpret PixelFormat as either Big Endian (i.e. ARGB has alpha at MSB) or Little Endian (i.e. BGRA has alpha at MSB). This change attempts to give multiple options to specify the same format depending on device interpretation, while keeping just 2 different composition formats supported by minui. * ARGB + BGRA: Pixels have (A)lpha at MSB and (B)lue at LSB * RGBX + ABGR: Pixels have (A)lpha at MSB and (R)ed at LSB With this in mind, limiting the use of png_set_bgr() to happen only for (ARGB/BGRA) combination while leaving (RGBX/ABGR) unchanged. Bug: 143480444 Test: Boot device with TARGET_RECOVERY_PIXEL_FORMAT := <<all>> Change-Id: Ia0f94ccbc564b8def7c9416483712ff1abbbf49a
2019-08-14minui: Support input device hotplug in recovery mode.Xihua Chen1-20/+104
In the old code, the recovery only enumerated the input devices at the startup, and read the input events from these devices. So if a USB input device is probed after the recovery startup, then the recovery can't read the events from this device. This patch use inotify to monitor /dev/input for new added input device, then support input device hotplug in recovery mode. Bug: 111847510 Test: can use USB keyboard hotplugged in recovery mode Change-Id: I7e7dcbd619d3c66a2f40a43418f5dac6a50c859e Signed-off-by: Liu Shuo A <shuo.a.liu@intel.com> Signed-off-by: Ming Tan <ming.tan@intel.com>
2019-04-23matches_locale no longer accept empty locales in the png filexunchang1-0/+4
The legacy png files have an empty line in the end. And the recovery used to match any missing locale, e.g. "he" with that line and gets an empty image. Since the empty image is barely useful, we should just error out and fall back to the default locale. This reversed the unit test check added in d17a6885253da909e376ba5ca5084f5281f3557c Bug: 128934634 Test: run locale test with "he" and legacy images, recovery reports error and doesn't crash even without default locale fall back Change-Id: Ibdb7dd0b42348de5e392c834cce67ff02be85c24
2019-04-22Fall back to en-US if localized bitmap is missing for a localexunchang1-4/+10
We used to show the image for the last locale or an empty image, if the localized image is missing for a specific locale. As the default english one is more meaningful to users, we should just error out and fall back to use the default locale when the image loading fails. Bug: 128934634 Test: run graphic test, locale test Change-Id: Iafd3e8466aec63b4952d1959b2a3d37e358677d4
2019-03-11minui: Managed FDs with smart pointers.Tao Bao2-103/+107
Also clean up a few variable names. Test: Boot into recovery. Check key inputs. Change-Id: I058475ac22f3db8523bd8aa30ccb61be1ef45559
2019-03-11minui: Fix the wrong move of the callback.Tao Bao1-1/+1
The input_cb in ev_init() should be shared among the detected input devices. Test: Boot into recovery. Check key inputs. Change-Id: I0315f6a23625bacedd333fefacbf4ac6797bc1fd
2019-03-01Use O_CLOEXEC at a few places.Tao Bao4-4/+4
Found these FDs unintentionally propagated into forked processes (e.g. updater) during my local debugging. Use O_CLOEXEC to avoid that. Test: Dump open FDs in updater process. Test: Sideload a package on taimen (which uses framebuffer). Test: Run graphics test on taimen. Change-Id: I1fb65dd4a103c47d28b15973def9e9359c251ca3
2018-12-17use epoll_create1Nick Kralevich1-1/+1
epoll_create leaks file descriptors. Use epoll_create1(EPOLL_CLOEXEC) instead. Bug: 120983106 Test: compiles and boots Change-Id: I91f213ebb2dd05330dd25ec1ca1fec59b611e7f2
2018-11-27minui: GRSurface::Create() computes data_size on its own.Tao Bao6-27/+40
GRSurface::Create() doesn't need to rely on caller specifying the buffer size, as it can compute that info based on the given args. This CL also uses `size_t` for all the parameters in GRSurface::Create(). Test: Run recovery_unit_test on marlin. Test: Build and boot into blueline recovery. `Run graphics test`. Test: Build and boot into blueline charger mode. Change-Id: Idec9381079196abf13553a475006fefcfca10950
2018-11-27minui: Fix a wrong arg in calling GRSurface::Create().Tao Bao1-1/+1
This is a bug introduced while refactoring init_display_surface(), in [1]. As a result, user of res_create_multi_display_surface(), which is effectively `charger` right now, crashes due to buffer overrun. This CL fixes the wrong arg and adds a sanity test for res_create_multi_display_surface(). The testdata (battery_scale.png) is copied from system/core/healthd/images/battery_scale.png. [1] commit 44820ac1e31ffa029ab5baa71238a11b6db3e6cc. Bug: 119122296 Test: Run recovery_unit_test on marlin. Test: Build and boot into charger mode on blueline. Verify that `charger` no longer crashes. Change-Id: Ib6d083e1512a9c3c6eb63874d26d22658921d693
2018-11-07minui: GRSurface manages data with std::unique_ptr.Tao Bao2-13/+16
Test: Run recovery_unit_test on marlin. Test: `Run graphics test` on taimen. Change-Id: I34bd862049900b0030f2840a92a7fa3e02fa2c10
2018-11-02minui: Use android::base::unique_fd in MinuiBackendFbdev.Tao Bao2-14/+9
Test: mmma -j bootable/recovery Test: `Run graphics test` on taimen. Change-Id: I5b25cafbd0107943606a87f0619242cf950174ac
2018-11-01minui: Add GRSurface::Clone().Tao Bao2-2/+12
Clone() allows duplicating the image that's stored in the GRSurface. Test: Run recovery_unit_test. Change-Id: Ia50d507c6200f2de5f17143775de805247a60e1f
2018-11-01minui: Remove the default and copy ctors for GRSurface.Tao Bao3-12/+10
As well as all the derived classes. Instances must be created with Create(). A default copy ctor would mess up the ownership of the mapped or allocated buffer in these classes, so that has been explicitly removed. Test: mmma -j bootable/recovery Test: Run recovery_unit_test on marlin. Test: `Run graphics test` on blueline. Change-Id: I69ce001a9ec9e3ac851edb6ec4d3fa11f4aaea08
2018-11-01minui: Refactor GRSurfaceAdf.Tao Bao2-56/+65
Test: mmma -j bootable/recovery Change-Id: I14514017aace4b7043a9db1f5a93ec130a6f89c4
2018-11-01minui: Refactor GRSurfaceFbdev.Tao Bao2-44/+53
- Adds Create() that returns a GRSurfaceFbdev instance. - Moves away from using the copy ctor (precisely assignment operator) of GRSurfaceFbdev. - Moves the GRSurfaceFbdev deallocation code into GRSurfaceFbdev's dtor. - Manages MinuiBackendFbdev::gr_framebuffer with std::unique_ptr. Test: mmma -j bootable/recovery Test: `Run graphics test` on taimen. Change-Id: I8e67cda7bc3a2feec0790124d035caa36fb58a89
2018-10-31minui: Add a protected GRSurface ctor.Tao Bao2-85/+65
This prepares for the removal of the default and copy ctors, by making GRSurface::Create() as the only way to get GRSurface instances. Test: mmma -j bootable/recovery Test: Run recovery_unit_test on marlin. Change-Id: I0c34c3f3967e252deb020907c83acbac8a8f36b9
2018-10-24minui: Cleanup GRSurfaceDrm and MinuiBackendDrm.Tao Bao2-126/+109
This CL adds a dtor to GRSurfaceDrm that handles the resource deallocation. It also manages MinuiBackendDrm::GRSurfaceDrms with smart pointers. Test: Build and boot into recovery on blueline. `Run graphics test`. Change-Id: Iff7bbdddbc0b5ab16483d00870794fca9f832bd5
2018-10-23minui: Move GRSurface into a class.Tao Bao9-114/+157
This CL adds GRSurface::Create() and dtor for managing the allocated memory in GRSurface class. It also adds GRSurface::data() that hides the underlying implementation, with both of const and non-const overloads. This allows `const GRSurface&` to be more useful - previously it only ensured a const member variable of `data`, instead of a read-only buffer it points to. It also marks the parameters in gr_texticon() and gr_blit() as const, as they're incoming source that shouldn't be altered. It corrects the type of gr_draw, which is the sink to be painted on (an earlier attempt was made in [1], but didn't get the full picture correctly). [1] https://android-review.googlesource.com/c/platform/bootable/recovery/+/704757/ Test: mmma -j bootable/recovery Test: recovery_unit_test on marlin Test: Run graphics test on marlin (fbdev). Test: Run graphics test on blueline (drm). Change-Id: I7904df084cd6c08fa04a9da97d01b4b1a6e3a20c
2018-09-06minui: Track the name change to minui related properties.Tao Bao1-3/+3
These properties need to be exposed to both of charger and recovery. This CL tracks the name change. Bug: 113567255 Test: Build along with other CLs in the topic (for Makefile and sepolicy changes). Boot into charger mode. Test: Boot into recovery. Run graphics test. Change-Id: I4d90778c1767c9bd7e00830a34ee2d4875ce0b83
2018-08-08`recovery` uses more shared libraries.Tao Bao1-0/+1
Bug: 110380063 Test: `m -j installclean && mmma -j bootable/recovery` with aosp_taimen-userdebug Test: Build (`m -j bootimage`) and boot into recovery. Check that `adb sideload` and `Run graphics test` both work. Test: Run recovery_unit_test and recovery_component_test on marlin. Change-Id: Ie6ed0e7cafa352d5faff9d1b6ccef724a0415e65
2018-08-07minui: Track libsync module name change.Tao Bao1-1/+1
Needs the matching change to libsync_recovery. Test: `mmma -j bootable/recovery` Change-Id: I69b5c978e9b4d16957ffecd360796b29cd95865c
2018-08-07Fix the DRM_FORMAT match with corresponding PixelFormattangrobin1-3/+7
The DRM_FORMAT settings in DrmCreateSurface should match with the correct PixelFormat Bug: 112245291 Test: build and flash boot image to device. Change-Id: I3ee0de38256d1109cd5174b666e2f47dceb637e6
2018-08-05minui: Move to Soong.Tao Bao2-59/+46
Note that although libminui says "shared_libs" in Android.bp file, `recovery` binary will still statically link the libs, until we drop the `LOCAL_FORCE_STATIC_EXECUTABLE := true` flag from `recovery` module. Bug: 110380063 Test: `mmma -j bootable/recovery` with aosp_taimen-userdebug Test: Boot into recovery and `Run graphics test`. Change-Id: I48785d161dfe52eb01667e938d9c3f0a497b61a2
2018-08-02minui: Use runtime properties instead of build time vars.Tao Bao6-64/+69
This CL removes the use of the following build time macros, and uses the runtime property values instead. - TARGET_RECOVERY_PIXEL_FORMAT - TARGET_RECOVERY_OVERSCAN_PERCENT - TARGET_RECOVERY_DEFAULT_ROTATION Bug: 110380063 Test: Set up taimen with `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT`. Build and check recovery UI. Test: Set up taimen with `TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888`. Build and check recovery UI. Change-Id: I4439556a03fde4805a18011ef72eff1373f31d47
2018-08-01minui: Clean up the use of `rotation`.Tao Bao2-27/+50
This CL uses scoped enum for GRRotation. It also refactors the previous comparisions to improve readability -- it was hard to tell the meaning of `if (rotation % 2)` unless by checking the exact values. It also temporarily adds STRINGFY to expand the macro of DEFAULT_ROTATION. This will be removed once minui is changed from reading build time vars to runtime properties. Test: Build and boot into recovery image on marlin. Test: Set `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT` and check the display under recovery with `Run graphics test`. Change-Id: Ieb08b1cd13c284f8dcf906cb2a1430c6bae2835b
2018-07-03minui/drm: wait for page flip completionJeremy Compostella1-1/+38
If two consecutive call are made to drmModePageFlip, the second call may fail with -EBUSY because the first flip is not completed yet. This patch adds a wait for completion mechanism based on drmHandleEvent. Change-Id: Ied13ebefc7523003431b1b307bae70d1a70cb24b Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Signed-off-by: Benoit Fradin <benoit.fradin@intel.com>
2018-06-13minui: Add constness to GRSurface* in gr_get_{width,height}.Tao Bao2-20/+31
Also free gr_font in gr_exit(), as it's owned by minui. Test: mmma -j bootable/recovery system/core/healthd Test: recovery_unit_test on marlin Test: Boot into recovery. Run graphics test. Change-Id: I00457bb97ed3dc95ef5aad493827fb5a62a258dc
2018-06-06minui: Handle the failures from the drm backend in gr_initTianjie Xu3-7/+16
In a charger mode manual test, we encounter failures from the MinuiBackendDrm when calling DrmEnableCrtc and Flip. To make the minui more robust, we should fall back to another backend if drm's SetCrtc fails. And check the value of gr_draw before dereferencing. Bug: 80249440 Test: boot to recovery Change-Id: Ibd1ca1fb1115fe1132684586c54eccd8fb4c3ad9
2018-06-01Let gr_init proceed even if we failed to load a font fileTianjie Xu2-4/+15
Some users of minui don't need to draw texts; and we should let them still be able to use the library without providing a font file. Also add check for null pointers in gr_measure() and gr_font_size(). Bug: 80535212 Test: boot into recovery without a font file, and the buttons still work Change-Id: I848e4410f2ce09ea0ab433573e6827b7e9b2c575
2018-05-09tests: Add tests for ScreenRecoveryUI.Tao Bao2-2/+10
In order to support that, this CL adds Paths::set_resource_dir() to override the default resource dir ("/res/images/") that's only available under recovery. Note that since there're external modules depending on libminui, it adds a separate function of res_set_resource_dir(), instead of requiring the dependency on libotautil for everyone. Test: mmma -j bootable/recovery Test: Run recovery_unit_test on marlin. Change-Id: I0a7dcf4476808bea9e634eaffc9676f6cbaf92b7
2018-04-14Expose PngHandler via resources.h.Tao Bao2-58/+97
As a private header for testing purpose. PngHandler additionally loads a given filename if the one with '/res/images' prefix is not available. It also provides color_type/bit_depth that are parsed from the PNG file. This allows reusing the same code for the ResourcesTest (renamed from ResourceTest). Test: Run recovery_manual_test on marlin. Change-Id: I3f939d79a1cb1b83a899847dbe2d51bde15d16d8
2018-03-30Remove the obsolete mkfont.c and font_10x18.hTianjie Xu3-300/+5
The font_10x18.h is used as a fall back for fonts if the $(recovery_font) under bootable/recovery/fonts failed to reload. This font looks very small on the screen and we haven't used it in a while. Plus, fonts in header doesn't have many benefits if we support only ascii characters. So we decide to remove this header along with the mkfont.c that generates the header. For reference, here's the steps to use mkfont: 1. Generate a picture of fonts with apps on host 2. Open the pic with GIMP 3. Export the pic as '.c' file, and rename it into '.h' file 4. Compile the generated '.h' file with mkfont.c Bug: 76420958 Test: build and check the recovery menu on angler Change-Id: I6c108aa43a07bf4994115ef764275bd84df725e1
2017-12-20StartsWith allows a std::string prefix now.Elliott Hughes1-1/+1
Bug: N/A Test: builds Change-Id: I5183ec8133f5dc9a81a438223c6d3d2ea11ef0ec
2017-10-20libdrm_platform is now libdrmDan Willemsen1-1/+1
Since it's converted to Soong and is using vendor_available. Test: mmma bootable/recovery Change-Id: I57b40c26abc2f6031241de893b3184ed1283e1fe
2017-10-20Build libminui with BOARD_VNDK_VERSIONJiyong Park1-1/+1
Use libdrm_platform which is a platform variant of libdrm. Bug: 63741047 Bug: 37342627 Test: BOARD_VNDK_VERSION=current m -j libminui Test: ryu recovery graphics test shows various graphics Change-Id: Ifd2c1432781a96538585cdf818aa728d628a2f5a Merged-In: Ifd2c1432781a96538585cdf818aa728d628a2f5a
2017-10-12Drop -Wno-unused-parameter.Tao Bao1-0/+5
The only one left is libedify. Will handle that in a separate CL. Test: mmma bootable/recovery Change-Id: I732a5f85229da90fd767bee2e46c5c95f529c396
2017-10-11Add missing includes.Dan Albert1-0/+1
Test: mma Bug: None Change-Id: I8b588dfbc00ef67557622d44700b331c7a31bde3
2017-09-29Move the png open and destroy functions into a classTianjie Xu1-286/+279
The open_png() function used to open the png file but didn't close it; and this caused the leak of fd. However, we cannot close the file inside open_png() because the png file needs to remain open until the outer function finishes parsing the file and destroys the png struct. This CL addresses this issue by implementing a PngReader class to handle the creation/destruction of the png struct. Bug: 67010912 Test: Run graphic tests; also run locale tests and check fd. Change-Id: I9a803b3cd8c16f16a9ffe8f0acc7fe0f42e95eb0
2017-09-28graphics: add rotation logicLuke Song3-221/+280
Bug: 65556996 Bug: 63541890 Test: Tried 4 rotations, viewed logs and graphics test Change-Id: I2a6c18c28df03f0461663f63bf16db32c45211ec
2017-09-27Add a new option in recovery menu to test the background textsTianjie Xu2-0/+39
Add a new option "Run locale test" to check the background text images (i.e. texts for "erasing", "error", "no_command" and "installing" with different locales.) Use volume up/down button to cycle through all the locales embedded in the png file, and power button to go back to recovery main menu. Test: Run locale test with bullhead. Change-Id: Ib16e119f372110cdb5e611ef497b0f9b9b418f51
2017-08-29Turn on -Wall for recovery modulesTianjie Xu1-2/+2
Turn on -Wall for all modules. Also remove the obsolete file_cmp() in apply_patch test and now() in wear_ui. The only exception is lib_edify due to the unused functions in the intermediate cpp files generated from the lex files. It will be handled in a seperate CL. Bug: 64939312 Test: mma, unit tests pass Change-Id: Ic53f76b60b6401ab20db3d98130d674c08e3702f
2017-08-03ui: Move the support for touch inputs into RecoveryUI.Tao Bao2-12/+38
- Added detection for EV_ABS events in minui/events.cpp, if it's allowed; - Added listening and processing touch inputs in ui.cpp; - Fixed an issue in recognizing swipe with multi-touch protocol A; - Changed the logic in RecoveryUI::ProcessKey() to be swipe-aware. It now allows turning on text mode with <power> + <swipe-up>. The last change also fixed an issue on devices with protocol A: prior to this CL, user may accidentally toggle the text mode during an OTA. Because it was considered as a single-button device, a long tap that sent BTN_TOUCH event would turn on text mode. Test: Allow detecting touch inputs. Swiping (up, down, enter) works on angler, angelfish, dorado respectively. Bug: 36169090 Bug: 64307776 Change-Id: I4bc882b99114ce4ab414f8bdb8f4f7a525b8a8fd (cherry picked from commit 5f8dd9951d986b65d98d6a9ea38003427e9e46df)
2017-08-02ui: Move the support for touch inputs into RecoveryUI.Tao Bao2-12/+38
- Added detection for EV_ABS events in minui/events.cpp, if it's allowed; - Added listening and processing touch inputs in ui.cpp; - Fixed an issue in recognizing swipe with multi-touch protocol A; - Changed the logic in RecoveryUI::ProcessKey() to be swipe-aware. It now allows turning on text mode with <power> + <swipe-up>. The last change also fixed an issue on devices with protocol A: prior to this CL, user may accidentally toggle the text mode during an OTA. Because it was considered as a single-button device, a long tap that sent BTN_TOUCH event would turn on text mode. Test: Allow detecting touch inputs. Swiping (up, down, enter) works on angler, angelfish, dorado respectively. Bug: 36169090 Change-Id: I4bc882b99114ce4ab414f8bdb8f4f7a525b8a8fd
2017-07-21Build libminui with BOARD_VNDK_VERSIONJiyong Park1-1/+1
Use libdrm_platform which is a platform variant of libdrm. Bug: 63741047 Bug: 37342627 Test: BOARD_VNDK_VERSION=current m -j libminui Test: ryu recovery graphics test shows various graphics Change-Id: Ifd2c1432781a96538585cdf818aa728d628a2f5a Merged-In: Ifd2c1432781a96538585cdf818aa728d628a2f5a (cherry picked from commit a48c494f138ddb99320583d00120674be1e3297c)
2017-07-19Fix the android-cloexec-* warnings in bootable/recoveryTianjie Xu1-1/+1
Add the O_CLOEXEC or 'e' accordingly. Bug: 63510015 Test: recovery tests pass Change-Id: I7094bcc6af22c9687eb535116b2ca6a59178b303
2017-07-19Build libminui with BOARD_VNDK_VERSIONJiyong Park1-1/+1
Use libdrm_platform which is a platform variant of libdrm. Bug: 63741047 Bug: 37342627 Test: BOARD_VNDK_VERSION=current m -j libminui Test: ryu recovery graphics test shows various graphics Change-Id: Ifd2c1432781a96538585cdf818aa728d628a2f5a
2017-04-29minui: Fix breakage in graphics_adf.Alistair Strachan1-1/+2
When graphics_adf was refactored in 557fa1f, a class member was introduced that was not initialized to zero. This meant that the first time Flip() was called, current_surface would have a junk value and cause a bad pointer rereference, crashing recovery. Make sure current_surface is initialized to 0 for the first Flip(). Test: Ran recovery on a device using the ADF backend. Change-Id: I9b8fac0a4d48cac990e5e9808a071c232de1ebfb
2017-03-29Merge "Add the missing sr-Latn into png files and rename the png locale header" am: 713d915636 am: dc235b5ab9Tianjie Xu3-13/+33
am: 5ec12126f0 Change-Id: Ia6b861c91958d3be23a4a7456d6d5d8e4a1607c8 (cherry picked from commit 9166f66eee883d6d6cc280a6c355e5528bb4a3f0)
2017-03-25Add the missing sr-Latn into png files and rename the png locale headerTianjie Xu3-13/+33
Switch the locale header in the png files from Locale.toString() to Locale.toLanguageTag(). For example, en_US --> en-us and sr__#Latn --> sr-Latn. Also clean up recovery a bit to expect the new locale format. Bug: 35215015 Test: sr-Latn shows correctly under graphic tests && recovery tests pass Change-Id: Ic62bab7756cdc6e5f98f26076f7c2dd046f811db
2017-03-17Add the missing #include of <functional>.Tao Bao1-0/+2
For the use of std::function and std::bind. They were relying on the transitive inclusion from <minui/minui.h>. Test: mmma bootable/recovery Change-Id: Ia138e1cbdd035b11d6cdca9e16c5591303b6ee13
2017-02-23Add a missing #include for openat(2).Elliott Hughes1-0/+1
Bug: https://code.google.com/p/android/issues/detail?id=64374 Test: builds Change-Id: I7d7650463197710657820a1adce51f71c1b01415
2017-02-11minui: Move graphics_{adf,drm,fbdev} into classes.Tao Bao8-271/+333
This CL defines minui_backend as an interface, and expresses the three backends (adf, drm and fbdev) as subclasses to the interface. Test: 'Run graphics test' on N9, Pixel C and N5X. Change-Id: I0e23951c7b2e2ff918957a8d9fc8b0085b6e5952
2017-02-09minui: Save errno before calling close().Tao Bao1-1/+2
Otherwise errno would be overwritten when calling close(2). Test: mmma bootable/recovery Change-Id: I661e46b1b040f550639a728aa2683e91621b4307
2017-02-07minui: Clean up graphics_drm.cpp.Tao Bao1-351/+297
Remove unneeded header includes. Switch a few memset() to '= {}' style. Otherwise mostly cosmetic changes like reformatting. Test: 'Run graphics test' on ryu (which is a DRM device). Change-Id: I4b0ab2dc0da69a690f09e4f0674b8377de662962
2017-02-07minui: Clean up graphics_fbdev.cpp.Tao Bao1-139/+129
Remove unneeded header includes. Otherwise mostly cosmetic changes like reformatting. Test: 'Run graphics test' on bullhead (which uses fbdev). Change-Id: I9b92c96128fa332ac940f73764f9c5fc93ff6c8c
2017-02-07minui: Clean up graphics_adf.cpp.Tao Bao1-191/+156
Remove unneeded header includes. Switch a few memset() to '= {}' style. Otherwise mostly cosmetic changes like reformatting. Test: 'Run graphics test' on N9 (which is an ADF device). Change-Id: If008af18ddae9521f53216b581d882d5eed76d41
2017-02-03minui: Minor clean up to graphics.cpp.Tao Bao1-62/+1
Remove unneeded header includes. Remove the dead code in gr_test() (already commented out). Similar tests have been covered by the "Run graphics test" from recovery menu. Test: mmma -j32 bootable/recovery Change-Id: If977c1b780602f5c5054469a3dae4fd85f34ab1a
2017-01-23minui: Move callback functions to std::function.Tao Bao3-121/+113
Also make minor clean up to the header includes. Test: mmma bootable/recovery system/core/healthd system/extra/slideshow Change-Id: I3bfcf2c0e203c26a98ee08f1f8036c68356a69fd
2017-01-19Add checkers and tests for empty locale in PNG fileTianjie Xu1-1/+3
match_locale() will return false for empty locale string in the PNG file. Also add a manual test to validate if a PNG file is qualified to use under recovery. Bug: 34054052 Test: recovery_manual_test catches invalid PNG files successfully & Locale_test passed Change-Id: Id7e2136e1d8abf20da15825aa7901effbced8b03
2017-01-17minui: Export minui/minui.h.Tao Bao8-17/+32
For libminui static and shared libraries. Test: build Change-Id: Ib30dc5e2ef4a3c8b3ca3a0cec68cb65e229a0c16
2016-11-16Remove unnecessary uses of reinterpret_cast.Rahul Chaudhry2-3/+3
Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: I66f8f6026ed732a504504ade93ff196dc8b727ca
2016-11-16Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry4-12/+12
static_cast is preferable to reinterpret_cast when casting from void* pointers returned by malloc/calloc/realloc/mmap calls. Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: Iaffd537784aa857108f6981fdfd82d0496eb5592 Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d
2016-11-16Have gr_init_font alloc memory for the fontDamien Bargiacchi2-8/+16
Change-Id: I8ccf369d52011bc5d07d8e041fe558ce734a78fc (cherry picked from commit d00f5eb63a8e4690f9bef1e943d539d052444d9b)
2016-11-15Support use of custom fonts in miniuiDamien Bargiacchi3-54/+72
Bug: 29547343 Change-Id: I398160c85daac90ffab2fa9bb2e96795b9e9885a (cherry picked from commit 35fff61b1c0d736d090a1cd1bb4e99141cc88ad8)
2016-11-11Fix "ordered comparison between pointer and zero".MinSeong Kim1-1/+1
From Clang 4.x releases, DR583 and DR1512 will be addressed. This patch, in advance, fixes the error(s). Test: `mmma bootable/recovery` Change-Id: I29dc85ae681307c322ab3a698c3f3bbad1c784ee Signed-off-by: MinSeong Kim <minseong.kim@linaro.org>
2016-11-09Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry4-13/+13
static_cast is preferable to reinterpret_cast when casting from void* pointers returned by malloc/calloc/realloc/mmap calls. Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: I151642d5a60c94f312d0611576ad0143c249ba3d
2016-09-30Turn on -Werror for recoveryTianjie Xu1-0/+2
Also remove the 0xff comparison when validating the bootloader message fields. As the fields won't be erased to 0xff after we remove the MTD support. Bug: 28202046 Test: The recovery folder compiles for aosp_x86-eng Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab (cherry picked from commit 7aa88748f6ec4e53333d1a15747bc44826ccc410)
2016-09-30Turn on -Werror for recoveryTianjie Xu1-0/+2
Also remove the 0xff comparison when validating the bootloader message fields. As the fields won't be erased to 0xff after we remove the MTD support. Bug: 28202046 Test: The recovery folder compiles for aosp_x86-eng Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
2016-09-09Have gr_init_font alloc memory for the fontDamien Bargiacchi2-8/+16
Change-Id: I8ccf369d52011bc5d07d8e041fe558ce734a78fc
2016-08-19Support use of custom fonts in miniuiDamien Bargiacchi3-54/+72
Bug: 29547343 Change-Id: I398160c85daac90ffab2fa9bb2e96795b9e9885a
2016-08-06Recovery mode UI flickerxinglong.zhu2-1/+24
[root cause ] miniui has no mechanism to protect the buffer which is displaying [changes ] recovery [side effects] ui show [self test ] sc9850-2 general operation has not display abnormal [reviewers ] xinglong.zhu Signed-off-by: xinglong.zhu <xinglong.zhu@spreadtrum.com> [change_type ] AOB --> google_original [tag_product ] common Change-Id: I989a0b2943ff6070a0e98718cfbe95144510d3a2
2016-07-29Add docs on regeneration background text imageTianjie Xu1-2/+2
Also add a missing string in the recovery_l10n APP. Bug: 30415666 Change-Id: Ice2a9f7cad4ebe332b427bc0c7a9adccb6cf3af3
2016-07-27Fix clang-tidy performance warnings.Chih-Hung Hsieh2-2/+2
* Use const reference parameter type to avoid unnecessary copy. * Use more efficient overloaded string methods. Bug: 30407689 Bug: 30411878 Change-Id: Iefab05c077367f272abf545036b853e8a295c8cd Test: build with WITH_TIDY=1
2016-05-17DO NOT MERGE Use updated libpng APIMatt Sarett1-10/+10
BUG:23265085 Change-Id: Ibc521fae11dad22283d8469329326ef79525b414
2016-05-06Keep ADF device alive for the lifetime of the minui backendJonathan Hamilton1-6/+8
Some ADF drivers do some amount of state cleanup when the ADF device node is closed, making and attempts to draw using it fail. This changes the minui ADF backend to keep the adf_device open until it is exited, fixing issues on such devices.
2016-04-20Fix matches_locale functionTianjie Xu2-13/+10
matches_locale was expecting input locale string to have at most one underscore; as a result "zh_CN_#Hans" ignores "zh_CN" and matches into "zh". Fix the match function and add unit tests. Bug: 27837319 Change-Id: I4e8a66f91cae6ac2a46b6bf21f670d5ea564c7c8
2016-04-18Fix google-runtime-int warnings.Chih-Hung Hsieh1-6/+9
Bug: 28220065 Change-Id: Ida199c66692a1638be6990d583d2ed42583fb592
2016-04-15Update the system update animation.Elliott Hughes1-2/+0
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
2016-02-19Fix minui cleanup path on error.Elliott Hughes1-3/+3
bootable/recovery/minui/resources.cpp:321:21: warning: Branch condition evaluates to a garbage value if (surface[i]) free(surface[i]); ^~~~~~~~~~ bootable/recovery/minui/resources.cpp:424:13: warning: Value stored to 'len' during its initialization is never read int len = row[4]; ^~~ ~~~~~~ Bug: http://b/27264652 Change-Id: Icc1a914c59d6a89dab1b752b2cd2b40549566481
2016-02-11Fix some memory leaks.Yabin Cui1-13/+9
Bug: 26906328 Change-Id: Iebaf03db0cb3054f91715f8c849be6087d01b27b
2016-01-08Revert "Byte swap to support BGRA in recovery mode"Andriy Naborskyy1-12/+0
This reverts commit e5879c3639789d61803605c12371a4f291e0b3cc. The swap in page flip code is not needed any more. New changes take care of ABGR and BGRA formats swapping bytes in png and drawing routines See commit fd778e3e406a7e83536ea66776996f032f24af64 Bug: 26243152 Change-Id: I313ee41bee2c143b4e5412515285a65ac394ec77
2015-12-16res: Embed FPS into icon_installing.png.Tao Bao2-8/+17
We allow vendor-specific icon installing image but have defined private animation_fps that can't be overridden. This CL changes the image generator to optionally embed FPS (otherwise use the default value of 20) into the generated image. For wear devices, they are using individual images instead of the interlaced one. Change the animation_fps from private to protected so that it can be customized. Bug: 26009230 Change-Id: I9fbf64ec717029d4c54f72316f6cb079e8dbfb5e
2015-11-16recovery: Switch to clangTao Bao1-0/+1
And a few trival fixes to suppress warnings. Change-Id: Id28e3581aaca4bda59826afa80c0c1cdfb0442fc (cherry picked from commit 80e46e08de5f65702fa7f7cd3ef83f905d919bbc)
2015-07-02Add drm support to minuiStéphane Marchesin4-0/+484
Bug: 22231636 Change-Id: I103c8e906b7dd9862b7bb89d8642268e9a3006b4 Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
2015-06-03recovery: Switch to clangTao Bao1-0/+1
And a few trival fixes to suppress warnings. Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65
2015-04-30Check all lseek calls succeed.Elliott Hughes1-1/+2
Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek. Bug: http://b/20625546 Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b (cherry picked from commit 7bad7c4646ee8fd8d6e6ed0ffd3ddbb0c1b41a2f)
2015-04-30Check all lseek calls succeed.Elliott Hughes1-1/+2
Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek. Bug: http://b/20625546 Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b
2015-04-15Don't use typedefs that hide *s.Elliott Hughes6-43/+38
gr_surface was causing confusion for no good reason. Change-Id: If7120187f9a00dd16297877fc49352185a4d4ea6
2015-04-14Move the menu header out of the menu.Elliott Hughes2-2/+2
This makes it easier for us to deal with arbitrary information at the top, and means that headers added by specific commands don't overwrite the default ones. Add the fingerprint back, but broken up so it fits even on sprout's display. Change-Id: Id71da79ab1aa455a611d72756a3100a97ceb4c1c
2015-04-10Switch minui over to C++.Elliott Hughes8-102/+82
Change-Id: I59e08a304ae514a3fdb6fab58721f11670bc1b01
2015-04-10Fix ScreenRecoveryUI to handle devices without power/up/down.Elliott Hughes2-4/+9
Currently fugu has a custom subclass to handle this. The default code supports devices with trackballs but not all shipping Nexus devices? That's just silly. Change-Id: Id2779c91284899a26b4bb1af41e7033aa889df10
2015-04-10Add ev_iterate_available_keys to minui.Elliott Hughes3-94/+126
This lets us recognize whether we have up/down/power, say, and tailor the UI accordingly. Change-Id: If94e454f14243b59d2f473ac9a436bd60591da01
2015-03-24Remove support for Cupcake kernels.Elliott Hughes1-17/+0
Change-Id: I7376b9d3c1e11d19e164072d6e9d09c1183114a0
2015-03-24Fix recovery image text rendering.Elliott Hughes2-25/+22
Previously most devices would lose the character before a line wrap. The log's text rendering was starting at offset 4 but none of the arithmetic was taking this into account. It just happened to work on the Nexus 9's 1536-pixel wide display (1536/18=85.3) but not on a device such as the Nexus 5 (1080/18=60). The only active part of this change is the change from 4 to 0 in the gr_text call. The rest is just a few bits of trivial cleanup while I was working out what was going on. Change-Id: I9279ae323c77bc8b6ea87dc0fe009aaaec6bfa0e
2015-02-26Drop hardcoded LOCAL_C_INCLUDES from minui/Android.mkTrevor Drake1-4/+1
The zlib include was not required. libpng is now handled by referencing the libpng static library Change-Id: Ie4e0abad3fff5b763eba363d3d0fa96128ff49bc
2015-02-12Fix Droid and animation color in recovery modeTony Kuo5-14/+25
[Problem] Droid and animation color in recovery mode are incorrect [Modify] - Add support for flipping (zero copy) with RECOVERY_ABGR. - Decodes PNG files to BGRA directly, and other fills, text and alpha blending are also done directly in BGRA (i.e. blits can still bypass conversion) - Remove the BGRA workaround added previous for single buffer mode (f766396) Bug:19216535 Change-Id: Ie864419fc6da776ff58b2d02e130f203c194500f Signed-off-by: Tony Kuo <tony.kuo@mediatek.com>
2015-02-11recovery: Handle EV_SW eventsAjay Dudani1-2/+2
Change-Id: I29c13a941067cd1bbdced3bd67fd93293347d7b6
2015-02-11recovery: Generate libminui dynamic libraryAjay Dudani1-0/+7
Allow factory test images to use minui functionaltiy by making use of libminui dynamic library. Change-Id: I63e77420d5addbcc6eebeedc213f629085766b4c
2015-01-30Add missing includes.Elliott Hughes5-0/+6
Change-Id: I06ea08400efa511e627be37a4fd70fbdfadea2e6
2014-11-14Byte swap to support BGRA in recovery modeHeather Lee Wilson1-0/+12
Fixes color palate of recovery mode when double buffer enabled. Bug: 18169447 Change-Id: Ia50b0fb9afd8001dfd740c09ce109fa421e691f7
2014-06-12minui: avoid random screen frame at startupJoey Pan1-0/+2
Clear framebuffer at init. [toddpoynor@google.com: forward port] Change-Id: Ie98c7724cd974dcacef3e3559a6fe492864a5e72
2014-05-14Support BGRA framebufferDaniel Leung1-0/+13
The re-designed recovery graphics code only supports RGB{_,X,A} framebuffer, and this patch adds support for BGRA framebuffer. Change-Id: I3780c8288088f497fa248f3492c54f43834a8598 Signed-off-by: Daniel Leung <daniel.leung@intel.com> Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com> Reviewed-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com> Tested-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com> Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com> Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
2014-04-26recovery: minui: add adf backendGreg Hackmann4-5/+266
Change-Id: I1ad97b5b62bddbcb1104fa0b4e54415b793a4194 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-20restore minui support for paletted images with < 8 bitsDoug Zongker1-1/+1
The PNG image loaders should support images that use palettes requiring fewer than 8 bits. Change-Id: Ibcb0ff6f04aea8de54b03c0efa7a79e9b3635146
2014-03-18fix error log statementDoug Zongker1-1/+1
We were printing the address of channels instead of the value there. Change-Id: I652340c7c1a0abaf01af555e54d2c0366d21ad78
2014-03-17refactor image resource loading code in minuiDoug Zongker3-238/+242
Reduce the number of copies of libpng boilerplate. Rename res_create_* functions to be more clear. Make explicit the use of the framebuffer pixel format for images, and handle more combinations of input and output (eg, loading a grayscale image for display rather than use as a text alpha channel). Change-Id: I3d41c800a8f4c22b2f0167967ce6ee4d6b2b8846
2014-03-14Recovery 64-bit compile issuesMark Salyzyn2-4/+5
Change-Id: I92d5abd1a628feab3b0246924fab7f97ba3b9d34
2014-03-11separate fbdev-specific code out from minuiDoug Zongker5-152/+268
Isolate the code that interacts with fbdev, in preparation for adding a new backend. Change-Id: I19105e9da1ca6408cebc110f7e2bb5abfb481ee9
2014-03-11remove pixelflinger from recoveryDoug Zongker3-266/+348
Recovery now draws directly to the framebuffer by rolling its own graphics code, rather than depending on libpixelflinger. The recovery UI is modified slightly to eliminate operations that are slow with the software implementation: when the text display / menu is turned on, it now appears on a black background instead of a dimmed version of the recovery icon. There's probably substantial room for optimization of the graphics operations. Bug: 12131110 Change-Id: Iab6520e0a7aaec39e2ce39377c10aef82ae0c595 Conflicts: minui/resources.c
2014-03-11change how recovery animation is implementedDoug Zongker2-3/+180
Instead of one 'base' installing image and a number of overlay images that are drawn on top of it, we represent the installing animation with one PNG that contains all the animation frames, interlaced by row. The PNG is expected to have a text chunk with the keyword 'Frames' and a value that's the number of frames (as an ascii string). This representation provides better compression, removes the need to subclass ScreenRecoveryUI just to change the position of the overlay or number of frames, and doesn't require gr_blit() to support an alpha channel. We also remove the 'indeterminate' progress bar used when wiping data and/or cache. The main animation serves the same purpose (showing that the device is still alive); the spinning progress bar has been redundant for a while. This changes the default recovery animation to include the antenna-wiggling and gear-turning that's used in the Nexus 5 recovery animation. Change-Id: I51930a76035ac09969a25472f4e572b289418729 Conflicts: screen_ui.cpp screen_ui.h
2014-03-11separate fbdev-specific code out from minuiDoug Zongker5-152/+268
Isolate the code that interacts with fbdev, in preparation for adding a new backend. Change-Id: I19105e9da1ca6408cebc110f7e2bb5abfb481ee9
2014-03-11remove pixelflinger from recoveryDoug Zongker3-273/+347
Recovery now draws directly to the framebuffer by rolling its own graphics code, rather than depending on libpixelflinger. The recovery UI is modified slightly to eliminate operations that are slow with the software implementation: when the text display / menu is turned on, it now appears on a black background instead of a dimmed version of the recovery icon. There's probably substantial room for optimization of the graphics operations. Bug: 12131110 Change-Id: Iab6520e0a7aaec39e2ce39377c10aef82ae0c595
2014-03-07change how recovery animation is implementedDoug Zongker2-3/+180
Instead of one 'base' installing image and a number of overlay images that are drawn on top of it, we represent the installing animation with one PNG that contains all the animation frames, interlaced by row. The PNG is expected to have a text chunk with the keyword 'Frames' and a value that's the number of frames (as an ascii string). This representation provides better compression, removes the need to subclass ScreenRecoveryUI just to change the position of the overlay or number of frames, and doesn't require gr_blit() to support an alpha channel. We also remove the 'indeterminate' progress bar used when wiping data and/or cache. The main animation serves the same purpose (showing that the device is still alive); the spinning progress bar has been redundant for a while. This changes the default recovery animation to include the antenna-wiggling and gear-turning that's used in the Nexus 5 recovery animation. Change-Id: I51930a76035ac09969a25472f4e572b289418729
2014-02-06recovery: fix building with pointer-to-int errors turned onColin Cross1-1/+1
Use intptr_t/uintptr_t to cast between pointer and int to allow building with -Werror=pointer-to-int-cast and Werror=int-to-pointer-cast turned on. Cast to char* instead of unsigned int for pointer arithmetic. Change-Id: Ia862306fdcca53866b330e8cf726f3d62f2248a0
2013-11-26minui: do not use flexible array initializationsynergy dev1-1/+1
Avoiding the use of gnu extensions improves code portability Change-Id: I441a49ce08b6ecb1d735ca453552fa92026c5016
2013-09-26fix use of RGBA images in minuiDoug Zongker1-3/+11
Bug: 10934401 Change-Id: I471b30e5b2e877c620e4a0a524e950cddbc6d2c0
2013-09-17recovery: fix epoll events type to uint32_tTodd Poynor2-3/+3
Change-Id: I5db9987102201c18821acb45d1f824e9865a1451
2013-09-12minui: add ev_get_epollfd() to retrieve epoll file descriptorTodd Poynor2-0/+6
To allow use of ev_* functions with an external main loop. Change-Id: If73717b64d7c455ca726b90a815a31c1edf52544
2013-09-12minui: convert ev_*() event interface to epollTodd Poynor2-27/+58
Help enable external main loop combined with ev_*() key event processing. Specify EPOLLWAKEUP to hold a wakelock on any event, assuming this is needed (may need to make this optional). Convert callback events parameter to unsigned int. Change-Id: Ib5e09abbd7724ffd830e2cf8e25e7eb59d3aa072
2013-08-27Update libpng API usageJohn Reck1-12/+12
Remove usage of deprecated methods Change-Id: I747568a2c8c0c65ecbc9a3da4bac7b9cac7708ab
2013-08-13Fix libpng API usageJohn Reck1-12/+12
Remove usage of deprecated methods that were removed in 1.6 Change-Id: I2a669bf5201197f60adfdbe512fd729bebb74f9c
2013-07-09recovery: move log output to stdoutDoug Zongker1-2/+2
Recovery currently has a random mix of messages printed to stdout and messages printed to stderr, which can make logs hard to read. Move everything to stdout. Change-Id: Ie33bd4a9e1272e731302569cdec918e0534c48a6
2013-03-07more font improvements and cleanupDoug Zongker3-13/+247
Get rid of the notion of a font's "ascent"; the reference point for drawing is the top-left corner of the character box rather than the baseline. Add some more space between the menu entries and make the highlight bar around the text. Replace the default font.png with two images; the build system will include one or the other based on the resolutions of the device. Restore the original compiled-in bitmap font, to fall back on when font.png can't be found (eg, in the charger binary). Add support for bold text (when a font.png image is used). Change-Id: I6d211a486a3636f20208502b1cd2aeae8b9f5b02
2013-03-05recovery: change font for menus to be an imageDoug Zongker3-246/+27
Instead of representing the font used for menus and log messages in the recovery binary, load it from a resource PNG image. This allows different devices to substitute their own font images. Change-Id: Ib36b86db3d01298aa7ae2b62a26ca29e6ef18014
2012-12-19add optional overscan compensation to recovery graphicsDoug Zongker3-5/+32
If your screen is a TV, it may not actually be displaying the edges of the framebuffer. Allow specifying an overscan percentage, and move each edge of the framebuffer in by that percent of the width/height. (The gr_* layer just lies to the caller about the size of the framebuffer, telling the caller it's smaller than it really is, and offsets all drawing commands to match.) Change-Id: I11bb2feb39ae522bd3e957a14ebdecf3609e0fdc
2012-09-04minor recovery fixesDoug Zongker2-6/+6
- protect against missing/malformed bitmaps: fail to display them but don't crash. - don't draw animation overlays until the overlay offset is computed. - logging cleanup Change-Id: Ieb1c155cfbb11e643000bdb5d1a57900c8757739
2012-08-30recovery locale handling fixesDoug Zongker1-8/+0
- change locale filename to "last_locale" so the main system doesn't delete it - clean up some chatty logging - update images with real German (other languages TBD) Change-Id: I2ebb4ed4e054bd1808a3042d9efbb2c18f3a044d
2012-08-23add simple text to recovery UIDoug Zongker3-0/+168
- recovery takes a --locale argument, which will be passed by the main system - the locale is saved in cache, in case the --locale argument is missing (eg, when recovery is started from fastboot) - we include images that have prerendered text for many locales - we split the background states into four (installing update, erasing, no command, error) so that appropriate text can be shown. Change-Id: I731b8108e83d5ccc09a4aacfc1dbf7e86b397aaf
2012-08-21Fixing trivial warnings for libminuiEdwin Vane1-2/+2
After fixing three trivial warnings, libminui builds cleanly with clang. Change-Id: Id7c6228295427a5ed3c774c5f90e88a28336c1f7 Author: Edwin Vane <edwin.vane@intel.com> Reviewed-by: Kevin P Schoedel <kevin.p.schoedel@intel.com>
2012-07-20minui: fix screen update issueDevin Kim1-2/+4
yres_virtual value is set incorrectly, causing serveral images to be skipped. Change this value according to the number of buffers to fix this issue. from: codeaurora.org minui: Display the battery charging image correctly commit: 581a4dead6b96579a13ff22e2454c1f329731679 Change-Id: I10f5d1c6cc37705f0287c7dd517082de2e11d264 Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-07-12graphics: add support for "single buffering"Octavian Purdila1-2/+10
When we don't have enough video memory for double buffering we fallback to "single buffering". Change-Id: I8bfab6d8cd6b54f0cc6c67edc41a4c37d8fbd4ba Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2012-07-11allow double-quotes or not in TARGET_RECOVERY_PIXEL_FORMATDoug Zongker1-2/+6
Change-Id: I0bf22c87c51a34ee4a839c4966277fad8150bd59
2011-10-31turn recovery into a C++ binaryDoug Zongker1-0/+8
Change-Id: I423a23581048d451d53eef46e5f5eac485b77555
2011-10-28turn recovery into a C++ binaryDoug Zongker1-0/+8
Change-Id: I68a67a4c8edec9a74463b3d4766005ce27b51316
2011-10-13minui: add ability to synchronize current key stateDima Zavin2-2/+38
If a key is down prior to the time of initialization, we would not get the down event for the key, and thus think that the key is not pressed. Add an interface that allows one to provide a callback to execute on all keys that are currently down. Change-Id: I2a4096c0cb4c7c7a9a80d207835f168a0b418413 Signed-off-by: Dima Zavin <dima@android.com>
2011-09-27fix problem where the screen is sometimes all black in recoveryDoug Zongker1-0/+3
Change-Id: Ifa0b59e43eaf0bea9435aa4d96c5b0fc4f10fbfe
2011-09-02minui: events: only open input devices with EV_KEY and/or EV_RELDima Zavin1-0/+17
Change-Id: I8283d7aaa0f66d488f462cd108350cc49657a745 Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02minui: events: add ability to poll on non-input fdsDima Zavin2-3/+23
Change-Id: Iad52a6f2adcae0068d252d6163586f9d7b93121d Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02minui: events: refactor event acquisitionDima Zavin2-15/+49
Events are now delivered through a callback mechanism during a call to ev_dispatch(). This will allow us to extend the events code to handle other devices/fds, not just input. One such example is the ability to process uevents. During initialization, we provide an input callback to ev_init that gets called when a new event is encountered during dispatch. ev_get has been removed and replaced with ev_get_input() helper function that can be called from inside the callback to attempt to get an input event. The existing client of ev_get in recovery has been split up such that the input thread just calls ev_wait(); ev_dispatch(); and the input_callback handles individual events by using the ev_get_input() helper. Change-Id: I24d8e71bd1533876b4ab1ae751ba200fea43c049 Signed-off-by: Dima Zavin <dima@android.com>
2011-08-30minui: graphics: add interface for framebuffer blank/unblankDima Zavin2-0/+13
Change-Id: I5c3ee61cbf6fadae50f10b9f2e73caceaa5048a7 Signed-off-by: Dima Zavin <dima@android.com>
2011-08-30minui: graphics: add ability to query font sizeDima Zavin2-0/+7
Change-Id: I5e8f477b7b205794f2975f12e6b6010c177f6052 Signed-off-by: Dima Zavin <dima@android.com>
2011-06-24Get the correct line_length.Michael Ward1-2/+37
Set the BPP and other fields and write it back, so the line_length comes back correctly. Change-Id: I85e4e8223c79b9394ae1fb609b3026de62027ab8
2011-06-23Graphics can handle stride != xres, and BGRA support.Michael Ward2-12/+18
Change-Id: Ifee94ac08028e62a40241a089ac7c36346fea3a3
2011-03-05allow paletted RGB images in recoveryDoug Zongker1-2/+7
Recovery assumes any paletted images are in RGBA format. Make it handle both RGB and RGBA paletted images. Bug: 3514884 Change-Id: I517cd571aa3f434dacacc33a774236260aec20ef
2011-03-01make recovery UI images more general; allow for installation animationDoug Zongker1-0/+2
Change some of the UI parameters (# of indeterminate progress bar frames, fps, etc.) from #defined constants to variables that can be set by the device-specific recovery_ui code (via a new function). Support overlaying different images on top of the base installation icon to animate it. Make the FPS control more accurate. Change-Id: I9268b389b7ea6b3ed9e0c7eae37baf4272e60edd
2011-01-14option to allow recovery to use 24-bit graphics in UIDoug Zongker2-10/+22
Add "RECOVERY_24_BIT := true" to the device's BoardConfig.mk to use 24-bit framebuffers in the recovery ui. Change-Id: Iaede138bf7870becf237f12f1c0e49c9ff82d007
2010-11-01clear recovery framebuffers on allocation; display icon right after ui_initDoug Zongker1-1/+2
Make ui_init() clear the framebuffer memory it maps in so the user isn't treated to a visible flash of random bits on recovery startup. Call ui_set_background() (to show the installing icon) right after ui_init() to display something while device_recovery_start() is working (which can take a second or two on some devices). Bug: 3145331 Change-Id: I11e7859fab5847370ea4f4932c3fb1558af26c5d
2009-11-13eclair snapshotJean-Baptiste Queru2-16/+1
2009-10-09simplify construction of the recovery progress barDoug Zongker1-3/+8
Instead of six separate images for the left end, right end, and tiled center portion of the full and empty progress bars, just use two images: a full bar and an empty bar. Draw the left side of the full bar and the right side of the empty one, moving the boundary rightward to "fill" the bar. This makes recovery trivially smaller, and allows fancier images to be used as progress bars. Support paletted PNG images as resources.
2009-06-11split out device-specific recovery UI code into vendor directoriesDoug Zongker1-16/+0
Take some device-specific details of the recovery UI (eg, what keys to press to bring up the interface and perform actions, exact text of the menu, etc.) and split them out into separate C functions. Arrange to take implementations of those functions from the appropriate vendor directory at build time. Provide a default implementation in case no vendor-specific one is available.
2009-06-06Force the fb into 16 bpp mode in case the hw has some other default.Rebecca Schultz Zavin1-0/+1
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2009-03-28AI 143289: am: CL 143128 Use PNG instead of BMP for recovery image icons. This savesDoug Zongker1-100/+67
about 60k from the recovery and system images. Original author: dougz Merged from: //branches/donutburger/... Automated import of CL 143289
2009-03-27AI 143128: Use PNG instead of BMP for recovery image icons. This savesDoug Zongker1-100/+67
about 60k from the recovery and system images. Automated import of CL 143128
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project7-0/+946
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project7-946/+0
2009-02-11auto import from //branches/cupcake/...@130745The Android Open Source Project1-16/+33
2008-12-18Code drop from //branches/cupcake/...@124589The Android Open Source Project1-33/+24