Controlling the APK navigation bar

By default, the APK runtime ensures that applications can't dismiss the navigation bar and its back button.

About the APK navigation bar

APK apps use the "back" action in the same way that a back button is used on a web browser. On many mobile devices (phones and tablets) the "back" function is implemented by a dedicated hardware (physical) button on the device. On the QNX platforms, this back button appears in the APK runtime navigation bar. This navigation bar is located above the QNX tab/navigation bar at the bottom of the screen. It has only a single icon: the back button is used to inititiate the back action.

A system built with a QNX platform might not include a hardware back button. By default, therefore, the APK runtime ensures that applications can't dismiss the APK runtime navigation bar and its back button, because with neither a hardware button nor a screen button, the user can no longer initiate the "back" action.

Showing and hiding the APK navigation bar

The default setting that locks the APK navigation bar on the screen is controlled by a parameter in the APK runtime configuration file:
//apps/sys.apkruntime.gYABgKAOw1czN6neiAT72SGO.ns/native/system/init.cfg
In this file, the line:
setprop car.lock.NavBar true
ensures that the APK navigation bar can't be dismissed.
If your implementation needs to allow applications to dismiss the APK runtime navigator bar, you can set this configuration parameter to false:
setprop car.lock.NavBar false

Once you've unlocked the APK navigation bar, the presence of the bar can be controlled by sending SWIPE_DOWN commands to the APK Runtime control PPS object.

For example, if the APK navigation bar is displayed, sending echo "msg::SWIPE_DOWN" to the /pps/services/apkruntime/control PPS object will hide the APK navigation bar. Sending a second echo "msg::SWIPE_DOWN" will display the APK navigation bar again.

Using the SWIPE_DOWN command will result in a bar at the top of the application display area. This bar contains a Hide Bar icon or a Pin Bar icon, depending on whether the APK navigation bar is displayed or hidden. Touching these icons hides or shows the APK navigation bar.

Note: With neither a hardware button nor a screen back, the user can no longer initiate the "back" action. This may leave an application running with no way for the user to properly navigate within the app.