1. 08 Sep, 2017 1 commit
    • Tao Bao's avatar
      ui: Manage menu_ with std::vector. · 17fa5c7c
      Tao Bao authored
      Prior to this CL, menu_ is allocated with a fixed length of text_rows_.
      However, because we support scrollable menu in wear_ui, there might be
      more menu entries than text_rows_, which would lead to out-of-bounds
      array access. This CL addresses the issue by switching to std::vector.
      
      Bug: 65416558
      Test: Run 'View recovery logs' on angler.
      Test: Set large margin height that leaves text_rows less than 21. Then
            run 'View recovery logs' with 21 menu entries.
      Change-Id: I5d4e3a0a097039e1104eda7d494c6269053dc894
      (cherry picked from commit e15d7a5104978cd8399501636aec0df9c1a4823c)
      17fa5c7c
  2. 17 Aug, 2017 1 commit
    • Tao Bao's avatar
      screen_ui: Fix a case that may truncate the last char. · 2cf6fe2c
      Tao Bao authored
      ScreenRecoveryUI::DrawWrappedTextLines() should be called with
      kMarginWidth only. Because it's using a line limit of text_cols_,
      which is unaware of kMenuIdent.
      
      Bug: 64293520
      Test: No missing char with long header text.
      Change-Id: Ib4d08de2c56473a483ff9964eb6cec31f8a74c9a
      (cherry picked from commit 13aa4a902ba2fa304fc9fe826f797a4e0e2182b7)
      2cf6fe2c
  3. 16 Aug, 2017 1 commit
    • Tao Bao's avatar
      screen_ui: Word-wrap menu headers. · ee6fefd2
      Tao Bao authored
      This CL adds ScreenRecoveryUI::DrawWrappedTextLines() to better handle
      long menu header texts. It does a word wrap at spaces, if available.
      This avoids fixed-length menu headers being truncated on small screens.
      
      Bug: 64293520
      Test: On bullhead, boot into recovery with --prompt_and_wipe_data, and
            check the prompt texts.
      Change-Id: Ia22746583516dd230567a267584aca558429395e
      (cherry picked from commit 2bbc6d642d1fbfb007905d95b629fe5f833b2a1b)
      ee6fefd2
  4. 13 Aug, 2017 1 commit
    • Tao Bao's avatar
      Allow customizing WearRecoveryUI via Makefile variables. · 016120f3
      Tao Bao authored
      With the following Makefile variables, we can reduce the work of writing
      (copy/pasting) device-specific WearRecoveryUI classes.
      
      The list of Makefile variables (the ones useful for Wear devices):
      - TARGET_RECOVERY_UI_MARGIN_HEIGHT (default: 0)
      - TARGET_RECOVERY_UI_MARGIN_WIDTH (default: 0)
        Specify the margin space that we don't want to display texts. They
        replace the former outer_width and outer_height.
      
      - TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD (default: 50)
      - TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD (default: 90)
        Specify the sensitivity of recognizing a swipe. Devices give absolute
        positions, so for some devices we need to adjust the thresholds.
      
      - TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE
        Specify the progress bar vertical position, which should be adjusted
        to the actual height of a device. It replaces the former
        progress_bar_y.
      
      - TARGET_RECOVERY_UI_ANIMATION_FPS (default: 30)
        Specify the animation FPS if using device-specific animation images.
        It replaces the former animation_fps.
      
      Devices can specify "TARGET_RECOVERY_UI_LIB := librecovery_ui_wear",
      with optionally defined Makefile vars above, in BoardConfig.mk to
      customize their WearRecoveryUI.
      
      Also remove the obsolete wear_touch.{cpp,h}, which has been merged into
      ui.cpp in commit 5f8dd9951d986b65d98d6a9ea38003427e9e46df.
      
      Bug: 64307776
      Test: Change the device BoardConfig.mk and test recovery image.
      Change-Id: Id0fb2d4e3977ab5ddd31e71f9535470cab70e41b
      (cherry picked from commit 0470ceea381775b09eee931858c3320be88cc637)
      016120f3
  5. 13 Jul, 2017 1 commit
    • Tao Bao's avatar
      Fix the missing char when showing recovery logs. · ca6ce2c8
      Tao Bao authored
      This is a regression when adding support for margin space in commit
      171b4c4c.
      
      We're losing one char when showing long log lines. Because text_ is
      aware of kMarginWidth, but not the the added indent (TEXT_INDENT).
      
      Test: 'View recovery logs' on angler, with no missing character.
      Change-Id: I284d54681d603e85e69d8e9c25173b1437a704df
      ca6ce2c8
  6. 06 Jul, 2017 2 commits
    • Luke Song's avatar
      Restructure vr_ui · c392888d
      Luke Song authored
      Get rid of pixel offset variables, and use makefile variables in
      BoardConfigs.
      
      Cherry picked from commit 81a8e4ca
      
      Bug: 37779982
      Test: Verified vr ui has same behavior.
      Change-Id: Ifbf44e27d7101aedbe3c0e6db4b8181d56efadfd
      c392888d
    • Luke Song's avatar
      Introduce VR recovery ui · edc6b52f
      Luke Song authored
      A version of screen ui with specific adjustments for vr device
      compatibility.
      
      Cherry picked from commit a44dba7f
      
      Bug: 37779982
      Test: "adb reboot recovery" to view
      Change-Id: If6b0f26c1b587f8d0176060685b5efb6c67593b1
      edc6b52f
  7. 02 Jul, 2017 1 commit
    • Tao Bao's avatar
      Update ScreenRecoveryUI::Draw* function signatures. · ea78d86b
      Tao Bao authored
      Move away from taking int* for the Y-offset. Change it to int and return
      the offset instead.
      
      Test: Check the recovery menu and 'Wipe data' menu.
      Change-Id: Ib15e070a0d576a0f8f66f35605cb8479e7071f26
      ea78d86b
  8. 30 Jun, 2017 1 commit
    • Tao Bao's avatar
      screen_ui: Compute the top and bottom gaps. · f95e686d
      Tao Bao authored
      We're not actually following the gaps as in the comments. For example,
      Nexus 6P is supposed to use 220dp and 194dp gaps (top and bottom
      respectively), but the actual numbers are 185dp and 194dp. Because the
      animation icon and text sizes don't match the ones claimed (animation:
      expected 200dp or 700px, actual 800px; text: claimed 14sp, actual 76px).
      The top gap changes (shrinks) as we compute the baselines bottom-up.
      
      This CL switches to using computed gaps: the major UI elements always
      stay vertically centered, with identical top and bottom gaps.
      
      Bug: 63093285
      Test: 'Run graphics test' on angler/volantis/fugu/ryu.
      Change-Id: I3cadbb34f728cf034afa47ac02a6deba8cb6b4e7
      (cherry picked from commit 3250f723)
      f95e686d
  9. 29 Jun, 2017 1 commit
    • Tao Bao's avatar
      screen_ui: Compute the top and bottom gaps. · 3250f723
      Tao Bao authored
      We're not actually following the gaps as in the comments. For example,
      Nexus 6P is supposed to use 220dp and 194dp gaps (top and bottom
      respectively), but the actual numbers are 185dp and 194dp. Because the
      animation icon and text sizes don't match the ones claimed (animation:
      expected 200dp or 700px, actual 800px; text: claimed 14sp, actual 76px).
      The top gap changes (shrinks) as we compute the baselines bottom-up.
      
      This CL switches to using computed gaps: the major UI elements always
      stay vertically centered, with identical top and bottom gaps.
      
      Bug: 63093285
      Test: 'Run graphics test' on angler/volantis/fugu/ryu.
      Change-Id: I3cadbb34f728cf034afa47ac02a6deba8cb6b4e7
      3250f723
  10. 24 Jun, 2017 2 commits
  11. 23 Jun, 2017 5 commits
    • Luke Song's avatar
      Restructure vr_ui · 9d4839c6
      Luke Song authored
      Get rid of pixel offset variables, and use makefile variables in
      BoardConfigs.
      
      Bug: 37779982
      Test: Verified vr ui has same behavior.
      Change-Id: Ifbf44e27d7101aedbe3c0e6db4b8181d56efadfd
      (cherry picked from commit 81a8e4ca)
      9d4839c6
    • Luke Song's avatar
      Restructure vr_ui · 81a8e4ca
      Luke Song authored
      Get rid of pixel offset variables, and use makefile variables in
      BoardConfigs.
      
      Bug: 37779982
      Test: Verified vr ui has same behavior.
      Change-Id: Ifbf44e27d7101aedbe3c0e6db4b8181d56efadfd
      81a8e4ca
    • Tao Bao's avatar
      Use Makefile variables to specify margin settings. · 855eafff
      Tao Bao authored
      Instead of defining device-specific UI class, this CL allows using
      Makefile variables to specify margin values directly.
      
      Values explicitly defined via TARGET_RECOVERY_UI_MARGIN_HEIGHT and
      TARGET_RECOVERY_UI_MARGIN_WIDTH will be used. Otherwise they will
      default to zero.
      
      Bug: 62732748
      Test: Specify the height and width and check recovery texts.
      Change-Id: Icb6f7466c8d407f877b93da38aebfdf7e6b41be7
      (cherry picked from commit a92d8fb4)
      855eafff
    • Tao Bao's avatar
      screen_ui: Allow setting screen margin space. · 8f7547ed
      Tao Bao authored
      For round screen or screens with rounded corners, we don't want to show
      texts within the margin which could otherwise be invisible.
      
      Move the density computation to ScreenRecoveryUI ctor so that the value
      can be used earlier.
      
      Note that this is similar to the existing stuff in wear UI (outer_width,
      outer_height). This CL gets ScreenRecoveryUI and WearRecoveryUI one-step
      closer.
      
      Bug: 62732748
      Test: Setting and not setting margin_{width,height}_ on angler. Check the
            recovery texts (recovery menu as well as 'View recovery logs').
      Change-Id: Ibf6238c9cc8949a42ed8a410e1c09d55b0b5a151
      (cherry picked from commit 87f46508)
      8f7547ed
    • Tao Bao's avatar
      Use Makefile variables to specify margin settings. · 4521b702
      Tao Bao authored
      Instead of defining device-specific UI class, this CL allows using
      Makefile variables to specify margin values directly.
      
      Values explicitly defined via TARGET_RECOVERY_UI_MARGIN_HEIGHT and
      TARGET_RECOVERY_UI_MARGIN_WIDTH will be used. Otherwise they will
      default to zero.
      
      Bug: 62732748
      Test: Specify the height and width and check recovery texts.
      Change-Id: Icb6f7466c8d407f877b93da38aebfdf7e6b41be7
      (cherry picked from commit a92d8fb4)
      4521b702
  12. 22 Jun, 2017 1 commit
    • Tao Bao's avatar
      Use Makefile variables to specify margin settings. · a92d8fb4
      Tao Bao authored
      Instead of defining device-specific UI class, this CL allows using
      Makefile variables to specify margin values directly.
      
      Values explicitly defined via TARGET_RECOVERY_UI_MARGIN_HEIGHT and
      TARGET_RECOVERY_UI_MARGIN_WIDTH will be used. Otherwise they will
      default to zero.
      
      Bug: 62732748
      Test: Specify the height and width and check recovery texts.
      Change-Id: Icb6f7466c8d407f877b93da38aebfdf7e6b41be7
      a92d8fb4
  13. 20 Jun, 2017 2 commits
    • Tao Bao's avatar
      screen_ui: Allow setting screen margin space. · 171b4c4c
      Tao Bao authored
      We already have outer_width and outer_height in wear UI, and x_offset
      and y_offset in VR UI. This CL adds margin_width_ and margin_height_ to
      their base class (ScreenRecoveryUI) to shorten the gap. This will be in
      general useful for round or round-cornered screens.
      
      Move the density computation to ScreenRecoveryUI ctor so that the value
      can be used earlier.
      
      Bug: 62732748
      Test: Setting and not setting margin_{width,height}_ on angler. Check the
            recovery texts (recovery menu as well as 'View recovery logs').
      Change-Id: Ibf6238c9cc8949a42ed8a410e1c09d55b0b5a151
      (cherry picked from commit 87f46508)
      171b4c4c
    • Tao Bao's avatar
      screen_ui: Allow setting screen margin space. · 87f46508
      Tao Bao authored
      For round screen or screens with rounded corners, we don't want to show
      texts within the margin which could otherwise be invisible.
      
      Move the density computation to ScreenRecoveryUI ctor so that the value
      can be used earlier.
      
      Note that this is similar to the existing stuff in wear UI (outer_width,
      outer_height). This CL gets ScreenRecoveryUI and WearRecoveryUI one-step
      closer.
      
      Bug: 62732748
      Test: Setting and not setting margin_{width,height}_ on angler. Check the
            recovery texts (recovery menu as well as 'View recovery logs').
      Change-Id: Ibf6238c9cc8949a42ed8a410e1c09d55b0b5a151
      87f46508
  14. 16 Jun, 2017 1 commit
    • Luke Song's avatar
      Introduce VR recovery ui · e2bd8760
      Luke Song authored
      A version of screen ui with specific adjustments for vr device
      compatibility.
      
      (cherrypick of a44dba7f to AOSP)
      
      Bug: 37779982
      Test: "adb reboot recovery" to view
      Change-Id: If6b0f26c1b587f8d0176060685b5efb6c67593b1
      e2bd8760
  15. 15 Jun, 2017 1 commit
    • Luke Song's avatar
      Introduce VR recovery ui · a44dba7f
      Luke Song authored
      A version of screen ui with specific adjustments for vr device
      compatibility.
      
      Bug: 37779982
      Test: "adb reboot recovery" to view
      Change-Id: If6b0f26c1b587f8d0176060685b5efb6c67593b1
      a44dba7f
  16. 23 Mar, 2017 1 commit
    • Mikhail Lappo's avatar
      Const modifiers · b49767c0
      Mikhail Lappo authored
      This functions do not change class variables
      Would be good to mark them as const, so
      class variables are not changed by coincidence
      
      Change-Id: Iea34f6d26dbd1bde813035160e07ff2a681989e6
      b49767c0
  17. 04 Jan, 2017 1 commit
    • Tao Bao's avatar
      recovery: Fix the broken UI text. · 736d59c5
      Tao Bao authored
      UI text is broken (doesn't show any text during FDR) due to commit
      d530449e, which reordered the calls to
      RecoveryUI::SetLocale() and RecoveryUI::Init().
      
      Because Init() uses the locale info to load the localized texts (from
      images), the locale must be set prior to that via SetLocale(). This CL
      refactors Init() to take the locale parameter, and removes the odd
      SetLocale() API.
      
      Bug: 34029338
      Test: 'Run graphics test' under recovery.
      Change-Id: I620394a3d4e3705e9af5a1f6299285d143ae1b01
      736d59c5
  18. 13 Dec, 2016 1 commit
    • Sen Jiang's avatar
      Add a stub recovery UI. · d530449e
      Sen Jiang authored
      This allows recovery to work on devices without screen.
      The stub recovery UI does nothing except print to stdout.
      
      Test: write 'recovery\n--wipe_data\n--reason=wipe_data_from_ota\n'
            to misc and boot to recovery on a device without screen.
      Bug: 33175036
      
      Change-Id: Icde698aa2e2e29f4b3d0532dfd3c6a939ac2bc63
      d530449e
  19. 15 Nov, 2016 1 commit
  20. 26 Sep, 2016 1 commit
  21. 24 Sep, 2016 1 commit
  22. 08 Sep, 2016 1 commit
  23. 07 Sep, 2016 1 commit
  24. 01 Sep, 2016 3 commits
    • Tianjie Xu's avatar
      Switch recovery to libbase logging · c21edd46
      Tianjie Xu authored
      Clean up the recovery image and switch to libbase logging.
      
      Bug: 28191554
      Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
      (cherry picked from commit 74778143)
      c21edd46
    • Tianjie Xu's avatar
      Switch recovery to libbase logging · 7b0ad9c6
      Tianjie Xu authored
      Clean up the recovery image and switch to libbase logging.
      
      Bug: 28191554
      Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
      Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
      7b0ad9c6
    • Tianjie Xu's avatar
      Switch recovery to libbase logging · 74778143
      Tianjie Xu authored
      Clean up the recovery image and switch to libbase logging.
      
      Bug: 28191554
      Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
      74778143
  25. 19 Aug, 2016 1 commit
  26. 09 Jul, 2016 1 commit
    • Elliott Hughes's avatar
      Support landscape layouts. · 6d089a95
      Elliott Hughes authored
      Add support for landscape layouts to the existing portrait support.
      
      Bug: http://b/29418855
      Test: tested manually with "Run graphics test" on flounder/fugu/ryu.
      Change-Id: Ib4a62bf5f2b8a1cef6028a01f05145104660560a
      6d089a95
  27. 29 Apr, 2016 1 commit
    • Tianjie Xu's avatar
      Add ability to show "installing security update" · 35926c4b
      Tianjie Xu authored
      Add a new command "--security" to boot commands. If this command is
      observed as part of BCB, choose a different background text picture
      for installing stage in recovery UI. As a result, users will see
      "installing security update" instead of "installing system update"
      when applying a security update package.
      
      Bug: 27837319
      Change-Id: I2e2253a124993ecc24804fa1ee0b918ac96837c5
      35926c4b
  28. 28 Apr, 2016 1 commit
  29. 27 Apr, 2016 1 commit
    • Elliott Hughes's avatar
      Update recovery UI. · faf36e04
      Elliott Hughes authored
      * Use new animation.
      * Use new non-holo progress bars.
      * Use recommended spacing for recovery UI.
      
      Bug: http://b/26548285
      Change-Id: I8411e89d6a6a9ce638b8645e19e5082d0d968cee
      faf36e04
  30. 21 Apr, 2016 2 commits
    • Elliott Hughes's avatar
      Go back to the old ear-wiggling Android animation. · 2c7b6f20
      Elliott Hughes authored
      But keep the new code so we can easily test new animations when we have them.
      
      This change includes tbao's de-interlace script, plus a one-liner that's
      necessary to play the animation at the correct speed when there's no
      progress bar showing. (This was always a bug, it's just way more noticeable
      when your animation only has 7 frames.)
      
      Bug: http://b/28316654
      Bug: http://b/26548285
      Change-Id: I32c601c352d6be235d1b44f14fca7e125defd77d
      2c7b6f20
    • Elliott Hughes's avatar
      Go back to the old ear-wiggling Android animation. · 692941be
      Elliott Hughes authored
      But keep the new code so we can easily test new animations when we have them.
      
      This change includes tbao's de-interlace script, plus a one-liner that's
      necessary to play the animation at the correct speed when there's no
      progress bar showing. (This was always a bug, it's just way more noticeable
      when your animation only has 7 frames.)
      
      Bug: http://b/28316654
      Bug: http://b/26548285
      Change-Id: I32c601c352d6be235d1b44f14fca7e125defd77d
      692941be