Commit Graph

314 Commits

Author SHA1 Message Date
Matt Mower 80f7b361f0 exfat: Build fsck and update path to mkfs
* Usage of fsck.exfat is already included in partition.cpp, but the
  tool is missing.
* Update the path to mkexfatfs so the button is available when changing
  filesystem.

Change-Id: I5f4e27357c6b5a8606043d1bdc2488cc83e55d90
2015-12-22 15:26:01 -06:00
Ethan Yonker ab7955d874 Improve string resource lookup in twmsg
Change-Id: Iaac7d3df0bd12a4d817d4ad273254662865b775a
2015-12-21 10:18:03 -06:00
Ethan Yonker 9ce9591cfb twmsg: fix notfound detection
Change-Id: Ie95fdfaed7011994ac11202d070edeb95032b805
2015-12-20 22:50:23 -06:00
that d62d886d9c twmsg: fix build error (isdigit not declared)
Change-Id: I3101d15e5d94241cf8e583d1e06e09f3bc8b31f7
2015-12-20 20:40:15 +01:00
Ethan Yonker 74db157b94 Multiple Language Support
This is similar to https://gerrit.omnirom.org/#/c/14014

A lot of the features built in the older patch set have been split
out into separate patches, most of which have already been merged.
The remaining functionality here should all be directly related to
language selection and loading. We always load English as a base
before loading other languages over the top of the base. The idea
is that if another language is missing a translation, then we will
still display the English.

Maybe still to do: read the /cache/recovery/last_locale file and
load a language based on that. For me, this file contains just:
en_US
We probably won't bother with region specific translations so we
would have to look at either trimming off the _US or using some
other method like perhaps a symlink or a combination of the two.

Thanks to _that for twmsg.cpp class

Change-Id: I9647a22e47883a3ddd2de1da51f64aab7c328f74
2015-12-19 08:31:01 -06:00
z31s1g 28f0a92bb2 gui: stock theme rework
Tries to combine the current theme with a touch of material.
Page structure is untouched for the most part.
Layout grid is changed to achieve a "less random" placement of
objects on a page.

Change-Id: Icaf796be410431b17d5be6ccc1134d40912bef0b
2015-12-19 08:28:11 -06:00
Matt Mower 18794c820f Update dosfstools
* Version 3.0.28
* Update filenames in source
* Remove unnecessary symlink to fsck
* Commit "Recode short filenames from DOS codepage (default 437)." has
  been reverted since we do not have access to iconv
* Commits cherry-picked on top of 3.0.28:
    - mkfs.fat: fix incorrect int type
    - Prevent out of bound array read in date_dos2unix()

Change-Id: I50310235c62ec2e6bc90afcd10f2814d3afb5113
2015-11-26 06:09:55 +02:00
Ethan Yonker e0f1f3b4d1 Move reloading of theme outside of the action thread
Reloading the GUI while the GUI is running and rendering is very
dangerous as we may be deleting GUI resources before or while we
are trying to render those same items. This change will allow us
to safely load new resources and delete the old ones.

Fixed a double free situation that was causing a crash on every
other theme reload.

Clear parsed xml documents when we are done loading the theme
instead of keeping them in memory for the life of the theme to
help save a little memory.

Store starting page so that if we request a reload, we can enter
the theme at the same starting point, which may come in handy if
we allow for language selection on alternate starting pages such
as the decrypt prompt or the system read only prompt.

Change-Id: I45a7e3fb3daeefac56d70f8d4936938eb1244b99
2015-11-09 14:57:23 -06:00
Ethan Yonker fd52b987e5 Fix bution action position when using textplacement TEXT_ONLY_RIGHT
This makes the touch target include both the text and the image
for buttons masquerading as a check box.

Change-Id: If8432c5863de136b1a215dabb3e06109ccce4410
2015-11-06 15:24:35 -06:00
Ethan Yonker 1673e3d4ea Treat /vendor like /system for read only
The vendor partition is verity checked just like system so we
should treat vendor as read only same as system.

Change-Id: Ida65c9f44d8610e52fcdcef0b4a50faf5c7110d2
2015-11-05 21:07:21 +02:00
that 54e9c839bc gui: fix default styles if object type is in element name
Change-Id: I4bc46d1772fee2ec77d95732fa3f69c267c2c34e
2015-11-05 20:52:46 +02:00
that 35f17402e4 gui: fix initial state of checkboxes in listbox
The GUI is initialized before DataManager loads the settings file,
so we need to update the checkboxes on page change too.

Change-Id: If4c694872608ec4014220364bd759c1399502994
2015-11-05 20:48:24 +02:00
Ethan Yonker 25474e45b8 Fix screen timeout text placement
Change-Id: I7b020c7048f9bbb550e9f5100c604c01809e4fbd
2015-10-26 21:44:22 -05:00
Ethan Yonker 44925ad190 GUI TextBox
Allows the GUI to create a scrollable text box for long text that
may not all fit on the screen. Also includes code to allow the
console to wrap on spaces and other such characters instead of
wrapping in the middle of a word.

To see an example of how to add a text box to the XML, see:
https://gerrit.omnirom.org/#/c/14183/

Change-Id: Ifd139172ede290046b58ea3fe526e2e06da1d4ef
2015-10-26 11:54:16 -05:00
Ethan Yonker d0514ba806 Fix a bunch of warnings
Mostly adding __unused where needed.

Change-Id: Ia4f675b9b360782728c361ed1699db0cc277c3a5
2015-10-24 17:36:24 -05:00
Ethan Yonker b7a54a3016 Allow text to scale to fit
Change-Id: Iacd4bb78f551b51d092ecde09521b5541e7dadcd
2015-10-16 22:57:35 +02:00
that 8ab5c13428 gui: support conditions for listbox items
Change-Id: Iea189ac53ec3d7c1bea83da7b77684778b1c0f46
2015-10-16 15:40:31 -05:00
that 20fb95d0a7 gui: extract methods for condition list handling
This is a preparation for list item conditions.

Change-Id: Iec731d1986a53b0362c534adf504dfe8db87d3f0
2015-10-16 22:33:15 +02:00
Ethan Yonker 56ce332315 Allow listbox to have a list of check boxes
For an example of how to implement a list of check boxes, see:

http://bit.ly/1Giacw2
https://gerrit.omnirom.org/#/c/14284/2/

Change-Id: I0752a084625f4a0ef8cc6d99597f2fb9aa2ab9e0
2015-10-16 15:30:51 -05:00
Ethan Yonker 561c58de19 Use unified LoadFileToBuffer function
Create a single function for loading xml files to a memory buffer
to reduce code duplication.

Change-Id: I0ff64463072118f61a2eb8052f74019715020253
2015-10-16 15:23:56 -05:00
Ethan Yonker 88037f476f Remove support for non-TTF fonts
This patch set removes support in TWRP for the old .dat file
format as well as support for the AOSP style fonts in header
files. We need TTF for scaling.

Note that the old AOSP style header font is still supported in
minui which is not used by TWRP.

Change-Id: I6124a3333d479f1fc668138f7e32c4be9b519552
2015-10-15 09:23:39 -05:00
Ketut Putu Kumajaya f13b893c2c Unicode for temperature
Change-Id: Ie86dc63f83ae51e9947debc7191fd91d61b83008
2015-10-15 16:10:26 +02:00
Ethan Yonker c798c9cd24 Merge up to AOSP marshmallow-release
In order to maintain compatibility with older trees, we now have
minadbd.old and minui.old. I had to use a TARGET_GLOBAL_CFLAG to
handle ifdef issues in minui/minui.d because healthd includes
minui/minui.h and there was no other alternative to make minui.h
compatible with older trees without having to modify healthd rules
which is outside of TWRP.

Note that the new minui does not currently have support for qcom
overlay graphics. Support for this graphics mode will likely be
added in a later patch set. If you are building in a 6.0 tree and
have a device that needs qcom overlay graphics, be warned, as off
mode charging may not work properly. A dead battery in this case
could potentially brick your device if it is unable to charge as
healthd handles charging duties.

Update rules for building toolbox and add rules for making toybox

Use permissive.sh in init.rc which will follow symlinks so we do
not have to worry about what binary is supplying the setenforce
functionality (toolbox, toybox, or busybox).

Fix a few warnings in the main recovery binary source code.

Fix a few includes that were missing that prevented compiling in
6.0

Change-Id: Ia67aa2107d260883da5e365475a19bea538e8b97
2015-10-09 11:15:29 -05:00
Matt Mower 85161af111 ORS: Report success if AOSP script succeeds
When AOSP recovery commands are processed, the GUI reports a failure
just before reboot even when all commands succeeded. Set op_status
before reboot to indicate success.

Change-Id: I09e9357b04cd81f418264bf00a75311f48357414
2015-08-09 17:22:25 +02:00
that d16b2ce73e gui: support new theme directory structure
Change-Id: I8622da5ae321ba69a55b38e2f0b878b7ec149d02
2015-07-27 20:39:19 +02:00
Ethan Yonker ffc9174145 Really fix background color on 480x800 theme
Change-Id: I70324ae3e4fffe88bc2b5a02becb7d1f4f0ceab0
2015-07-22 08:22:33 -05:00
Ethan Yonker 961d20e09c Make system read only show no matter what on first TWRP boot
Initial value for tw_mount_system_ro is now 2. If the value of
tw_mount_system_ro is 2 during boot, then we will show the system
read only prompt and ignore the value from the lifetime writes
check.

Note: Changed the value of FILE_VERSION which will trigger the
data manager to throw out previous settings and start with default
values so that existing TWRP users will get the prompt at least
once.

Change-Id: I447767b64617f855156a19a5dc15c4ece6dff7b8
2015-07-14 16:53:43 +02:00
that c01391c123 gui: allow listbox to be used as menu and as read-only list
Also enable string insertion for list items.

Example how to make a menu item:
<listitem name="Lights on!">
	<action>
		<action function="setbrightness">255</action>
	</action>
</listitem>

If no <data> element and no actions on any items exist, the list is
read only and no item selection is possible.

Change-Id: Ib2668a982df2514484d44faa0396dd17550f39f3
2015-07-14 16:07:11 +02:00
that f6b2066ff3 gui: keyboard: support longpress label offset, code cleanup
To position the longpress label:
<longpress font="..." textcolor="..." x="5" y="0"/>
x and y is the distance from the upper right corner.

- extract method GUIKeyboard::DrawKey
- clean up handling of currently pressed key
- integrate key highlighting into main key drawing loops

Change-Id: I80ccf2975d30cffa2a48627a74ab3693c84e4fa4
2015-07-14 16:00:35 +02:00
Ethan Yonker 983be2a3fb Fix minor background bug in 480x800 xml
Change-Id: Ib67a356f8d5e6bb0f982c081fc88b6462c7fbd74
2015-07-13 15:04:47 -05:00
that b63e2f9156 gui: allow specifying object type in element name
e.g. '<button ...>' instead of '<object type="button" ...>'

Also get rid of default parameters to make things more explicit.

Change-Id: Ie4d1231b725aeb6cbf0041622c9780c86cf8e1c1
2015-07-13 15:04:11 -05:00
that f256b722f4 [WIP] gui: software drawn keyboard (code only)
Change-Id: I9f05c85f8d43ab012228a78b79220a27876a299d
2015-06-20 22:35:39 +02:00
Dees Troy 28a85d232f Make sure that adbd restarts after sideload
Change-Id: I7d82b95cd8749c6f8569739162708705faa6f1f7
2015-06-17 23:40:25 +02:00
Ethan Yonker e1abe616f2 Fix ORS scripts displaying an error after completing
Change-Id: I1329705fca870b4e3017607ad7c7875aa00d664b
2015-06-17 23:12:34 +02:00
that c7b631b7a2 gui: set tw_file to the currently flashed file name without path
To allow themes to show more of the file name on narrow displays.

Change-Id: I4962eed5e4a01f73a3cde126f2ba56428209fccc
2015-06-01 23:36:57 +02:00
that 5267a21667 gui: move retainaspect handling to the resource ctors
LoadResources should only decide on the resource type,
everything else is handled by the resources themselves.

Change-Id: I30f68293960c23560979f650efc4393992cf5824
2015-06-01 03:03:28 +02:00
Ethan Yonker d6966f4426 Fix unable to uncheck the mount read only check box
Change-Id: I1bbc25df6f35f79549f1eb06feb4db9ec0475aa5
2015-05-30 14:52:21 -05:00
Xuefer 46bdc96815 remove useless memset and \n
fgets reads up to one byte less than size then with \0 at the end
adding \n after \0 is useless too

Change-Id: I7758d7a8f885bdde2b491a9cb75800f831d77c1f
2015-05-29 17:56:19 +02:00
Ethan Yonker a2719156c2 Add resize2fs and ability to run resize2fs via GUI
Note: Only works on ext2/3/4 partitions. Only tested on ext4.

We can use this in some cases to resize the data partition if an
incorrect fstab caused recovery to not reserve the 16KB for a
crypto footer.

Sometimes the BoardConfig for a custom ROM does not have the
correct size for the system partition and if the ROM flashes a
raw system image, that image will not take up the full block
device. Running resize2fs can fix the size and may allow more
room in the system partition for customizations like busybox or
a larger gapps package.

Sometimes flashing a factory image may flash userdata with an
image with a file system that does not take up the full size of
the block device (e.g. factory images for the Nexus 6 will flash
userdata with a ~24GB userdata image, wasting ~30GB of space).
Using resize2fs we can easily fix this issue without having to do
a full format data.

Change-Id: I631f5c6f567bbc6a9241e5dd95f1e435820a1b13
2015-05-28 09:47:25 -05:00
Ethan Yonker eb32b1ff00 Mount system as read-only by default
Mounting system as rw can prevent future OTA updates. The purpose
of this patch set is to prevent TWRP from mounting sytem as rw on
the first boot. Device maintainers should update their twrp.fstab
files on these devices to include an additional line:
/system_image emmc /dev/block/../system

This line will allow TWRP to create a raw system image backup to
ensure that the user can return to an original state for future
OTA updates.

Change-Id: I8929d85bc3a5b96cc564bc7f734b58d5612ec833
2015-05-27 09:22:49 -05:00
Matt Mower d411f8da8e GUI: Prevent duplicate page overlays
If a page is requested for overlay, ensure it doesn't already exist in
the stack of existing overlays. If it does, erase the existing page
and push_back the new one.

Change-Id: I9feeea06cf7aad2e08a8c3bc567aaa761db2c3bc
2015-05-18 18:51:49 +02:00
that 202e51b1c2 gui: add DST rules to time zones for USA and Europe
This should fix daylight saving time display for most users.
For fully correct time zones we need the tzdata database.

Change-Id: I7b7693ab0abaf20be217bd06d525f03fb89b7217
2015-03-25 03:45:05 +01:00
Ethan Yonker 1c273318c7 Allow multiple overlays
This effectively allows us to support popup dialogs and the like.

Change-Id: Iafb3fa60ed635287cb59dce118f74dc8f2a4e60a
2015-03-19 12:32:39 -05:00
codelover 27b0aee5f1 Fix non-working "Do Not Install" button on "installsu" page.
* Applicable to non-rooted devices running portrait mode only.
* Touching the button has no effect, supposed to reboot/poweroff.

Change-Id: If67649c4c83ddf549c833f94c66829e0877969c5
2015-03-19 17:49:46 +01:00
Vojtech Bocek e8c3927461 Fix GUIPatternPassword when the pattern crosses already visited dots
Change-Id: I59b3f8c5604c036dbc74c020ee21aeeef28132d3
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-03-19 16:41:47 +01:00
that d86f49d3f7 gui: keyboard: introduce struct Layout and simplify caps handling
Also minor cleanups:
- move array limits from #defines to a protected enum
- zero fill layouts in ctor

Change-Id: I8fe0f8465ebc646ad3bf3cc3f8490dbdd384f43d
2015-03-15 00:56:57 +01:00
that e79878b7b6 gui: keyboard: add HitTestKey method, minor simplifications
Change-Id: I6cd0251dd9d933e6ebef977a553be7473e2d7034
2015-03-14 23:07:23 +01:00
that 7cec6361a8 gui: fix 1920x1200 keyboard "_", ":", "!" and "?"
"_" was broken due to a bad XML attribute name, and the others
didn't produce the highlighted character in shift mode.

Change-Id: I271fbf4e083ccdb69c469cbdae44101afed4fd1e
2015-03-14 22:52:15 +01:00
that 6db855e1c0 gui: keyboard doesn't need its own action
This was questionable design and is unused anyway.
Also reduced a few redundant #includes.

Change-Id: I65bb01120e6072c5695755920242f6f9d73c816e
2015-03-14 21:31:43 +01:00
Vojtech Bocek 7e11ac5d3c Add UI for entering pattern for device decryption
Change-Id: Ia2d3268a96423e9ca3846500c57e674c4f8fa60b
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-03-13 12:12:58 -05:00