Commit Graph

7832 Commits

Author SHA1 Message Date
Zhang, GaofengX 7d453edf34 Merge "Avoid key_queue_mutex deadlock in waitkey()" am: eb33356544
am: 6a550f518e

Change-Id: Id3f87e0a660fbbb9cc87b653c2c894d3b6132eaf
2019-06-12 17:25:25 -07:00
Zhang, GaofengX 6a550f518e Merge "Avoid key_queue_mutex deadlock in waitkey()"
am: eb33356544

Change-Id: I77a49758aefeb521cab18aa66942fa80f6752135
2019-06-12 17:19:43 -07:00
Treehugger Robot eb33356544 Merge "Avoid key_queue_mutex deadlock in waitkey()" 2019-06-13 00:01:49 +00:00
Zhang, GaofengX 852d9fec6d Avoid key_queue_mutex deadlock in waitkey()
Waitkey() is designed to obtain lock "key_queue_mutex" in
the very beginning of function.

  int RecoveryUI::WaitKey() {
    std::unique_lock<std::mutex> lk(key_queue_mutex);
    ...
  }

However, there's case "key_queue_mutex" being applied again in
waitkey(), thus cause deadlock. There are two reproduce
scenario:
1.Executing "fastboot reboot recovery" in userspace
  fastboot
2.Executing "adb reboot fastboot" in recovery os

When entering userspace fastboot/recovery, waitkey()
will wait there for user action. fastboot/adb commands
will trigger ui->interruptkey() to notify the thread
waitkey() in. In the next, waitkey() will move on and call
SetScreenSaveState(), which do LOG(ERROR) in fail case of
brightness set. LOG(ERROR) is designed to print log on
UI. Unfortunately, UI->print() applies lock "key_queue_mutex"
too, so deadlock happen.

Note:
Here is details how lock "key_queue_mutex" applied in
UI->print():
Function Print() call
   Function PrintV() call
      Function update_screen_locked() call
         Function draw_screen_locked() call
            Function draw_menu_and_test_buffer_locked() call
               Function IsLongPress()

  bool RecoveryUI::IsLongPress() {
    std::lock_guard<std::mutex> lg(key_queue_mutex);
    bool result = key_long_press;
    return result;
  }

Bug: 135078366
Test: no errors when running "fastboot reboot recovery" in userspace
      fastboot & "adb reboot fastboot" in recovery os

Change-Id: Ida6b3c4ba9896a70021373f02a94954f0a60cf31
Signed-off-by: Zhang, GaofengX <gaofengx.zhang@intel.com>
Signed-off-by: Xihua Chen <xihua.chen@intel.com>
2019-06-12 14:48:37 +08:00
Tao Bao 4721ced095 Merge "minadbd: adb rescue getprop returns newline-terminated result." am: cb930939a4
am: d401ed099e

Change-Id: I6dee78abeb9ae1fb07e3809a2acc4c4d6ad31fff
2019-06-10 17:27:56 -07:00
Tao Bao d401ed099e Merge "minadbd: adb rescue getprop returns newline-terminated result."
am: cb930939a4

Change-Id: Ie2a79b2d6254e11f2e419e6fcd799e271a4ebc6a
2019-06-10 17:22:04 -07:00
Tao Bao cb930939a4 Merge "minadbd: adb rescue getprop returns newline-terminated result." 2019-06-10 23:43:09 +00:00
Tao Bao 57a27890ce minadbd: adb rescue getprop returns newline-terminated result.
This change addresses the comment in [1], which makes the results of
`adb shell getprop foo` and `adb rescue getprop foo` more consistent.
That is, both will return newline-terminated results now.

[1] https://r.android.com/c/platform/bootable/recovery/+/976340/3/minadbd/minadbd_services.cpp#188

Test: Run the following commands on taimen (under rescue mode):
    `adb rescue getprop ro.build.fingerprint`
    `adb rescue getprop ro.nonexistent`
    `adb rescue getprop`
Change-Id: I5af47f8ea4d569b8507e259daef87749c0945f47
2019-06-10 13:08:03 -07:00
Tao Bao 024b53abe3 Merge "minadbd: Support adb rescue getprop." am: 533a12c71e
am: 0d00c1bf12

Change-Id: I124c643a9aff253e65c5ad81c5f941d6bc697e40
2019-06-05 14:13:00 -07:00
Tao Bao 0d00c1bf12 Merge "minadbd: Support adb rescue getprop."
am: 533a12c71e

Change-Id: Iea0f637a9c1a19d2e2d1edd68c0a86d482ce506a
2019-06-05 14:05:42 -07:00
Tao Bao 533a12c71e Merge "minadbd: Support adb rescue getprop." 2019-06-05 20:43:55 +00:00
Tao Bao 9b2cfec8dd Merge "minadbd: More allowed properties." am: 1ef7f92871
am: 6c37304201

Change-Id: I8295063fd81b0cdc7625410c1482c9bab538ebbc
2019-06-04 19:30:29 -07:00
Tao Bao 6c37304201 Merge "minadbd: More allowed properties."
am: 1ef7f92871

Change-Id: I2e663ae4d334f40bf688b70630ad823c1eb92444
2019-06-04 17:53:25 -07:00
Tao Bao d8db81a014 minadbd: Support adb rescue getprop.
It dumps all the allowed properties, similar to `adb shell getprop`.

Bug: 134027350
Test: Run the command under rescue mode.
Change-Id: Ic0864ca0fb51505ec1e4f38af2464591aa576201
2019-06-04 15:09:41 -07:00
Tao Bao 1ef7f92871 Merge "minadbd: More allowed properties." 2019-06-04 22:01:36 +00:00
Paul Duffin 2f8626c3f7 Merge "Use icu4j instead of its deprecated legacy alias icu4j-host" am: 14bc5e1feb
am: af4d1dda03

Change-Id: I4e11f19fa992ea7b8cc23437a041edf709356d39
2019-06-04 02:44:46 -07:00
Paul Duffin af4d1dda03 Merge "Use icu4j instead of its deprecated legacy alias icu4j-host"
am: 14bc5e1feb

Change-Id: Ic7dd97abecd668ee087c37a2130360bf44dbbe02
2019-06-04 02:38:27 -07:00
Paul Duffin 14bc5e1feb Merge "Use icu4j instead of its deprecated legacy alias icu4j-host" 2019-06-04 09:24:01 +00:00
Tao Bao 3b9ef341be minadbd: More allowed properties.
Most of these properties are already part of the fingerprint. This CL
allows querying them directly, instead of encouraging users to decode
from fingerprints.

Bug: 134027350
Test: Boot into rescue mode on taimen. Run `adb rescue getprop` with new
      props.
Change-Id: Id4667fcaf0e908c391085b22e22c957acd01d9c4
2019-06-03 12:14:18 -07:00
Paul Duffin eb586b7baf Use icu4j instead of its deprecated legacy alias icu4j-host
Bug: 134379140
Test: m droid
Change-Id: I71c2ac392361b3c6dfa693194c05116422335e55
2019-06-03 16:14:35 +01:00
Tianjie Xu b93dc08bc6 Merge "Disable building simulator for mac" am: f3dd821f76
am: 3489b274d0

Change-Id: Idfe10693ecc07e4721bf32e1a7a914feb69f2dec
2019-05-30 14:17:05 -07:00
Tianjie Xu 3489b274d0 Merge "Disable building simulator for mac"
am: f3dd821f76

Change-Id: Iccdde0099a51184fce6f86f9b7ad3f62ce33b36e
2019-05-30 14:08:32 -07:00
Treehugger Robot f3dd821f76 Merge "Disable building simulator for mac" 2019-05-30 20:45:28 +00:00
Tianjie Xu 76e165d143 Disable building simulator for mac
Disable building the simulator and its support libraries to resolve the breakage
on mac host targets. Because the simulator is not intended to use on mac anyway.

Bug: 134047992
Test: mma
Change-Id: I488ab50cab1282f03250010b5334f1895d44f98b
2019-05-30 10:49:18 -07:00
Tianjie Xu 55e82e2fc5 Merge "Implement an update simulator to verify BB OTA packages on host" am: 65d7d5b8cf
am: 29d9d7bbbe

Change-Id: Id0152ae0ef3b12501e67e9f3404bd2a379b79c7e
2019-05-29 10:44:17 -07:00
Tianjie Xu 29d9d7bbbe Merge "Implement an update simulator to verify BB OTA packages on host"
am: 65d7d5b8cf

Change-Id: Ie3d3af1442c75563c10a9c6c2991426f1054305d
2019-05-29 10:37:34 -07:00
Tianjie Xu 65d7d5b8cf Merge "Implement an update simulator to verify BB OTA packages on host" 2019-05-29 17:20:36 +00:00
Tianjie Xu c1a5e26fd9 Implement an update simulator to verify BB OTA packages on host
Implement the simulator runtime and build the updater simulator as a host
executable. The code to parse the target-files and mocks the block devices
will be submitted in the follow-up.

Bug: 131911365
Test: unit tests pass

Change-Id: Ib1ba939aec8333ca68a45139514d772ad7a27ad8
2019-05-28 15:18:25 -07:00
Mark Salyzyn 3447708800 Merge "recovery: report compliant reboot reason (Part Deux)" am: c0a51a01ce
am: 7d0545f14a

Change-Id: I5818816fc88d05e2b8b4fa7fec17a009f854e1f9
2019-05-28 09:22:53 -07:00
Mark Salyzyn 7d0545f14a Merge "recovery: report compliant reboot reason (Part Deux)"
am: c0a51a01ce

Change-Id: Ie92bd6205de683781a9a315657485cd232682de3
2019-05-28 09:17:51 -07:00
Treehugger Robot c0a51a01ce Merge "recovery: report compliant reboot reason (Part Deux)" 2019-05-28 15:57:24 +00:00
Tianjie Xu e89cfb6a41 Merge "Some clean ups to the updater" am: 52e61f6995
am: a0c0e04163

Change-Id: I0095c2eb465559d30632d00d1a18b6d6b5eda143
2019-05-23 23:08:07 -07:00
Tianjie Xu a0c0e04163 Merge "Some clean ups to the updater"
am: 52e61f6995

Change-Id: I515d9cd9cf0d3b82fd2a28ccfcef8e2eea1e5683
2019-05-23 22:44:44 -07:00
Tianjie Xu 52e61f6995 Merge "Some clean ups to the updater" 2019-05-24 04:45:43 +00:00
Mark Salyzyn 488cc05c96 recovery: report compliant reboot reason (Part Deux)
shutdown and reboot should have a corresponding sub-reason.

Adding:
    "reboot,userrequested,fastboot"
    "reboot,userrequested,recovery"
    "reboot,userrequested,recovery,ui"
    "shutdown,userrequested,fastboot"
    "shutdown,userrequested,recovery"
    "reboot,unknown#" (Can't happen, debug)

Test: manual, multiple targets, enter recovery, be able to exit recovery
Bug: 133326470
Change-Id: Ibfcb2a23158e8e99922e8053edd815fb592150f2
2019-05-23 13:58:53 -07:00
Tao Bao 865c17893b [automerger skipped] Add misc_writer.
am: 35e0f6d290 -s ours
am skip reason: change_id I79548fc63fc79b705a0320868690569c3106949f with SHA1 7ae0169842 is in history

Change-Id: I092c0920b4e9bb4f9386ec84b7522bfbb984477b
2019-05-23 13:37:06 -07:00
Elliott Hughes ee57256055 Merge "Move off the Next ZipString overload." am: 7b67d28518
am: 505ed45940

Change-Id: I1543b8adc9872333c5a6dbcad001cc2387877816
2019-05-23 13:10:12 -07:00
Elliott Hughes 505ed45940 Merge "Move off the Next ZipString overload."
am: 7b67d28518

Change-Id: Idbc570cc79fd3d620e2f3544b90cffb43139b6bc
2019-05-23 11:23:36 -07:00
Elliott Hughes 7b67d28518 Merge "Move off the Next ZipString overload." 2019-05-23 17:55:27 +00:00
Tao Bao 863c8f36dd Merge "Revert "recovery: report compliant reboot reason"" am: 44f6b182dd
am: b491496fc3

Change-Id: Ib108dd6d1bbda2f03a3730c58519e42b5dd59766
2019-05-22 21:18:45 -07:00
Elliott Hughes 88d8001e75 Move off the Next ZipString overload.
Bug: http://b/129068177
Test: treehugger
Change-Id: I3c8f70b0d8cc5dc6b3b4439dbe0b9a5bd85003c4
2019-05-22 18:52:29 -07:00
Tao Bao b491496fc3 Merge "Revert "recovery: report compliant reboot reason""
am: 44f6b182dd

Change-Id: I37bfc2cac926a3b3aaecad4807478e5aed9f51aa
2019-05-22 18:52:21 -07:00
Tianjie Xu 27556d089f Some clean ups to the updater
Remove some unnecessary includes or forward declarations. And include
the correct headers to build host executables.

Bug: 131911365
Test: unit tests pass
Change-Id: I62e75f60678159fe24619a4bd386b1416f1a5b5d
2019-05-22 14:58:28 -07:00
Treehugger Robot 44f6b182dd Merge "Revert "recovery: report compliant reboot reason"" 2019-05-22 21:55:38 +00:00
Tao Bao feefbf2f56 Revert "recovery: report compliant reboot reason"
This reverts commit 6f4e4db4f9.

Reason for revert: Booting out of recovery (choose `Reboot system now`)
on taimen is broken. Device keeps booting back into recovery.

Bug: 133326470
Test: Choose `Reboot system now` from recovery menu. Deivce attempts
      normal boot.
Change-Id: I6e85fc248e18953a6fb94513c3abc7e7e0fb0477
2019-05-22 11:06:26 -07:00
Mark Salyzyn d77641069e Merge "recovery: report compliant reboot reason" am: d31fb2e7fc
am: c3042973a4

Change-Id: I020798a035fa83839347f821dbfad1d363ec5d69
2019-05-21 13:32:30 -07:00
Tianjie Xu 3445bf5352 Merge "Add UpdaterRuntime class" am: e7b3c5698e
am: c6d7065880

Change-Id: I4096ef9a51904b5ecd889bda5ff0d9e11acb4071
2019-05-21 13:25:31 -07:00
Mark Salyzyn c3042973a4 Merge "recovery: report compliant reboot reason"
am: d31fb2e7fc

Change-Id: I7105c56c65f8d2573ec8e0b7cada81468ccef2b7
2019-05-21 11:57:57 -07:00
Tianjie Xu c6d7065880 Merge "Add UpdaterRuntime class"
am: e7b3c5698e

Change-Id: I2942823be107f1e693385a7892251519ac50afb1
2019-05-21 11:57:32 -07:00
Mark Salyzyn d31fb2e7fc Merge "recovery: report compliant reboot reason" 2019-05-21 17:44:14 +00:00