Commit Graph

7554 Commits

Author SHA1 Message Date
Ethan Yonker e03158ebdd Fix gr_clip
gr_clip was not calculating the correct values after the rotation
patch. Since gr_clip width and height instead of taking a second
pair of x,y coordinates, we cannot depend as much on the
ROTATION_X_DISP and ROTATION_Y_DISP macros. The simplest solution
was to call scissor with direct values in most cases.

Change-Id: I25f9d575ec6ddc430fca4555f29c8334441fc95d
2019-03-19 11:40:28 -05:00
bigbiff bigbiff 3157f121ad Full screen action: simplify by just hiding navbar
Change-Id: Iab770ee47420deae08cc3c20127f36f53036fbec
2019-03-18 21:54:20 +01:00
lambdadroid eff335d850 prebuilt: Avoid re-linking ARM64 specific library on other architectures
libclang_rt.ubsan_standalone-aarch64-android.so is a library for
arm64 and is therefore not available on other architectures, causing
the build to fail because there is no rule to build it.

Change-Id: Ia4af38f42ba46a233d40e936d43e4c97c449d059
2019-03-18 18:17:16 +01:00
Vladimir Oltean d32b7ebf20 TW_ROTATION: add flag to handle hardware-rotated display panels
* The existence of TW_ROTATION that implements this feature at the
  level of calls to libpixelflinger API closely mirrors the existence of
  ro.sf.hwrotation for surfaceflinger in LineageOS.
* A brute-force approach was previously attempted via the
  BOARD_HAS_FLIPPED_SCREEN makefile flag. That code iterated over the
  active display surface in a double-buffered setup, and performed a
  "smart" memcpy from the UI drawing surface (gr_draw) onto the display
  surface. The problem was that, without heavy loop optimizations, that
  code could have never scaled for 90 and 270 degree rotation.
  I tried and you could literally see the for loop with the naked eye
  while the display surface was updating.
* That code is now gone, but support for BOARD_HAS_FLIPPED_SCREEN := true
  is still there (now means TW_ROTATION := 180).
* This patch relies on the assumption that it is impossibly difficult
  and non-portable to rotate whole framebuffer display surfaces, in a
  way that is not dependent upon the graphics backend (adf, fbdev, drm,
  overlay etc). Therefore, it identifies the rendering primitives that
  the TWRP graphics stack exposes to the GUI application above, and
  implements hwrotation inside each of those calls instead:
    - gr_line(), gr_fill() - 2D geometric shapes (lines, rectangles)
    - gr_blit() - graphical image resources
    - gr_ttf_textExWH() - font rendering
    - gr_fb_width(), gr_fb_height() - framebuffer resolution
* The gist is to keep the backend and framebuffer (dimensions, row size
  etc) unchanged (because making changes there is asking for trouble),
  but present an altogether different reality to the calling API,
  according to the compile-time constant TW_ROTATION.
* All (x, y) API coordinates and shapes are transformed before being
  actually rendered as (x_disp, y_disp) display coordinates.
* With TW_ROTATION := 90 or 270 you can turn a landscape device into
  a portrait one, because the GUI is fooled by the reversed dimensions
  reported by gr_fb_width() and gr_fb_height() and renders the UI as
  for a different device.
* For blit and text rendering operations, figuring out the transformed
  coordinates in display space is not enough, as the surfaces that are
  to be rendered have to be rotated themselves. This is handled by
  allocating an intermediary rotated surface on each rendering
  operation (not ideal), so the code with the intermediary surface
  is compiled out for the TW_ROTATION := 0 case.
* This is still not as bad as rotating the whole framebuffer though, and
  on a msm8976 device the performance hit is not even noticeable (for
  software rendering).
* Currently there is no attempt to make a connection between the
  TW_ROTATION and the { RECOVERY_TOUCHSCREEN_SWAP_XY,
  RECOVERY_TOUCHSCREEN_FLIP_X, RECOVERY_TOUCHSCREEN_FLIP_Y } settings.

Change-Id: Ic8966ad5360c8a499649fdb16e242286640fd992
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
2019-03-18 11:39:38 -05:00
bigbiff bigbiff 19874f1469 AB/Non AB Devices: updates for moving cache
This patchset updates all the places we touch cache on AB devices
and non AB devices so that we can write to the appropriate
location. AB devices removed the cache partition and moved it to
/data/cache.

Change-Id: I485ec205a604f1f07ceb7700ae9c4e720fd55c3e
2019-03-18 04:49:38 +01:00
bigbiff bigbiff 3ed778ad63 Vibration: allow BoardConfig to disable vibration for a device.
Change-Id: Ibd2f67391ce6d7774498839829e0de9391508781
2019-03-17 22:39:00 -05:00
oshmoun 9220dbab44 fix building TWRP for devices without cache
Some devices do not declare BOARD_CACHEIMAGE_PARTITION_SIZE.
This case is detected and required modules are added to LOCAL_REQUIRED_MODULES.
However, := is used instead of +=  and causes the loss of all previously added modules.
The end result is that twrp is not actually getting built since its module was lost.
Fix that by using += when adding modules required for cache-less devices.

Change-Id: Ib0a4db4955040ced77be7ed04d636905beadf093
2019-03-18 04:27:35 +01:00
Dees Troy 5f8394ca88 Merge "slot management: add library for slot management." into android-9.0 2019-03-17 16:09:56 +01:00
big biff 3ae89edb40 Merge "Fix build error on Pie with TW_NO_LEGACY_PROPS := true" into android-9.0 2019-03-15 01:06:47 +01:00
big biff 6b9ee0e0b2 Merge "Revert "Fix ld.config.txt errors on Android 8.1 system root devices"" into android-9.0 2019-03-15 00:40:46 +01:00
big biff 4087034d08 Merge "Add path for time and date fix" into android-9.0 2019-03-09 22:24:26 +01:00
big biff 7812dd49e1 Merge "vold_decrypt: Add android 9.0 support" into android-9.0 2019-03-08 00:52:21 +01:00
Captain Throwback 5ab596451a mksh: add mkshrc when using TW_USE_TOOLBOX
Fixes broken shell prompt in Terminal and adb shell

Before: https://del.dog/7vphlkc
After: https://del.dog/vhkjgo8

Add as prebuilt with suffix "_twrp" to avoid conflict
with original mkshrc and rename via POST_INSTALL_CMD

Prebuilt version adjusts TMPDIR variable from
"/data/local/tmp" to "/tmp" for TWRP

Change-Id: I42a1b2a8c114f66dbe659c07485f1dfae8a5d314
2019-03-07 18:34:15 +01:00
big biff 968009d741 Merge "partition: add squashfs support" into android-9.0 2019-03-07 15:00:38 +01:00
Mauronofrio Matarrese 2dab70d83c Add path for time and date fix
This will add another path where looking for ats_* files

This is needed on some devices like OnePlus 6/6T

Change-Id: I9ac7cdd05ddc80f3e269efda96be2b7712d68af0
2019-03-05 02:23:58 +01:00
big biff f9ec593f1e Merge "minuitwrp: Remove unused variables" into android-9.0 2019-03-03 01:04:23 +01:00
bigbiff bigbiff c630cee1ae slot management: add library for slot management.
Change-Id: I7d0a67bc8e237866485680a5c54443435e7d2737
2019-02-20 18:06:55 -05:00
Erfan Abdi b859e91cd4 partition: add squashfs support
Change-Id: I56217b8fa4f247773157e04b03bd87128c612a00
Signed-off-by: Erfan Abdi <erfangplus@gmail.com>
2019-02-05 18:19:42 +02:00
nijel8 2c821a8c0a vold_decrypt: Add android 9.0 support
* build modified vdc_pie binary with 'checkpw' command support
  if building with Android 9.0 platform. That command and others
  we don't care about, are removed from Pie vdc. Our vdc_pie will
  run if system sdk version is > 27, otherwise system vdc is used.
  Code adapted from Android 9.0 system/vold/vdc.

* include prebuilt vdc_pie(arm, arm64) binary if building with lower
  than Android 9.0 platform - vdc_pie cannot be build from source
  with those platforms without additional imports from Android 9.0

* skip vdc "getpwtype" command for Pie - vds communicates with vold
  directly, no need for connection retries first

* add /system/bin/servicemanager to required services

* mount per-devive additional partitions needed for decryption
  listed with device BoardConfig.mk TW_CRYPTO_SYSTEM_VOLD_MOUNT
  flag like(space separated):
  TW_CRYPTO_SYSTEM_VOLD_MOUNT := vendor cust odm

* add function to backup crypto footer before running vdc commands
  and restore it after - on Xiaomi Mi Max 3 both Oreo and Pie stock
  roms vold alters cripto footer when decrypting data in recovery
  which causes system to ask for crypto password at next reboot
  although password stays unchanged. Crypto footer backup/restore
  added as workaround for systems whit ro.build.version.sdk > 25.
  Also to preserve crypto footer integrity decryption attempts are
  skipped if footer backup fails to ensure no data loss.
  Code adapted from
  https://gerrit.omnirom.org/#/c/android_bootable_recovery/+/31206/

Change-Id: I0a383f3843578fa55595cfea3b7c9c4431646a1a
2019-02-01 21:36:23 -05:00
nijel8 a833939109 Hide navbar while running operations
-switch to full screen when user is not suppose to do
 anything but wait for current operation to finish

Change-Id: Ib54afc380a5cfe70e011e782cf3d7fe4c80958a4
2019-02-01 00:43:02 -05:00
Captain Throwback 5cb78dc280 Revert "Fix ld.config.txt errors on Android 8.1 system root devices"
This reverts commit 1ccdefab79.

Reason for revert: Causes delay during boot resulting in failed decryption on FDE devices. Recommend having device maintainers specify this variable manually in rc file and include actual ld.config.txt (or placeholder) in ramdisk directly.

Change-Id: Ib2410675396b38522d690c6057057d164cc0cff2
2019-01-22 19:28:02 +01:00
big biff c757a66477 Merge "Revert "updater: Remove dead make_parents()."" into android-9.0 2019-01-19 17:02:53 +01:00
Captain Throwback f0167c4af9 toybox: create getprop symlink on SDK 27
Currently when building for SDK 27 with TW_USE_TOOLBOX,
no getprop symlink is produced. This minor change creates
a symlink for getprop on SDK 27.

Change-Id: I71bd3e0d0525bd0ae51634f52a5749ba0ff58444
2019-01-18 13:19:13 -05:00
Andreas Schneider df7c39dfcd minuitwrp: Remove unused variables
Change-Id: Ia5cfb747f300557ebd719538244655c8b792c407
2019-01-18 09:09:00 +01:00
Ethan Yonker 54970bb1a9 Fix Check_Lifetime_Writes on AB devices
Change-Id: Ie1904d9c48639e8ac9f95d9d2dfb1d965c571928
2019-01-17 16:19:55 -06:00
Ethan Yonker 933828251d Add metadata decrypt support for FBE
Change-Id: Ie0292f4ffea5993a4ae74fa04fc5c8252ca2cfcf
2019-01-17 14:14:59 -06:00
Ethan Yonker 2f685279fd libminuitwrp updates for Pixel 3 devices
Fix rules for adf graphics to detect their presence when ninja
make files are used.
Change pixelflinger graphics mode so that colors display properly
on the Pixel 3

Change-Id: Ie7181be6c5e1e9a007b58fd798b2cef787ce4a01
2019-01-16 10:11:28 -06:00
lambdadroid d842fe1ae0 minuitwrp: Fix detection of libdrm on Pie
external/libdrm was fully converted to Android.bp on Pie, causing
the wildcard to match nothing, even though libdrm is present in
the build tree. Change it to cover both build files.

Change-Id: I4b092b29ac021cc1aa3bcf7346b225b79fd99f4b
2019-01-16 16:43:49 +08:00
Simon Shi fcfc634ea6 twrp: Fix unsigned compare compile warning.
Change-Id: I7e847e76932a6ceea3e669e8b8b9ec35e5ef9d9d
2019-01-16 16:43:46 +08:00
notsyncing c7c78d2fea minuitwrp: Support haptics drivers registered with LED class framework
This type of vibrator is found on newer kernel versions (4.9+) and
registers with LED class framework (located at /sys/class/leds/vibrator).

Change-Id: I85e93fdac17b3f4b6f2ae689bbbd490806b5c29b
2019-01-16 16:43:42 +08:00
notsyncing 8e4e8ec2f9 minuitwrp: Respect TARGET_RECOVERY_PIXEL_FORMAT config.
Respect TARGET_RECOVERY_PIXEL_FORMAT config in screenshot, graphics.
This fixes other wrong theme color in minuitwrp on Xiaomi MIX 2S.

Change-Id: Ieb8480c411e2f0c72cc50ffca66943ab025e2b7e
2019-01-16 16:43:30 +08:00
big biff 4d7b0e0350 Merge "vold_decrypt: use ANDROID_ROOT for additional compatibility" into android-9.0 2019-01-12 00:23:03 +01:00
big biff 635874da21 Merge "Include weaver library in 9.0 trees" into android-9.0 2019-01-06 19:30:20 +01:00
Ethan Yonker 66bcd499e5 Fix building in Lineage 16.0
Change-Id: Ia7c66d469c69d9c4e9263feae7b48d40c09af155
2019-01-03 20:28:16 -05:00
Captain Throwback 6ac30afd69 vold_decrypt: use ANDROID_ROOT for additional compatibility
Rather than using hard-coded system, use ANDROID_ROOT
environment variable to allow AB devices to mount
system_root at a custom path. This allows the /system
path to be bind mounted from $ANDROID_ROOT/system
so that the vold_decrypt paths can remain unchanged.

Change-Id: I9a7b13385e43f169f1df4c75b2a003fc6913952c
2018-12-25 17:57:47 +01:00
big biff 09ee3ea422 Merge "twrp: use ANDROID_ROOT environment variable" into android-9.0 2018-12-24 16:08:07 +01:00
big biff cbd8cc5e06 Merge "Add option to use ro.serialno for generating device id" into android-9.0 2018-12-24 01:45:46 +01:00
Vladimir Oltean 4780286346 prebuilt: resolve libext2_misc.so dependency for mke2fs
* Following error while running mke2fs in TWRP compiled in 8.1+ tree:
   libc: CANNOT LINK EXECUTABLE "mke2fs": library "libext2_misc.so" not found

Change-Id: I786f325229167dbd0d1d5f2a1ea95e9fe15a227e
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
2018-12-23 05:57:20 +01:00
Ethan Yonker 6b3bdfd6fa Include weaver library in 9.0 trees
Change-Id: I0e05e29b43c748d7746dc70428a4eb7664b7d2d4
2018-12-21 11:54:57 -06:00
big biff 16badcea76 Merge "Fix sha2 generation persistence." into android-9.0 2018-11-30 00:32:22 +01:00
Andreas Schneider e14fb93f08 minui: Don't include errno.h twice
Change-Id: Id119ca2f34fb072e70037dbb6858799e94c74043
2018-11-14 00:21:42 +01:00
Simon Shields 2e9747f5b2 Revert "updater: Remove dead make_parents()."
This reverts commit 5902691764.

Change-Id: I69eadf1a091f6ecd45531789dedf72a178a055ba
2018-10-11 18:11:26 +02:00
lambdadroid fc0b16df8b Add option to use ro.serialno for generating device id
On some devices (e.g. ASUS Zenfone) the serial number of the device
is stored in a file in the /factory partition. Consequently, the only
way to load it is using a user space application during the init
process, and to update the ro.serialno system property.

In most places, TWRP already uses the system property to get the
serial number of the device. However, when generating the device ID
used for the backup folder name it checks the boot command line
directly. On these devices, the serialno is not included on the
command line.

Add a TW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID option that enables
usage of ro.serialno for generating the device id. It is disabled
by default to avoid changing the device id on existing ports.

Change-Id: I4a2eeca883f38fdaeb1209507fd8ebe44b1b04a0
2018-09-26 23:53:28 +02:00
lambdadroid c4faea8c5b Fix build error on Pie with TW_NO_LEGACY_PROPS := true
Fixes:
bootable/recovery/twinstall.cpp:83:12: error: unused function 'switch_to_legacy_properties' [-Werror,-Wunused-function]
static int switch_to_legacy_properties()
           ^
bootable/recovery/twinstall.cpp:110:12: error: unused function 'switch_to_new_properties' [-Werror,-Wunused-function]
static int switch_to_new_properties()
           ^
bootable/recovery/twinstall.cpp:176:13: error: unused function 'update_binary_has_legacy_properties' [-Werror,-Wunused-function]
static bool update_binary_has_legacy_properties(const char *binary) {
            ^
3 errors generated.

Change-Id: Ie30fd7ae74b00e791100572b49a17ff638212e5a
2018-09-26 22:56:51 +02:00
bigbiff bigbiff 9ee4a8577e Fix sha2 generation persistence.
Change-Id: I8342ee36f996a0305632bdb6eb8b20ae4e93873b
2018-09-19 19:15:06 -04:00
Ethan Yonker 007de98f69 Fix header file for property_get
Change-Id: Id8a8c0e2b5a0a6d5b656fe8f517ded5df512b1a1
2018-08-31 14:24:41 -05:00
Ethan Yonker e9afc3de0f Decrypt FBE on 9.0 (backwards compatible)
Building in 9.0 may require you to add a flag to your twrp fstab
with the fileencryption details like:
fileencryption=ice:aes-256-heh

Verify this against your device's stock fstab of course.

Change-Id: If9286f5d5787280814daca9fbc8f5191ff26a839
2018-08-31 10:37:08 -05:00
Captain Throwback 9d6feb5311 twrp: use ANDROID_ROOT environment variable
instead of hard-coded /system path

I updated most of the references I found,
but there might be more

For devices that have to mount system at /system_root,
this allows system to be bind mounted to /system
and detected properly by TWRP

Change-Id: I9f142fd8cec392f5b88e95476258dab9c21a9aac
2018-08-24 12:47:45 -04:00
Ethan Yonker 58f2132bc3 Merge AOSP android-9.0.0_r3
Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0

Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
2018-08-24 11:17:39 -05:00
Sean hoyt 32aef7a2cf Remove remaining pieces of supersu
Change-Id: I8f92c19f9e947da29dc25f3b88f69413a13af64d
2018-07-30 10:29:46 +02:00