Commit Graph

2413 Commits

Author SHA1 Message Date
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
Dees Troy 6299d2edc4 Merge "Revert :Force sync files written by minzip" into android-6.0 2015-11-05 19:45:31 +01:00
Ethan Yonker 25474e45b8 Fix screen timeout text placement
Change-Id: I7b020c7048f9bbb550e9f5100c604c01809e4fbd
2015-10-26 21:44:22 -05:00
Ethan Yonker 58b09f1a36 Fix SELinux issues for some devices
Reinstate some SELinux stuff in the default init.rc (noticed by
Kra1o5)

Add permissive.sh script to dependencies list for CM trees.

Change-Id: I36ade54378c413081d202002488309af35486d5f
2015-10-26 12:42:26 -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
maxwen c3540a96ec Revert :Force sync files written by minzip
forward port from 5.x
https://gerrit.omnirom.org/#/c/12524/

Change-Id: I303662cf28278bd9dd3799b3d0b5a07f96169416
2015-10-25 22:22:10 +01:00
Ethan Yonker 7dad625926 Add nulls during reading of settings and info files
Change-Id: Ie6202a8cc709d8593768f447ef95b4a815605d6b
2015-10-25 00:38:44 +02: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
that 8e213fdf08 fix build in Omni 4.4
Change-Id: Ida3984a6b774c2da12342d48d8644cd18de7396c
2015-10-22 08:10:38 -05:00
Ethan Yonker b7a54a3016 Allow text to scale to fit
Change-Id: Iacd4bb78f551b51d092ecde09521b5541e7dadcd
2015-10-16 22:57:35 +02:00
Ethan Yonker 11309e912d Union sepolicy within TWRP to make SELinux permissive
This patch set should make it easier to build TWRP in non-Omni
trees as it allows TWRP to modify the sepolicy instead of having
to merge a patch in external/sepolicy to meet TWRP's needs.

Change-Id: I73205343556abb0852ff4c5f8cbf293d840b95d9
2015-10-16 22:49:19 +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
Ethan Yonker 068c76888b Fix up twrpTar
Change-Id: I11a8f77b39a6f12aca6157c9aa76c34ef48c4b9f
2015-10-15 16:15:09 +02:00
that 5064048ec3 Improve error handling for zip install
- minzip: don't crash with corrupted zips (e.g. 4096 null bytes)
- twinstall: output error when zip doesn't contain update-binary
- twinstall: add strerror(errno) to system-level errors
- twinstall: correct message if /file_contexts could not be extracted
- twinstall: use TWFunc::Wait_For_Child for better waitpid errors
- twinstall: minor code cleanup

Change-Id: I53b156b0ec08755af2742bb71d1523ae38f4a82e
2015-10-15 16:10:53 +02:00
Ketut Putu Kumajaya f13b893c2c Unicode for temperature
Change-Id: Ie86dc63f83ae51e9947debc7191fd91d61b83008
2015-10-15 16:10:26 +02:00
Captain Throwback 999219d763 Update CUSTOM_LUN_FILE from AOSP USB config
AOSP has used a standard USB config for the last 3 years.
Time to update TWRP for devices that still use UMS.

Reference: https://android.googlesource.com/platform/system/core/+/master/rootdir/init.usb.rc

Change-Id: I59690f955a7d6db9ae9d607d46299652b52fe8b8
2015-10-15 16:09:02 +02:00
HandyMenny 37d42994cd Properly set sys.usb.config when ums is enabled.
Use sys.usb.config also for ums, but leave sys.storage.ums.enabled for compatibility with custom init.rc that use it.

PS2: Rebased - moved updates to init.recovery.usb.rc

Change-Id: Iad3441d23ac37612e58f63e4038d05c5c1a37b25
2015-10-15 16:04:16 +02:00
Davis Mosenkovs b909aae78f Fix minor interface bug: No-SU prompt after no-OS prompt
When /system is wiped in TWRP and afterwards Reboot -> Recovery is selected the "No OS is installed, are you sure you want to reboot?" prompt appears. After swiping to "Reboot anyway" the "Current ROM is not rooted, do you wish to install SuperSU?" prompt appears.
This change removes "Do you wish to install SuperSU" prompt after "No OS installed" prompt.

Change-Id: Ie1157afdf5cf1cb81d6647269172d6e63af9f4b0
2015-10-14 21:19:08 +02:00
Kra1o5 7756859abe Add support for RGBA_8888 pixel format
Change-Id: Ia15d49e51cad5bc8a3291975e1ff515a2b1c419c
2015-10-14 13:32:03 -05:00
Ethan Yonker a59da09dd8 Add qcom overlay graphics support to minui
graphics_overlay.cpp is based on a mix of AOSP code for
graphics_fbdev.cpp along with overlay graphics code from CAF that
was brought into earlier versions of TWRP and then further adapted
and improved before being brought into this patch set.

Also added a rule to build a minuitest binary for testing the
minui engine to ensure proper operation on a device.

Change-Id: I3972d3a6baa7002615319421ac07d9299c3cec69
2015-10-14 20:16:12 +02:00
Ethan Yonker e96182e052 Add 16bpp support to minui
Change-Id: I9a9ba6ccbef999b1a4b122e45f862bd3672b5047
2015-10-13 19:33:16 -05:00
Hashcode 7246b5d9e3 mtdutils: add include to fix implicit function warning
Including unistd.h fixes implicit function warning for "read" and "close"
in mtdutils/mounts.c

Change-Id: I72c3a52de035600cdd794ed5e2d4cae0da26f428
2015-10-13 12:47:13 -07:00
that 0579114c33 fix build in Android 4.4 (tested with Omni)
Change-Id: I781928483585052741fe1396bd9b136e61ca6538
2015-10-10 16:02:06 +02:00
that 8a1080e9e6 Revert "Use getmntent when accessing /proc/mounts."
This reverts commit a382e2bdb2.

getmntent is not implemented in older Bionic versions.

Change-Id: I277dae9e4fd83f08de8099e856e8d8f45e39239d
2015-10-10 16:01:57 +02:00
Ethan Yonker 5235f5550b Fix mkfs.f2fs error in 6.0 trees
Change-Id: I1217094f0e336445eb4dd5f46242d9719525ffbd
2015-10-09 14:46:47 -05: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
Ethan Yonker d6821a11bb Add TW_IGNORE_ABS_MT_TRACKING_ID
Fixes touch on Oppo R7 Plus

Oppo R7 Plus, when recovery is flashed and booted from the actual
recovery partition, the digitizer sends some extra touch data for
up to 10 different touch slots even if no actual touch is present
for those slots (ABS_MT_SLOT). This patch allows TWRP to handle
touch data properly for this device and maybe others.

Change-Id: I8f9171b605566788b674b3d4d96bd9f2f65736c2
2015-08-26 22:36:34 +02:00
Ethan Yonker 89583ef00f Fix up some TW_OEM_BUILD things
Fix factory reset now properly formats data as expected
Change text for ORS processing
Disable system read only check, SuperSU, and patch system
Stop copying fstab and version to cache

Change-Id: I20f5cae390afbb8d2d88e01b8d9b9bf4ff0fdea1
2015-08-26 22:36:16 +02:00
Ethan Yonker bc85b63e78 Wipe crypto key when formatting data
Change-Id: I032fabb383b4063e3b31b6044ce39966b8c617d0
2015-08-09 12:48:14 -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
The Android Automerger f5cfdcecf5 merge in mnc-release history after reset to mnc-dev 2015-08-05 01:00:53 -07:00
Tao Bao be19dce86c udpater: Call fsync() after rename().
We need to ensure the renamed filename reaches the underlying storage.

Bug: 22840552
Change-Id: I824b6e9d8a9c5966035be7b42a73678d07376342
(cherry picked from commit dc3922622a)
2015-08-04 11:28:12 -07: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
maxwen 44d59eaf16 minui: add BOARD_USE_CUSTOM_RECOVERY_FONT
we want to use it in charger

Change-Id: I3e0288b074bd7203214d218aaee69cb4798e9531
2015-07-16 02:36:38 +02:00
Ethan Yonker b81d905165 Add ntfs-3g support
Add support for mounting ntfs via ntfs-3g and support for wiping
and repairing ntfs partitions.

Change-Id: I82dc4626f459bb93b86eb9ebba64ad3a6560781b
2015-07-14 16:54:04 +02: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
Matt Mower ec009e8cd4 Allow devices to override USB init
This enables devices to provide their own USB configuration. The
contents of init.recovery.usb.rc can most simply be modified and
included in a device's init.recovery.${ro.hardware}.rc.

Use option:
TW_EXCLUDE_DEFAULT_USB_INIT := true

Rationale: Some devices handle USB pid switching in the kernel. In this
case, USB init provides switching functions which differ from the
standard on property:sys.usb.config=xyz. Other devices should not see
USB attempt mtp,adb mode when TW_EXCLUDE_MTP is set.

Cherry-picked from android-5.0

Change-Id: Ief0fcaf46a1782102166fc1b733a34b1a1ba0802
2015-07-14 16:48:43 +02:00
Captain Throwback 7fe1b3987a Update path for libcryptfs_hw to proper variable
Change-Id: Ie91d161f4e439a870534639f44a03df22f4fe39a
2015-07-14 16:38:50 +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
Paul Lawrence 6977276415 Revert "Change init sequence to support file level encryption"
This reverts commit 98c1a3de23.

Change-Id: I524060418de18f97c3865ebc4435f501015e92ee
2015-07-07 14:04:16 -07:00
Paul Lawrence 10cf0942a7 Merge "Revert "Change init sequence to support file level encryption"" into mnc-dev 2015-07-07 17:29:02 +00:00