Default [How-to] auto-switch to 1080p on slimport, using tasker

Both the nexus 4 and the nexus 7 (2013) support slimport, which is very useful for mirroring the device to a big screen. However, neither device uses the standard 16:9 (1080p) aspect ratio. As a result, you end up with some cropping on a 1080p TV. For the nexus 4 it is even worse, since it outputs 768p upscaled to the TV's resolution.

However, the flexibility of android allows us to manually change the native resolution. In a console, we can type the command:

wm size 1080x1920

and the resolution will change. In the device screen the new resolution will look odd, however you now have true 1080p on the TV. To get back to the default resolution you type:

wm size reset

This solution works, but it is not very convenient. So I made two profiles for tasker, that automatically change the device resolution upon the connection of an HDMI cable and reset it when the cable is disconnected, thus automating the whole process.

I 'm attaching a screenshot of the two profiles, as well as a zip file so you can extract and import them in tasker.

In summary,
- you need root

- the HDMI plugged profile
reduces the device brightness to minimize battery consumption
increases volume
sets resolution to 1080p
enables WiFi
sets display timeout to 10 hours
activates display rotation

- the HDMI un-plugged profile
sets auto brightness back on
resets screen resolution
sets display timeout to 1min

These are optional settings that I found useful to automate, but they are all optional, and you can tweak them once you imported the profile to tasker.

I hope you find this useful!!!
Attached Thumbnails
Click image for larger version

Name:	HDMI_plugged.png
Views:	121
Size:	42.5 KB
ID:	2804101   Click image for larger version

Name:	HDMI_unplugged.png
Views:	111
Size:	28.4 KB
ID:	2804102  
Attached Files
File Type: zip auto_slimport_tasker.zip - [Click for QR Code] (1.1 KB, 9 views)

Phone: Nexus 4 (E960)
ROM: android 4.4.4
Kernel: ak
Recovery: TWRP 2.7.1.0
Launcher: Nova launcher Prime

Other devices: Nexus 7 LTE (2013)
Previous devices: Nexus S (i9023)