[Xiaomi Redmi 4X Guides, News, & Discussion] tweakradje:
PLEASE don't quote first post. Waste of space and it will change anyway. THANKS

Data partition is encrypted

I found that the data partition is encrypted when coming from Miui ROM to RR. Fingerprint is not working with encrypted data partition.

Data is encrypted if TWRP asks for unlock code.

These steps decrypts it and preserves data.

- Boot into TWRP
- Backup /data to "internal sd" (or to "ext sd card") with TWRP
- On PC: adb pull /data/media/0
- Wipe -> Format /data in TWRP
- Reboot to TWRP again
- On PC: adb push . /data/media/0
- On PC: adb shell chown -R media_rw.media_rw /data/media/0
- Reboot to TWRP again
- Restore the previous backup with TWRP
- On PC: adb shell rm /data/system/locksettings* /data/system/*.key
- On PC: adb shell rm -r /data/dalvik*
- Reboot

Change Doze (deviceidle) settings

On the device you can change the Doze settings very easy. First list the Doze settings to get all current parameters:

dumpsys deviceidle

Then change parameters by setting some variables in the Android Global Settings db:

settings put global Phenotype_flags device_idle_constants
settings put global device_idle_constants inactive_to=300000,idle_after_inactive_to=300000

Enable light doze too (mLightEnabled=true mDeepEnabled=true)

dumpsys deviceidle enable all

Add whatsapp and gmail to the whitelist

dumpsys deviceidle whitelist +com.whatsapp +com.google.android.gm

Note: Google Play Services reset the device_idle_constants to "null" every few hours. Solution: pm disable --user 0 com.google.android.gms/.phenotype.service.sync.PhenotypeConfigurator

See more info in post above

Use Fingerprint sensor as button

As you might know hardware keys have keycodes. These keycodes can be found using an app like KeyEvent Dipslay

The mapping between Keycode and Function is done in the kl files in the folder /system/usr/keylayout

To map the Fingerprint key (Keycode 353) you use the gf3208.kl file.

#key 353 ENTER
#key 353 CAMERA
#key 353 MENU
key 353 SLEEP

Reboot for effect. This will not effect the Fingerprint function.

Super audio for Resurrection Remix

To enable HD audio for headphones and other audio tweaks for RR (maybe for Miui too)

Add these lines to the end of your build.prop

audio.offload.disable=false
audio.offload.buffer.size.kb=1024
persist.audio.FFSP.enable=true
audio.nat.codec.enabled=true
persist.audio.hifi.int_codec=true
persist.audio.dirac.speaker=false
use.dts_eagle=true

Some tweaks for camera driver

To enable some extra features to play with. You can add these to the end of your build.prop

For the stock camera on RR ROM make sure you disable Color Denoise setting.

#persist.camera.liveshot.size=1280x720
persist.camera.HAL3.enabled=1
persist.camera.hal3hfr.enable=1
persist.camera.ltmforseemore=1
persist.camera.led.on.period=500
persist.camera.stats.af.paaf=1
persist.camera.manual.capture=1
# high temp? then lower fps (or frameskip)
persist.camera.thermal.mode=fps
persist.camera.opt.livepic=1
# Chromatic Aberation enabled? Check logcat grep -i chroma
# E mm-camera: <IMGLIB><ERROR> 695: module_cac_handle_aec_update: module_cac_handle_aec_update 695: Invalid chromatix ptr
persist.camera.feature.cac=1
persist.camera.eis.enable=1
persist.denoise.process.plates=2
persist.camera.longshot.stages=1
persist.camera.facedetect=1
persist.camera.snapshot.fd=1
# face detect in video 0 1 2(only for focus)
persist.camera.fdvideo=1
persist.camera.mem.usepool=1
persist.camera.mem.usecache=5000000
persist.sys.exif.make=Xiaomi
persist.sys.exif.model=Redmi 4X
persist.camera.feature.shutter=1
persist.camera.auto.hdr.enable=1
persist.camera.tintless=1
#persist.camera.continuous.iso=200
#persist.camera.exposure.time=
# dual camera range finding
persist.camera.dcrf.enable=0
persist.camera.multi_pass=1
persist.camera.zsl.mode=1
persist.camera.zsl.interval=1
persist.camera.zsl.backlookcnt=2
persist.camera.zsl.queuedepth=2
# zigzag hdr
persist.camera.zzhdr.enable=1
persist.camera.zzhdr.video=1
persist.camera.eztune.enable=0
# TemporalDenoise (Supported at all?)
persist.camera.tnr_cds=1
persist.camera.tnr.snapshot=1
persist.camera.tnr.video=1
persist.camera.tnr.preview=1
# low light noise enabled?
persist.camera.llnoise=1

More will follow :)