Android x86 desktop

I have installed Android x86 on a Dell laptop under its own partition.

The standard navigation bar takes up quite a chunk of space at the bottom. It will be good to remove it.

Pressing the Windows key will make Android go to the home screen. Unfortunately, the keyboard does not has a Back key. The keyboard does has a number of redundant keys, like, it has a normal Enter key and another numpad Enter key. We can convert the numpad Enter key to be the Android Back key. By doing so, we can remove the standard navigation bar permanently to free up more screen space.

To modify the keyboard numpad Enter key to be the Back key, one can modify the system file /system/usr/keylayout/Generic.kl

Change the following line in Generic.kl , replace the NUMPAD_ENTER by BACK

key 96 NUMPAD_ENTER

so it becomes

key 96 BACK

Assuming now that both Android home and back buttons can be handled via the keyboard Windows and numpad Enter key, (yet to be tested) the navigation bar can be removed by adding the following line to /system/build.prop .

    qemu.hw.mainkeys=1


Files under /system is mounted read-only from Android x86 system.sfs . We have to unpack system.sfs to modify files within it using Linux utility. (My android partition is /dev/sda8 )

Steps to unpack and mount android /system under Linux with root user:

    cd /mnt
mount /dev/sda8 d
cd d/android-9.0-r2/
mkdir system
unsquashfs system.sfs
mount squashfs-root/system.img system


Next, to change NUMPAD_ENTER to BACK in Generic.kl and adding a line to /system/build.prop

    vi system/usr/keylayout/Generic.kl
echo "qemu.hw.mainkeys=1" >> system/build.prop


Last, to repack the modified system.sfs:

    umount system
rm system.sfs
mksquashfs squashfs-root/system.img system.sfs
rm squashfs-root/system.img && rmdir squashfs-root && rmdir system


Now, we can reboot back to Android to test the changes to system.sfs, and all should be ok.


Android x86 comes with a pre-installed taskbar com.farmerbb.taskbar located in /system/priv-app/Taskbar/Taskbar.apk

The taskbar version is 5.0.1

Taskbar lets you launch apps in freeform floating windows on Android 7.0+ devices. Taskbar puts a start menu and recent apps tray on your screen that's accessible at any time. These features make the Android system more like a desktop.

Braden Farmer, the developer of Taskbar, had written an article on xda-developers.com - https://www.xda-developers.com/android-nougats-freeform-window-mode-what-it-is-and-how-developers-can-utilize-it/

The Taskbar has released a newer version 6.0 on Google Play. One can install this new version alongside the system version. (The system Taskbar uses a different package name: com.farmerbb.taskbar.androidx86) I need to launch the Taskbar in maximized window (right-click icon -> new window )

Since the newer Taskbar is working, we can delete the pre-installed /system/priv-app/Taskbar/Taskbar.apk from the Android x86 system.sfs in Linux.

The only issue I have with the newer version is that it's recent apps does not allow showing running apps only. (which is the default in the pre-installed taskbar and it works)

Even if I put the newer Taskbar.apk into the /system/app path, as a system app, it can now set running_apps_only option, but it will not display any apps on the recent bar. This issue can be traced to taskbar is using the API ActivityManager.getRecentTasks for running_apps_only option. getRecentTasks was deprecated in API level 21 and does not work for a user app. (due to the app signature?)

I have also discussed about getRecentTasks in Technical details of App Gatekeeper version 1.1

Comments

blog comments powered by Disqus