Commit Graph

1694 Commits

Author SHA1 Message Date
that
f74ac8740c gui: clean up error handling in resource manager
Change-Id: Ib94e661ab0c608deb2d119168709c85a9a44b2fa
2015-01-18 12:00:02 +01:00
Ethan Yonker
4a64f63615 2.8.4.0
Change-Id: Iee99e021e8ec721ab1c12fcbcf5e7059b871ea0a
2015-01-12 22:09:59 -06:00
Ethan Yonker
cf50da5742 Fix handling of custom themes after decrypt
Loading a custom theme from the decrypt action was preventing the
runPage function from exiting. This moves the loading of a custom
theme out of the action.

Change-Id: I86904b63a67a25ded56e3e1e569fe906264dc055
2015-01-12 22:08:35 -06:00
Vojtech Bocek
e979abd6cc Fix some crashes during theme (re)loading
Change-Id: I01405fbe86a48ae79f2cbe633b89f2dcfb1ef266
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-12 20:23:37 +01:00
Vojtech Bocek
85cfb7d7b7 Fix some actions being incorrectly threaded
Change-Id: Ic8406344994ef2a9972207f9281b52e64e22826b
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-12 20:11:09 +01:00
that
fb759d45f5 gui: simplify blanktimer
- get rid of separate thread, check timer in rendering thread instead
- use an enum for the blanking state instead of magic integers
- move #ifdefs for TW_NO_SCREEN_TIMEOUT inside blanktimer class
- move some #includes and enum TOUCH_STATE to pages.hpp

Change-Id: Id4b104e3680dc5db41d8ba85e32d722cf4086299
2015-01-11 12:16:53 +01:00
Ethan Yonker
f66324ffbb Fix restore of images for mtd and bml nand
Change-Id: I843ddf7a5bca3ca7670dd6f19644b37cf017e5b1
2015-01-09 16:46:57 -06:00
Ethan Yonker
751a85e759 Allow for X and Y offsets in GUI
These can be used to center a lower resolution theme onto a
higher resolution screen. May be useful for Nexus 9 unless or
until we decide to do a 1536x2048 theme or on devices like the
Moto 360 and LG G Watch R.

The build flags will only affect the stock theme. If a custom
theme wishes to apply an offset, it can be done by setting
tw_x_offset and / or tw_y_offset in the variables section of the
XML.

Change-Id: I2390769ed861b96a4a3bb8a0f06d9021ec91b6b9
2015-01-09 23:37:04 +01:00
Vojtech Bocek
fda239b10a Add locking to DataManager, remove unused C parts
Change-Id: I33e8f96611bd9a6795bdd3fb588c20716bdb5929
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-09 23:12:47 +01:00
Dees Troy
f9d818d2eb Merge "Use power button to go back in watch themes" into android-5.0 2015-01-09 23:10:49 +01:00
Vojtech Bocek
8360a34384 Use power button to go back in watch themes
Change-Id: I1463a0ba62a23c68c15f05e79a99fa8509314373
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-09 16:10:03 -06:00
Ethan Yonker
0d47eb5686 Improve GUI handling of zip flashing
- change the page sooner so that users cannot activate the slider
  twice
- improve GUI messaging if a zip requests a cache wipe
- move update of the file count to the end so it is less visible
  to the user (e.g. during a cache wipe the counter should not
  read 0)

Change-Id: I5d478f07effe61ca37f3521a77c9e9243a9cb692
2015-01-09 23:07:25 +01:00
Ethan Yonker
96af84a409 Allow flashing of images via the GUI
- Use the Images... button in the lower right of the zip install
  page
- Unify image flashing functions between restore and image flash
- boot and recovery partitions are flashable by default
- use fstab flag flashimg=1 or 0 to override defaults
- file system partitions are currently not flashable

Change-Id: I822dc446030543c55d2153e219d67a1292374ffc
2015-01-09 23:07:07 +01:00
that
7d3b54f3c2 gui: fix action threading if background thread is busy
When the background thread is already running and we have at least one
threaded action in the list, we should not run any non-threaded actions
before ignoring the threaded action and following ones - it might cause
invalid state variables to be set. Run or ignore the whole list in the
background thread instead.

Change-Id: Ie634105b80f038893898a21539886bd757eb47ce
2015-01-09 22:52:51 +01:00
that
c608548633 Run some actions in a separate thread
Some actions need to be threaded so we will run those in a
separate thread and deny requests to thread more actions if new
requests come in while a thread is already running.

Change-Id: I966c538e67860a6d8fe556e5a2eb7f7d1a987e74
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-09 22:12:43 +01:00
Vojtech Bocek
41ae12482b Include libnetd_client in recovery
* Bionic tries to load it, and if it isn't in /sbin and /system
  is mounted, it loads it from there and prevents it from unmouting

Change-Id: I33d0b6ba4503f2822d96033fa26d53e10b8ce1c5
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-01-06 11:36:58 -06:00
Ethan Yonker
1db509094e Remove mtdutils source from libaosprecovery
Change-Id: I836ae4491f8da75fd13e73193774677e26daf16d
2015-01-05 09:12:59 -06:00
Ethan Yonker
d6786b898b Stop building unneeded libs for libblkid
Change-Id: I96d91f2d2e38380ff46a6ff6e2c8c9a245aa0431
2015-01-05 09:01:29 -06:00
Ethan Yonker
bcff146bc9 Build more needed libs for mke2fs
Change-Id: I473f5a0412bf35507a755d485bbdf53fd241748b
2015-01-04 22:01:33 -06:00
bigbiff
7b4c7a681c Update blkid to 2.25.0
Break libblkid into 4 libraries: libblkid, libuuid, libutil-linux and libfdisk.

This should help in later patch updates.

Change-Id: I680d9a7feb031e5c29a603e9c58aff4b65826262
2015-01-05 04:38:42 +01:00
that
183a6f88d0 crypto: remove unused libs and clean up makefile
libsoftkeymaster and its dependencies appear to be unused.

Change-Id: Ib720f5e4d2750a739ba6b65b346c0e167df279d3
2015-01-05 03:14:28 +01:00
Ethan Yonker
d83587d86a Fix adb sideload during ORS
Change-Id: I13735c7bba72f3887c4a7618843478be5ada3370
p
2015-01-04 20:01:57 -06:00
Ethan Yonker
24e7eb73ce Thread openrecoveryscript action to properly display action page
The action page fails to display properly during ORS processing
unless we thread the ORS action. Based upon the work done in this
patch set by _that:
https://gerrit.omnirom.org/#/c/11226

Change-Id: I6dac790ac26d9b3a02df778516fea011d67aea70
2015-01-04 19:41:10 -06:00
that
cc8ddca9bd fix adb sideload
- "Cancel" button handling requires another thread
- simplify handling of child pid
- merge duplicated code for reinjecting TWRP after installation
- fix error that showed on host PC after sideload finished
- fix problem where adbd sometimes does not stop correctly

Change-Id: I536877f024b606756c6a3289c6ddfdba423a60d6
2015-01-03 22:34:48 -06:00
Ethan Yonker
d83c9ea371 Fix GUIAction::operation_start
We need to set the value of tw_operation_state a little sooner to
make the decrypt page work correctly. Without this change, decrypt
would incorrectly display the main page during the first decrypt
cycle. This fix may also fix ORS and possibly other things that
use the runPage function.

Change-Id: I85ad6e4add6726a2746eeb7116f3eab3f7ff5d84
2015-01-02 21:23:22 -06:00
Ethan Yonker
df7abac1a6 Do not toggle USB ID during MTP startup if not needed
In most cases MTP is enabled so it is better to start our init.rc
with MTP enabled and try not to toggle USB IDs during TWRP boot so
that we can keep adb running to make debugging easier.

Change-Id: Idf122c5ad4deeef7e1ed775d495989c502ddfb19
2015-01-02 10:22:58 -06:00
that
6bea38acdf gui: remove dead build flag TWRP_SIMULATE_ACTIONS
isn't used by the code, can be set via datamanager instead.

Change-Id: I3d98c85c91ce41f32de90345715f2f456f628419
2015-01-01 10:56:52 +01:00
that
3f7b1aced8 gui: Move action functions to function pointer map.
This allows the functions to be more readable and make
doActions readable.

Patch set 5: gui: remove threading in GUIAction

Multiple actions were started in another thread that was joined
immediately after starting it, so the input thread was blocked anyway.

Selected single actions were started in their own thread, but this
caused bugs like being able to install the same package twice in
parallel by quickly swiping the slider twice.

Change-Id: I28adadaedd032efc7bff3aaa48e659627aa3a3b3
2014-12-30 11:30:13 +01:00
that
fcdb76dd05 twrp-functions: remove unused functions
Change-Id: I3d072be9ef28f21ade466bc4c42caca8848f7c2a
2014-12-29 17:11:59 +01:00
that
a1ad19f0b7 mtp: get rid of string streams, reduces binary size a bit
Change-Id: Iaa91eaac8269f02783c904d890641861ec747d11
2014-12-29 17:10:38 +01:00
Ethan Yonker
abb5c4ead0 Move sleep during MTP startup to MTP thread
Some devices are very slow to respond to the sysfs requests. To
prevent delaying the main GUI from booting during TWRP startup, we
move the sleep delay to just before we open the MTP device and
into the MTP thread so that it does not hold up the main TWRP
thread.

Change-Id: Ic931ef317d0fb7ef4dfdef46a32f68a014ff62c0
2014-12-29 17:01:41 +01:00
that
c1f5c0f7fd gui: fix DEVICE_RESOLUTION warnings in Android.mk
Indenting the warnings with tab resulted in a make error
"*** commands commence before first target.  Stop."
instead of the intended message. Using spaces instead.

Also fixed the web link to point to the current build guide on XDA
instead of the outdated one on rootzwiki.

Change-Id: I8b25d39edae16dbc479c0e36bd11e12b49b4fbb0
2014-12-29 17:00:50 +01:00
Ethan Yonker
4bfabab005 Check for valid MTP_Storage_ID before adding or removing
Attempting to add a storage ID of 0 was causing a seg fault.

Change-Id: If8797186405be36ee70dbca63bd1063a62ba2812
2014-12-29 16:25:32 +01:00
Ethan Yonker
f9f99bcb62 Ingore SIGPIPE errors
If MTP exits unexpectedly, sending messages to add or remove a
storage device via Add_Remove_MTP_Storage was causing a crash.
Ignoring SIGPIPE allows us to more gracefully handle the error
instead of a total crash of TWRP.

Change-Id: I0a3f770f8b0f4bdbe10aa0ba857209b22b8668f7
2014-12-29 16:25:00 +01:00
Ethan Yonker
ee8b314dbc Improve MTPServer logging of read errors
Unless MTP debug logging is enabled, you will miss the error and
will not know that something went wrong in the log.

Change-Id: I51f4758b415eb38e808ec8b1c9788b505bf88c65
2014-12-29 09:24:23 -06:00
Ethan Yonker
32f68a3c92 Add TW_IGNORE_MT_POSITION_0 touch flag
This fixes touch on the a11 when fastboot booting the image. We
are also adding event logging for ABS_MT_POSITION data which we
should have been logging before but for some reason we did not.

Change-Id: I1b38c31c716efdcbe48db4faa5d0cef97c91c58e
2014-12-29 16:21:57 +01:00
Ethan Yonker
dc3223adb2 toolbox_recovery should always include setenforce
init does not follow symlinks and we need setenforce to be able
to set permissive. toolbox_recovery will now always include the
setenforce tool even if busybox has it so that our provided
init.rc can run /sbin/toolbox setenforce 0 successfully. The
symlink for setenforce will remain pointing to busybox if busybox
has setenforce.

Change-Id: I88a2a99bbed30cef3443ac5d94665e3850872237
2014-12-22 14:48:05 -06:00
Ethan Yonker
f5c904b2ff 2.8.3.0
Change-Id: If2084a8c8815b079db6b6a6b45ea180ba1282092
2014-12-21 21:56:51 -06:00
Ethan Yonker
960f030b41 Fix twrpTar building
- ifdef around set_metadata
- Set tags as optional

Change-Id: I438e370c3bf6b590dc80ba372724c47cead6cbe5
2014-12-22 04:55:24 +01:00
bigbiff
0c53203efe Fix else if and maxFileSize initializer.
Change-Id: Iac7852a4fb2add5744d5ea424d6ad5a82828f102
2014-12-22 04:52:56 +01:00
that
a3d31fbe38 fixPermissions: simplify code, fix bugs
- avoid parsing permission strings
- fix memory leaks, a fix new/free mismatch and a compiler warning
- fix that only first updated-package was processed
- fix a potential stack overflow if packages.xml is huge
- minor refactoring for reducing duplicated code
- don't process packages without codePath
- fix path for deleting app data (currently unused anyway)
- fix file ownership on libs
- try not to mess up Android 5.0 app permissions

Patch set 4

- make fixing SELinux contexts an option with a check box
- add some notes / text to the themes

Patch set 6

- decouple "fix permissions" from "fix contexts"

Change-Id: Icc77ecc581befc5ce6e419b1f3b8ca189208c234
2014-12-22 04:52:37 +01:00
Ethan Yonker
d79d9bceb3 Allow non datamedia devices to wipe encryption
With 5.0 L, we decrypt automatically if the default_password is
used. Non datamedia devices do not get the format data button so
they cannot wipe encryption off the device. This patch add a wipe
encryption button where the format data button would normally be
located on the Wipe page.

This patch also attempts to remove / delete the dm-crypt block
device before formatting.

Change-Id: I100d5d154d6c49254fd48e23279df973db5f23ae
2014-12-21 23:30:17 +01:00
Ethan Yonker
726a020632 MTP add/remove storage instead of disabling MTP
Implement a pipe between TWRP and MTP to allow TWRP to tell MTP
to remove storage partitions as they become unavailable (e.g.
during a wipe, unmount, etc) instead of disabling MTP completely.
This includes some fixes and improvements in destructors to
properly remove / delete various items. This also means that we
will not be toggling adb off and on quite as often.

I do not like that we had to add another thread, but we were
unable to use select() on the mtp_usb character device because
this device does not support polling. Select always returned
indicating that the mtp file descriptor was ready to be read and
the resulting read would block. The read block prevented us from
being able to include reading of the pipe between TWRP and MTP in
the main MTP thread.

We might want to add a return pipe letting TWRP know if the
removal of the storage device was successful, but I am not sure
how we want to implement this. It would invovle timeouts in both
TWRP and MTP to ensure that we returned a failure indicator in a
timely manner to TWRP and prevent deleting the storage device in
the case of a failure. Right now we make no attempt to ensure that
an MTP operation is underway like a large file transfer, but we
were not doing anything like this in the past. In some respects we
have limited control over what happens. If the user installs a
zip that unmounts a storage partition, we will not know about the
change in storage status anyway. Regular Android does not have
these troubles because partitions rarely get unmounted like in
recovery. At some point, we have to hold the user accountable for
performing actions that may remove a storage partition while they
are using MTP anyway.

Ideally we do not want to toggle the USB IDs and thus toggle adb
off and on during early boot, but I am not sure what the best way
to handle that at this time.

Change-Id: I9343e5396bf6023d3b994de1bf01ed91d129bc14
2014-12-19 16:27:34 -06:00
Ethan Yonker
6cb35aab99 Recovery init.rc setenforce 0 to make SELinux permissive
This will only work if the sepolicy is changed by also applying:
https://gerrit.omnirom.org/10924
Otherwise the sepolicy will deny the request.

Change-Id: I8a52cdfdd38bda19aa89686ff0ad31b90e1aa3b7
2014-12-19 16:28:30 +01:00
Ethan Yonker
b7896268ed Fix include paths in crypto
Change-Id: Ia9fd0cd75bd6ee6e14909890cb18a8edb3b22267
2014-12-18 15:30:31 -06:00
Ethan Yonker
5216bef553 Toggle MTP during ADB sideload
Windows does not do very well if you try to sideload while MTP is
enabled due to drivers. This will toggle MTP off and back on if
MTP is currently enabled before and after a sideload operation.

Change-Id: I022dbedecc97565b50b6ae1fda8922b822f63440
2014-12-18 21:18:15 +01:00
Ethan Yonker
e3e8829e40 Update SuperSU to 2.40
The SuperSU install process is getting rather complicated, so we
will modify the install script slightly and use it to install
all the things and stop trying to check to see if root permissions
have been lost like we used to do.

Change-Id: Ibdb64c909d2bd16e12bb35b4f31f572cc29add47
2014-12-18 21:17:26 +01:00
Ethan Yonker
fb7a2dad7d Fix adb sideload page on 1440x2560 layout
Change-Id: If79086b0128e57087fd87f07d56984eb2a15d8b2
2014-12-18 21:16:54 +01:00
Kra1o5
0024e3826b Add support for custom kernel headers
Change-Id: I39fe4de8919e59dd75e8cb535fa0648948035c26
2014-12-17 11:47:33 +01:00
Dees Troy
87da424556 Fixes for compiling crypto in older trees
Some of these fixes needed to be made anyway. Note that older
trees will still need to have files / repos copied into them from
newer trees. Namely we need:
system/security/softkeymaster
hardware/libhardware/include/hardware/keymaster.h

Maybe others as I did not document very carefully what I was
pulling in.

Change-Id: I465fd1fbe228803ec02fba047b151f07ea13d5ca
2014-12-12 18:50:11 +00:00