Commit graph

2095 commits

Author SHA1 Message Date
Prashant Malani
9020e0f141 recovery: Move SwipeDetector into common location
The SwipeDetector class is used almost unchanged in all locations.

This patch moves it into the recovery module, from which devices can
reference it if required.

The class is now renamed to WearSwipeDetector.

Bug: 27407422
Change-Id: Ifd3c7069a287548b89b14ab5d6d2b90a298e0145
2016-03-18 06:03:21 +00:00
Tao Bao
ce5868862a Revert "DO NOT MERGE Control fault injection with config files instead of build flags"
This reverts commit f73abf36bc.

Bug: 27724259
Change-Id: I1301fdad15650837d0b1febd0c3239134e2b94fb
2016-03-17 22:29:23 +00:00
Jed Estep
f73abf36bc DO NOT MERGE Control fault injection with config files instead of build flags
Bug: 26570379
Change-Id: I76109d09276d6e3ed3a32b6fedafb2582f545c0c
2016-03-16 12:36:57 -07:00
Greg Kaiser
0222db01fd Merge "otafault: Fix setting of have_eio_error." into nyc-dev 2016-03-14 20:44:36 +00:00
Greg Kaiser
f4300bc126 otafault: Fix setting of have_eio_error.
There was one case (ota_fsync, under TARGET_SYNC_FAULT, when the
filename was cached) where we were not setting have_eio_error
prior to returning.  We fix that.

Change-Id: I2b0aa61fb1e821f0e77881aba04db95cd8396812
2016-03-14 12:15:24 -07:00
Jed Estep
761653a4ad Merge "Port applypatch.sh tests to recovery_component_tests" into nyc-dev 2016-03-12 02:44:26 +00:00
Jed Estep
b8a693bbc7 Port applypatch.sh tests to recovery_component_tests
Bug: 27135282
Change-Id: If53682b591397ddfdb84860a3779b612904d4489
2016-03-11 18:37:34 -08:00
Prashant Malani
20df4adead Merge "recovery: Remove SetColor, and other refactoring for WearUI" into nyc-dev 2016-03-12 00:36:33 +00:00
Prashant Malani
7a491225bb recovery: Remove SetColor, and other refactoring for WearUI
The only difference from SetColor in ScreenRecoveryUI is the that the
LOG messages have slightly different colors. That's not enough to
warrant a duplicate function. So this patch removes SetColor and uses
the parent class version.

This patch also moves the DrawTextLine* functions into ScreenRecoveryUI
since they're mostly the same. It also moves char_width and char_height
into the class instead of keeping them as static variables.

Bug: 27407422
Change-Id: I30428c9433baab8410cf710a01c9b1c44c217bf1
2016-03-11 15:22:20 -08:00
Yabin Cui
1c522df25f applypatch: use vector to store data in FileContents.
Cherry pick this patch because it fixes the problem that
a newed Value is released by free().

Bug: 26906416
Change-Id: Ib53b445cd415a1ed5e95733fbc4073f9ef4dbc43
(cherry picked from commit d6c93afcc2)
2016-03-11 11:11:11 -08:00
Prashant Malani
0ba21cff07 recovery: Remove duplicate variables and functions
The function that modifies rtl_locale exists only in the base class,
and so the variable should not have a duplicate in the derived class,
otherwise there may be incosistent values when it is read by the derived
class (the thinking being that invoking the function will modify the
base class version of the variable, and not the derived class version).

Remove the updateMutex variable, and instead re-use the one in the base
class.

Also remove LoadBitmap from WearUI since it is identical to the one in
ScreenRecoveryUI.

Bug: 27407422
Change-Id: Idd823fa93dfa16d7b2c9c7160f8d0c2559d28731
2016-03-10 15:36:31 -08:00
Tianjie Xu
d345de66ef Merge "Reboot and retry on I/O errors" into nyc-dev 2016-03-10 21:27:26 +00:00
Tianjie Xu
fa12b9737d Reboot and retry on I/O errors
When I/O error happens, reboot and retry installation two times
before we abort this OTA update.

Bug: 25633753
Change-Id: Iba6d4203a343a725aa625a41d237606980d62f69
(cherry picked from commit 3c62b67faf)
2016-03-10 11:50:28 -08:00
Prashant Malani
f7f9e50528 Revert "recovery: More refactoring of WearUI"
This reverts commit 1c7b2230d8.

This change can lead to the derived class indirectly (and incorrectly) calling some functions from the base class, which can lead to unpredictable behavior.

Bug: 27407422
Change-Id: I126a7489b0787dc195e942e2ceea6769de20d70c
2016-03-10 03:40:20 +00:00
Prashant Malani
1c7b2230d8 recovery: More refactoring of WearUI
This patch performs the following modifications:
- Remove setBackground function, and currentIcon member variable.
- Remove common Progress*, Redraw and EndMenu functions.

Bug: 27407422
Change-Id: Ic3c0e16b67941484c3bc1d04c9b61288e8896808
Signed-off-by: Prashant Malani <pmalani@google.com>
2016-03-08 15:56:54 -08:00
Prashant Malani
7d9fd96dc9 recovery: Begin refactor of WearUI to use ScreenRecoveryUI
This is the first of a series of changes which move WearUI to subclass
ScreenRecoveryUI, to take advantage of several functions which are
common between the two recovery UI implementations, and already defined
in ScreenRecoveryUI.

This patch changes the base class of WearUI, removes redundant
header includes, and also removes a common function.

Bug: 27407422

Change-Id: I8fd90826900f69272a82e23bd099790e8004d511
2016-03-08 14:37:49 -08:00
Alex Deymo
1731f2980b Merge "Restore labels on /postinstall during recovery." into nyc-dev 2016-03-05 00:03:47 +00:00
Alex Deymo
080f522fb9 Restore labels on /postinstall during recovery.
This patch mirrors what was done in the main init.rc to relabel
/postinstall.

Bug: 27178350
Bug: 27177071

(cherry picked from commit 6bcc8af6e5)

Change-Id: I8320559f014cfb14216dcc350e016fc1db05cb14
2016-03-04 15:50:27 -08:00
Tao Bao
ae6408d1a2 recovery: Handle devices without /cache partition.
Since we may not have /cache partition on A/B devices, let recovery
handle /cache related operations gracefully if /cache doesn't exist.

(1) Disable the wipe for /cache partition.

(2) Skip wiping /cache while wiping /data (i.e. factory reset).

(3) Disable logging-related features, until we figure out better
ways / places to store recovery logs (mainly for factory resets on A/B
devices).

Bug: 27176738
Change-Id: I7b14e53ce18960fe801ddfc15380dac6ceef1198
(cherry picked from commit 26112e5870)
2016-03-04 12:23:10 -08:00
Tao Bao
3a2bb594df uncrypt: Communicate via /dev/socket/uncrypt.
We used to rely on files (e.g. /cache/recovery/command and
/cache/recovery/uncrypt_status) to communicate between uncrypt and its
caller (i.e. system_server). Since A/B devices may not have /cache
partitions anymore, we switch to socket communication instead.

We will keep the use of /cache/recovery/uncrypt_file to indicate the OTA
package to be uncrypt'd though. Because there is existing logic in
ShutdownThread.java that depends on the existence of the file to
detect pending uncrypt works. This part won't affect A/B devices without
/cache partitions, because such devices won't need uncrypt service (i.e
the real de-encrypt work) anyway.

Bug: 27176738
Change-Id: I481406e09e3ffc7b80f2c9e39003b9fca028742e
2016-03-02 23:23:32 -08:00
Prashant Malani
9db7964834 Merge "Fixes to wear recovery for N" into nyc-dev 2016-02-29 22:56:30 +00:00
Tao Bao
65f35b5c35 Merge "uncrypt: Retire pre-recovery service." into nyc-dev 2016-02-28 18:44:38 +00:00
Prashant Malani
0eb41c3f37 Fixes to wear recovery for N
Bug: 27336841

Change-Id: If4632e9791cce2c39590a4012687271f59a60af1
2016-02-26 17:01:37 -08:00
Paul Lawrence
661f8a69f2 Move recovery's convert_fbe folder to /tmp
The cache folder is no longer available at this time

Bug: 27355824
Change-Id: I74e33266c1ff407364981b186613f81319dd22dc
2016-02-25 13:07:16 -08:00
Josh Gao
0757a093c1 Merge "minadbd: update for adb_thread_create signature change." into nyc-dev 2016-02-24 00:50:36 +00:00
Yabin Cui
99281df8e2 recovery: check battery level before installing package.
Bug: 26879394

Change-Id: I63dce5bc50c2e104129f1bcab7d3cad5682bf45d
(cherry picked from commit 53e7a0628f)
2016-02-23 11:03:10 -08:00
Yabin Cui
089fe38ac5 Fix integer overflows in recovery procedure. am: 1273956e69 am: 5978a71d29 am: 877dcba47a am: f4ee1720f3 am: cae056f219 am: 682d691052 am: ae68f02272
am: a3604da6e1

* commit 'a3604da6e17afbf5b98f1eb2c5fc16bde1731b85':
  Fix integer overflows in recovery procedure.
2016-02-23 06:56:27 +00:00
Yabin Cui
a3604da6e1 Fix integer overflows in recovery procedure. am: 1273956e69 am: 5978a71d29 am: 877dcba47a am: f4ee1720f3 am: cae056f219 am: 682d691052
am: ae68f02272

* commit 'ae68f0227262d08f250e4cccda6f03b9981bf56d':
  Fix integer overflows in recovery procedure.
2016-02-23 06:53:47 +00:00
Yabin Cui
ae68f02272 Fix integer overflows in recovery procedure. am: 1273956e69 am: 5978a71d29 am: 877dcba47a am: f4ee1720f3 am: cae056f219
am: 682d691052

* commit '682d6910526a55e6a20e27cde3cf7515fa07a97b':
  Fix integer overflows in recovery procedure.
2016-02-23 06:50:58 +00:00
Yabin Cui
682d691052 Fix integer overflows in recovery procedure. am: 1273956e69 am: 5978a71d29 am: 877dcba47a am: f4ee1720f3
am: cae056f219

* commit 'cae056f21908173bcf2fa9a1724e46f16abb3258':
  Fix integer overflows in recovery procedure.
2016-02-23 06:47:37 +00:00
Yabin Cui
cae056f219 Fix integer overflows in recovery procedure. am: 1273956e69 am: 5978a71d29 am: 877dcba47a
am: f4ee1720f3

* commit 'f4ee1720f33a01518f79a2bf8df4664dab3564d4':
  Fix integer overflows in recovery procedure.
2016-02-23 06:44:46 +00:00
Yabin Cui
f4ee1720f3 Fix integer overflows in recovery procedure. am: 1273956e69 am: 5978a71d29
am: 877dcba47a

* commit '877dcba47ac311aa65b27e42b3625bcb58d84e47':
  Fix integer overflows in recovery procedure.
2016-02-23 06:42:07 +00:00
Yabin Cui
877dcba47a Fix integer overflows in recovery procedure. am: 1273956e69
am: 5978a71d29

* commit '5978a71d2954c7df02cbd0c51582ce4063346f77':
  Fix integer overflows in recovery procedure.
2016-02-23 06:35:46 +00:00
Yabin Cui
5978a71d29 Fix integer overflows in recovery procedure.
am: 1273956e69

* commit '1273956e69a7d1d5b636f269050b446e0ced3f9b':
  Fix integer overflows in recovery procedure.
2016-02-23 06:33:20 +00:00
Yabin Cui
0d28ba452f resolve merge conflicts of e5d3d15cd2 to nyc-dev
Change-Id: Ie8b30e6b114b648e8c03866456c64cf8b740d1e3
2016-02-22 22:16:44 -08:00
Yabin Cui
e5d3d15cd2 Fix integer overflows in recovery procedure. am: 4f2df162c6
am: 2800876140

* commit '2800876140425749d8d3fd8339f5c4b55ee0e185':
  Fix integer overflows in recovery procedure.
2016-02-23 02:39:21 +00:00
Yabin Cui
2800876140 Fix integer overflows in recovery procedure.
am: 4f2df162c6

* commit '4f2df162c6ab4a71ca86e4b38735b681729c353b':
  Fix integer overflows in recovery procedure.
2016-02-23 02:33:18 +00:00
Yabin Cui
1273956e69 Fix integer overflows in recovery procedure.
Bug: 26960931
Change-Id: Ieae45caccfb4728fcf514f0d920976585d8e6caf
(cherry picked from commit 4f2df162c6)
2016-02-22 17:42:02 -08:00
Tao Bao
5b3b373a49 uncrypt: Retire pre-recovery service.
The framework CL in [1] removes the use of "pre-recovery" service which
is basically to trigger a reboot into the recovery.

[1] commit e8a403d57c8ea540f8287cdaee8b90f0cf9626a3

Bug: 26830925
Change-Id: I131f31a228df59e4f9c3024b238bbdee0be2b157
2016-02-22 17:33:41 -08:00
Josh Gao
cd324766ab minadbd: update for adb_thread_create signature change.
Change-Id: Ifa0b4d8c1cf0bb39abac61984ff165e82e41222c
(cherry picked from commit cc07b35565)
2016-02-22 15:44:53 -08:00
Yabin Cui
4f2df162c6 Fix integer overflows in recovery procedure.
Bug: 26960931
Change-Id: Ieae45caccfb4728fcf514f0d920976585d8e6caf
(cherry picked from commit a029c9a458)
2016-02-22 11:02:08 -08:00
Jed Estep
e1305768f6 Fix verifier test base testdata directory after merge conflict
Change-Id: I7ffba0be5a6befc875ce59b51a008c1892e7d34b
2016-02-22 10:59:37 -08:00
Tao Bao
a4436f7b25 DO NOT MERGE ANYWHERE Use synchronous writes when setting up BCB. am: 8559bbfb3b -s ours
am: 52991c4639  -s ours

* commit '52991c4639347a2e2b098949fdf91c305f8d41dd':
  DO NOT MERGE ANYWHERE Use synchronous writes when setting up BCB.
2016-02-19 17:33:52 +00:00
Tao Bao
52991c4639 DO NOT MERGE ANYWHERE Use synchronous writes when setting up BCB.
am: 8559bbfb3b  -s ours

* commit '8559bbfb3b988b1b8790702d277715fc429cc1d8':
  DO NOT MERGE ANYWHERE Use synchronous writes when setting up BCB.
2016-02-19 17:29:34 +00:00
Tao Bao
8559bbfb3b DO NOT MERGE ANYWHERE Use synchronous writes when setting up BCB.
Commit [1] made similar changes into AOSP code, but it requires multiple
CLs to cherry-pick into cw-e branch. So we make a separate CL to fix the
issue.

[1] commit bd82b27341

Bug: 27247370
Change-Id: Id5c08a6a29284353f891cdbaa224feee891f3807
2016-02-19 08:39:25 -08:00
Yabin Cui
ca78c9f035 resolve merge conflicts of 715d8a203a to master.
Change-Id: Ic868ee9b27ef7251aa49ac814de7355ecd9c7d37
2016-02-05 15:27:52 -08:00
Yabin Cui
715d8a203a Merge "applypatch: fix memory leaks reported by static analysis."
am: 6b89aa7662

* commit '6b89aa7662186f940f2ae35d479598601dc28a07':
  applypatch: fix memory leaks reported by static analysis.
2016-02-05 22:58:47 +00:00
Yabin Cui
6b89aa7662 Merge "applypatch: fix memory leaks reported by static analysis." 2016-02-05 22:54:36 +00:00
Tao Bao
e284cd58c8 Merge "Refactor existing tests to use gtest" am: 38b02cc6a0
am: 9865c55254

* commit '9865c55254a1583e18a7e8ac502f2c2143ed8b82':
  Refactor existing tests to use gtest
2016-02-05 18:47:14 +00:00
Tao Bao
9865c55254 Merge "Refactor existing tests to use gtest"
am: 38b02cc6a0

* commit '38b02cc6a097e6356f2369fc2b23c8c8a893e3ff':
  Refactor existing tests to use gtest
2016-02-05 18:44:55 +00:00