Commit Graph

1252 Commits

Author SHA1 Message Date
Ethan Yonker
25f20c1928 Fix wiping crash when block device is not present
Especially with /sd-ext, trying to wipe when the device is not
present causes a seg fault in the make_ext4fs function. Check to
make sure that the block device is present before trying to wipe.

Change-Id: I91973b5b832c9edbce81d61a271e84363c19e6c5
2014-10-14 09:04:54 -05:00
that
5823d48f9e mtp: fix log spam: findNode not finding a node is not an error
The requested file might be on another storage.

Change-Id: Ia71525058b616a28a8ea2b4ab48ebac1c790757e
2014-10-14 15:19:29 +02:00
Captain Throwback
5f4fd8c03e Update reference to 24-hour clock
Change-Id: Ic864fae4fda9707fc84d6d8b33587863b7664e1e
2014-10-14 08:17:04 -05:00
Jenkins
1710bf2547 display cpu temperature in twrp
use TW_NO_CPU_TEMP := true to disable display
use TW_CPU_CUSTOM_PATH := path to set custom path

Change-Id: Id260ecbb4ec36a78442387329944f67003d0f6a0
2014-10-14 15:08:11 +02:00
Vojtech Bocek
76ee903d84 Add support for TrueType fonts
* Keeps original font system in place
* Uses the same API as original font system:
   - You can render only one line at a time
   - You can only use one font and color for one gr_text* call
* Caches all rendered text, with a string cache limited to 400
  entries, then it trucates to 250, which results in memory
  usage hovering around 5-10MB

Change-Id: I36107b9dcd8d57bae4486fce8b8f64e49ef3d906
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-10-14 15:06:56 +02:00
Dees Troy
b4bd697f27 Fix exfat-fuse handling
Change-Id: Iac1966a1c5bfcb627e1bee7100c4b5d069b0a5b7
2014-10-09 18:47:00 +00:00
Tom Hite
5a9267283c performance profile support
Many device trees support the recovery.perf.mode property to
set various core frequencies and online/offline mode. TWRP is
highly threaded, and support for multiple cores on many operations
dramatically recudes the time, e.g., backups, zip flashes, etc.

p2: removed user notifications

Change-Id: I957b8ca40b241c0af0471327eeb329cce1816017
2014-10-08 19:35:32 +02:00
that
9e0593eaf6 mtp: cleanup, fixes and performance improvements
- use std::map instead of linked list
- read directories on demand
- fix writing zip files to storage root
- fix creating directories
- lots of minor fixes
- simplify generation of storage IDs and make them spec compliant

Change-Id: I2137c27549ddbdc58466f2e3aeda464fac70a3c5
2014-10-08 18:34:39 +02:00
Matt Mower
66766fe408 Update RECOVERY_VARIANT blocking to use project-path-for
Using RECOVERY_VARIANT to allow recovery to reside at
bootable/recovery-(variant) has changed at CM. project-path-for now
handles all the path re-mapping. This is simply a compatibility update
to be able to continue using RECOVERY_VARIANT with TWRP in a CM tree.

Change-Id: I66769d85b2a111e837f206b1c9a5bc07d6ac0d86
2014-10-08 18:24:06 +02:00
Captain Throwback
ff5935f7ef Attempt to fix md5 issue with backups
thanks @bigbiff for the suggestion

Change-Id: Ie9b55537b7fa300461b015d2b9523d4250e755a9
2014-10-08 18:22:08 +02:00
Conn O'Griofa
d9201048c4 applypatch: add support for BML partitions
This actually uses the EMMC partition access code. In order for this
to work, the BML partition name is changed back to the block
device name (e.g. "boot" -> "/dev/block/bml9"), and the
BML_UNLOCK_ALL ioctl is called before writing.

Change-Id: I012f1eca0b486b7465ca38b5db1f513ee8a246ea
2014-10-07 21:00:29 +02:00
Jenkins
7e22c27609 atime is access time, let's just use mtime
Change-Id: I828bc473a263868bd82b042c4009701d09a77a1f
2014-10-07 20:55:39 +02:00
Matt Mower
e96c3c34c2 Remove extra slashes from zip path in openrecovery
TWFunc::Get_Path() returns a path with a trailing slash and the substr
method is returning a string with a leading slash, so we don't need to
specify additional slashes for wholePath in Locate_Zip_File().

Also, put 'value' readout to log on its own line if it exists.

Change-Id: I2a4db6dbde5552f5a803eabb0599fd983d683fca
2014-10-07 20:49:54 +02:00
Captain Throwback
6a1acf2ce4 Fixes for exfat-fuse
Change-Id: I46a1e7bf115c45616774b0571b17e38777ba87f8
2014-10-07 13:48:25 -05:00
Benoit Goby
689e06b6e6 recovery: Fix adb with linux 3.10
In kernel 3.10, f_adb has been removed and adbd can use functionfs
instead. Mount functionfs on boot for adbd. On older kernels, mount
will fail silently and adbd will revert to f_adb.

Change-Id: I5db57aaf35b35859ea88c7d0e0661d8c553e5811
2014-10-07 20:44:06 +02:00
Da Zhou
d432deb371 ADB sideload command not work
In kernel(3.10) USB ADB gadget driver is removed.
Using Functionfs for USB adb gadget.

Android recovery uses a stripped down version
of adb command for sideload only. It's missing
the ffs function support, so add the ffs
support to allow sideload command to work

b/12608946

Change-Id: I4ad024723dfc5bdb544548391f99637c390b171e
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
2014-10-07 20:43:53 +02:00
Dees Troy
ae95d1a9f5 Check sehandle before fixing permissions
Change-Id: I73ba5519bf650f0c7f0a683f311099ff13747155
2014-10-07 20:35:18 +02:00
Ethan Yonker
6277c79727 Attempt to automatically identify data/media devices
Change-Id: Ia3007fbced9ce3bc94efdb3dacc582a5e68a49a4
2014-09-19 22:34:09 -05:00
Ethan Yonker
1eff6cd5d1 Additional checks to prevent partitioning internal storage
Change-Id: I9fcd7e0169fbdd52405c0c86aafbef091f69411e
2014-09-15 13:30:42 -05:00
Motorhead1991
e444918539 Include no strict aliasing for MTP
Change-Id: I570bb1c1387ec16fb062d7844af12b24c74e3755
2014-09-13 04:18:45 +02:00
Ethan Yonker
8613dc0278 Fix handling of MTP fork/child process
Change-Id: Iacd8a38d21e9c8b0dfafefbeb646f46cd3ba02a1
2014-09-11 09:28:20 -05:00
Ethan Yonker
a1f38054c7 MTP: Build flag for setting custom MTP device/path
Change-Id: Ic19ec61dc6cb08df00eb1326d96262b46bb93bfb
2014-09-11 08:28:51 -05:00
bigbiff bigbiff
1812c89f39 MTP: fix some code paths
Still doesn't fix the bug of copying zip files to the root of
storage in Windows.

Change-Id: Iddec66a49c17cf48cbd1c67ad6679349ece8e05c
2014-09-09 09:56:14 -05:00
bigbiff bigbiff
26c47962ef mktime_tz is blocking, don't use it
Change-Id: I0a66a69b68d975389302ae4361c9c106eb722538
2014-09-06 18:34:40 -04:00
bigbiff bigbiff
2e33c5ee0b update exfat from current head
Change-Id: I7d93474296612fda1dde23f6e8690668d6880e27
2014-09-05 08:46:39 -05:00
Ethan Yonker
8dfa77780f MTP: Use fork instead of pthread
Change-Id: I95cf6f4def0c86f40c775738f0712323f0a0f146
2014-09-04 21:59:20 -05:00
Ethan Yonker
82ce28122d Fix reporting of folder size on exfat-fuse
Change-Id: Icfd4af21b9eeade68956e44ae89bae12398920df
2014-09-04 13:36:45 -05:00
Ethan Yonker
241a3ce4c5 MTP: Better handling of stat
Do some error checking of lstat calls and better handle those
errors.
Use lstat instead of dirent to check if an item is a directory
because dirent does not return the correct item type when using
exfat-fuse.

Change-Id: I0d008aff55a0e0b4fbeae24cf8d0c04453b7b77e
2014-09-04 13:05:35 -05:00
Dees Troy
2e07c0493e MTP Fix rename in Windows
Change-Id: Ieef2fc16aac1da3d03908cfb285895954b42a14a
2014-09-04 15:01:30 +00:00
Dees Troy
53ea0a166c MTP Fix property list for multiple storage devices
Change-Id: Ice23fef31439a6c88d0a12380688eccd8dc3a71c
2014-09-04 14:17:50 +00:00
Ethan Yonker
12055fac83 Properly set mtp enable variable if disabled during boot
Change-Id: Iedf08419a1fd46908e5b9186a769a0497ce62ca8
2014-09-04 08:06:53 -05:00
Ethan Yonker
6f49e11d8a Prevent MTP enable on startup if crash detected
Change-Id: Ie1388a8acadf714a29721dd90c7f9a8aa38a860d
2014-09-03 21:42:49 -05:00
Ethan Yonker
c8743cf5d5 Allow MTP debug setting to stick through a reboot
Change-Id: I81eb5eaa2286c0ee3078e01304d65b9489f13bf2
2014-09-03 21:16:40 -05:00
Ethan Yonker
5e083dcc20 Improve MtpStorage handling when more than one storage is present
Change-Id: I02f1984d02a85d9fd42450cc3772e88a43d9e9ff
2014-09-03 15:06:00 -05:00
Ethan Yonker
6d154c4fe2 Allow toggle of MTP debug
Via command line in TWRP:
twrp set tw_mtp_debug 1

This will enable debugging for MTP. You will need to disable and
re-enable MTP in order to see the debug logging.

Change-Id: Ia7bb0c584e10a4322b65ecf80a67ed7ee836b38e
2014-09-03 14:22:50 -05:00
Ethan Yonker
20fd25c231 Improve error handling during MTP startup
Change-Id: I9395481dd8d9cbd3346fe6682557236b48b4d6cd
2014-09-03 14:04:43 -05:00
Ethan Yonker
73da42cb6e Ensure that MTP is enabled by default
Change-Id: Ibd644509935cde1e52b3d368060fdcb6e16f4a99
2014-09-03 11:30:33 -05:00
Matt Mower
81742fbcbc Only use SELinux tools from toolbox if not in busybox
If busybox has SELinux support, we don't need toolbox to provide SELinux
specific tools. Check busybox for restorecon to see if SELinux support
is present and then adjust the tools built by toolbox based on this.

Change-Id: I30a2b036b97ac3e26510d5e0498c52d7a8af36e1
2014-09-03 18:23:04 +02:00
Matt Mower
55c75cad80 Build block TWRP with RECOVERY_VARIANT
Enable TWRP to reside alongside other recoveries with the naming
convention: bootable/recovery(-flag). If TWRP resides at
bootable/recovery and a device does not specify RECOVERY_VARIANT, then
it will build like normal. If TWRP resides at bootable/recovery-twrp,
then its makefiles will only be parsed if a device specifies
'RECOVERY_VARIANT := twrp'. This prevents TWRP specific makefile
warnings/errors (notably, missing DEVICE_RESOLUTION) when another
recovery is being built.

Change-Id: I8f02fffcd79c309c7123b9428eedc69af02e126e
2014-09-03 10:53:37 -05:00
Dees Troy
298c4387f7 Refresh partition details after changing file system
Change-Id: I24f3c8587f778c4f0ef43737243c8378a3fd0e00
2014-09-03 14:42:26 +00:00
bigbiff bigbiff
c7eee6fef0 add mtp responder to TWRP.
Big thanks to Dees_Troy for helping with the implementation.

Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
2014-09-02 21:44:49 -04:00
Ethan Yonker
3c4ac3bc32 Fix derp
Change-Id: Idf41990258361e612635980700fd694b11c1c625
2014-08-14 11:15:32 -05:00
Ethan Yonker
5742a40b87 Allow blacklisting input devices by build flag
Usage:
TW_INPUT_BLACKLIST := accelerometer
TW_INPUT_BLACKLIST := "accelerometer\x0agyroscope"

This can be used to fix touch input on devices where an input
device is breaking touch processing in TWRP.

We are using new line chars to separate multiple devices and in
the make file you specify the new line character with \x0a which
is the hex code in ASCII for a new line.

The new line character might be a bit of a pain to use as a
delimeter, but it is highly unlikely that an OEM will ever name
an input device with a new line character in the name.

Change-Id: I255136b7a686909a23e649918c661843153c2853
2014-08-14 10:05:40 -05:00
xNUTx
e85f02dd91 Support reading since_epoch and secondary brightness files
TWFunc::Fixup_Time_On_Boot: Will now try to read
/sys/class/rtc/rtc0/since_epoch to correct time, if that fails
it will try to use the ats files to correct time.

TWFunc::Set_Brightness: One single function to set brightness
from both the automated functions and the gui actions. It is
able to set a second brightness path if present, it will set
them both the same value. Many Sony devices have 2 brightness
files in the sysfs that must be set to properly set the
brightness.

Change-Id: I7ca582109085dfbcb46b8de73ad031e4b7903fca
2014-08-10 08:57:14 -05:00
xNUTx
cd56f8cb29 TW_SCREEN_BLANK_ON_BOOT will jolt the screen/touch driver.
If on the default settings the screen will only kick in to action
AFTER it has gone to sleep once and has been woken up again with a
key press, this will be needed to set to 'true' in the
BoardConfig.mk

The code was already there, Dees_Troy and I thought it would be
nice to make it a switch to control at compile time.

Change-Id: I5116a27afe9cba57122761c192ea3ee153d98162
2014-08-10 07:59:35 -05:00
Ethan Yonker
03a42f6c6a Add command line capabilities
Allows sending openrecoveryscript commands to TWRP via shell.
This may be handy for visually impaired users, for various one
click utilities to drive TWRP commands from a computer, for using
TWRP when a catastrophic hardware failure like a shattered screen
prevents you from being able to use touch, or even on devices like
a TV stick where touch and USB mouse input is unavailable.

This patch also includes a few minor changes to openrecoveryscript
including proper support for rebooting via the script and for
decrypting the device via the command line.

Change-Id: I796ad168efdd2da9c25334ac93d1079daaa7b0bc
2014-08-09 07:49:35 -05:00
Ethan Yonker
b24caab14c Set font based on resolution if not set already
Change-Id: I6efaeb1c508c06513ac9ace7aa72a2eefa0cb1bb
2014-08-07 09:28:04 -05:00
Adam Outler
6f6a1d6dc7 removing logging test file
updating gitignores to keep file from coming back
adding gedit backups to gitignores

Change-Id: I36d55983b34d47763cb56abf784381c06d951302
2014-08-07 15:48:16 +02:00
Adam Outler
7f9906d0b6 remove stray test file
exfatfsck: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=c91c3e4c1e542e4a40bcad47ac747f62fb7312f9, not stripped

Change-Id: I32472d460a8f03776e1d215810c537b029789220
2014-08-07 15:47:47 +02:00
Vojtech Bocek
18d7c98688 Add possibility to use images as background or handle of slidevalue
* Add tag <resource background="x" handle="y" handlehover="z" />
  to the slidervalue object.
* All images are optional, e.g. you can use just handle or just
  background image or no images whatsoever

Change-Id: Ie0fee92965c6e883c4e532732756008dcc9e385e
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-08-07 15:37:43 +02:00