Commit Graph

1717 Commits

Author SHA1 Message Date
Ethan Yonker
0a3a98f892 Unify scrollable list code
The goal of this patch set is to eliminate the code duplication
caused by copy/paste of the code in the file selector, listbox,
and partition list GUI elements. Those classes will now utilize a
single GUIScrollList class that will handle rendering and
scrolling.

Change-Id: I0cb98ab36cf47178296034293435225658c779cd
2015-02-05 14:51:24 -06:00
Ethan Yonker
9132d91253 Disable stock recovery replacing TWRP during ORS
-Create a separate function to disable stock recovery flashing
-Add a call to that function to the reboot section of the ORS
 action so that an OTA update will not inadvertantly replace TWRP

Change-Id: I43eae81e0e76971b6e8d34c38785dc73772242d2
2015-02-02 18:23:25 +01:00
dhacker29
a3fa75fd66 Allow wiping f2fs to reserve space for a crypto footer
We will convert a -16384 to 16384 if needed because mkfs.f2fs
does not like negative numbers like make_ext4fs does. Also enable
trim by default on f2fs.

Change-Id: I8b41e65d1ff894433665c65d0569a51803c67891
2015-02-02 11:19:51 -06:00
Ethan Yonker
1b03920ca7 MTP: make MTP work even if unplugged and replugged
Set up a loop to keep trying to open / read the MTP device so that
MTP will work even if the device is unplugged during boot or
unplugged and replugged in.

Change-Id: I0d3a3b7c91ce84a8cbed16caa4b15efee35b3641
2015-02-02 15:45:51 +01:00
that
1a7ba9751f gui: simplify code in GUIKeyboard
- merge duplicated code into new ParseKey method
- convert some unsigned int to int to avoid warnings
- add local variable for current key in NotifyTouch to reduce clutter

Change-Id: I98ddbaca50d487c97ab6e98938df91ef03b9aed5
2015-02-01 19:48:19 +01:00
that
5fa54ce78b gui: fix potential invalid memory access
A single char should never be treated as a string.

Change-Id: I5f8459495f7d0f907ac7c0ae6dd73a3428d92d23
2015-02-01 16:15:29 +01:00
that
f37aec20dd gui: fix hardware keyboard
- Power+voldown works again for taking screenshots
- Right shift key isn't stuck until users presses "s"
- Don't use DataManager for local variables
- Simplify handling of Shift keys
- Clean up #includes a bit

Change-Id: Iff0453107beaa336a9c04422b43e92225fdbe069
2015-02-01 13:38:35 +01:00
that
c5837f3997 gui: fix lag (and event logging)
- Process multiple input events per frame even if rendering takes longer
than 33 ms. Limit minimum frames per second to 2 instead, allowing us
to catch up with the input events. The lag was especially visible when
using the mouse.

- Move blankTimer calls to the main input function so that moving
the mouse also unblanks.

- Fix a compile error with event logging.

Change-Id: If9e0360f5cc0562c4356611afc61b6d583fb1ec4
2015-02-01 01:59:43 +01:00
that
73a5295f69 gui: run cancel action in another thread
Some actions did not have an operation_end where needed especially
when dealing with cancel actions.

Cancel actions now do not run operation_start or operation_end
and let the original action handle the operation_end so that the
GUI waits until the original action acutally cancels.

Change-Id: I28e6260abb058acb982cecd108c09fc89e0ffeed
2015-01-30 16:12:21 +01:00
that
9fa5153aed gui: move input handling into a class
Change-Id: I97e08a23369af0112875af84b3fb529cf42e929e
2015-01-30 16:11:58 +01:00
Ethan Yonker
e13fa63dc0 Move input handling into the main thread
This also makes the hardwarekeyboard.cpp file that I created for
the Asus Transformer tablets with a keyboard dock the default
hardware keyboard handler. USB keyboards should work properly now
if present for keyboard input.

Change-Id: I724606e91ffe2a55265a9d1cb1ec714de244d38b
2015-01-30 16:11:31 +01:00
Bogdan Seniuc
d1372f732c Fixed screen flipping for devices where xres_virtual > xres
Change-Id: I3efc10e2c9759a358ded5b46f6125958e6d6bd66
2015-01-30 04:32:34 +01:00
that
f8194e2924 gui: fix IsInRegion
(0,0) was inside the region of "locationless" action objects,
leading to all kinds of strange behavior when clicking in the
upper left corner.

Change-Id: I222db4ff499f3c30605b05267f005accb2e0dc99
2015-01-29 21:00:41 +01:00
Vojtech Bocek
ecd8918634 Use macro to add actions to the action map
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I283b33087817eb87dae916a3183a9024dd35effd
2015-01-29 15:34:52 +01:00
Ethan Yonker
1b67fff361 Use TWAtomicInt in MTPStorage
Change-Id: I3450fd2334a441c3d9d40a856128a3cc932cb7f3
2015-01-27 08:50:48 -06:00
Ethan Yonker
045369540d Use TWAtomicInt in gui.cpp to make it thread safe
Change-Id: If05202355d3773e73541288c922fa6c69b1a9ad7
2015-01-27 08:41:28 -06:00
bigbiff
7abc5fe195 Add cancel backup capability.
This will stop the iteration of the partition objects, kill the
current twrpTar thread and remove the backup directory.

Implement TWAtomicInt class to give us a wrapper that automatically
uses mutexes before the read and write to help ensure that the
reads and writes will be atomic based on documentation.

Change-Id: I645b22bc980a292e9c7202acb24ffd22ebe68c63
2015-01-27 15:07:19 +01:00
Dees Troy
3454ade92d Use /twres instead of /res for theme resources
AOSP and other ROM trees now do a rm -rf of the res folder during
the ramdisk creation process that removes the TWRP resources.
Using /twres instead of /res works around this issue making TWRP
more compatible with AOSP and other build trees.

Change-Id: I0d4c7e06ca381ac5aa0069b6f2b8c47f7dec49e7
2015-01-22 15:21:27 -06:00
Ethan Yonker
d9ff3c5dd0 Hide some non critical error messages
Change-Id: I6e43242e44ce63cea9472c75a9f7fedf1b34fbbe
2015-01-22 17:57:29 +01:00
Dees Troy
0f3aa1e157 Merge "Include libpcre if present" into android-5.0 2015-01-22 17:56:42 +01:00
Dees Troy
e176a65e3d Include libpcre if present
Change-Id: I51bdabbd5b2c2263f3f72cdd2ffcba2bc97e0c43
2015-01-22 10:56:07 -06:00
Dees Troy
4f4a7a524a Remove fibmap.f2fs from relinking
Change-Id: Ibf43367446782642f41d437d1d97d62fc7dbb185
2015-01-22 17:54:21 +01:00
Ethan Yonker
fd0439ed59 Move ORS command line into main thread
Also eliminate the mostly similar runPage function in favor of
using a single runPages function to avoid code duplication.

Change-Id: I46ef414beb4009fee16d4de13d8a5ab2b9678409
2015-01-22 17:51:57 +01:00
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