What is System UI
By The Nerdy Geek, Community Contributor - September 3, 2024
Mobile devices have become pivotal to users with the rise in smartphone users globally as the number of smartphone users have been over 6.5 billion in 2022. It is expected to rise further to 7.6 Billion by 2027 as seen in the graph below.
Source: Statista
Android is the world’s most popular operating system, with over 2.5 billion active users in 190 countries. It is developed by Andy Rubin as an open-source alternative to iPhone and Palm OS, became the most popular mobile operating system in the early 2010s. Android has always been known for providing users with options to customize the System UI.
Global Market Share of the Android OS
If you are also looking forward to customizing the look and feel of your Android mobile, then System UI is the answer. It is a type of User Interface that helps users to customize their Android mobile device displays independently, i.e., without any application.
In order to understand it better, “Everything apart from Apps that you see in any android device is System UI.”
Let us explore more about System UI.
- What is System UI?
- How does System UI in Android work?
- Customize System UI
- Why Customize the System UI in a Software Testing Scenario
- The Overlay Directory in Android
- How is the Overlay Directory useful for Software Testers?
What is System UI?
System UI as said is “Everything you see in Android that’s not an app”. This indicates that System UI is customizable without the need for any app update.
System UI rather is an important part of any Android user experience. It provides the basic framework for controlling the user interface of Android devices. It includes the navigation bar, the status bar, the lock screen, and the notification bar.
You must understand that System UI is not an application that can be installed or downloaded on any Android device. It is rather the software that is running on the device and is controlling the visual interface of the device.
Why is UI important for an application?
UI is crucial for user engagement as it directly connects with the user while supporting the applications’ functionality. An efficient UI ensures smooth interaction between the user and the app and as a result, attracts more end users to the application and gives them a great experience.
Which is why UI is very important during App Development keeping user enagemement at the centre of the development process. To ensure a high-quality user experience, UI Testing is performed rigorously before any release.
Read More: What is Android UI Testing?
How does System UI in Android work?
System UI is an internal application running on an Android device that runs when the device is powered on. This application is started through reflection by the SystemServer. The entry points of SystemUI are listed below which are basically used to customize the Android system UI.
- config_statusBarComponent
- config_systemUIFactoryComponent
SystemUI framework also has different functions specific to different functionalities. For example,
- When the system is initialized, SystemUI.onCreate is used to call the SystemUI.onCreate function.
- In SystemUI.onStart(), a call is made to call the system’s startup button.
- In case the system has restarted after being paused for a certain amount of time, the SystemUI.onResume() function is used.
- The SystemUI.onPause() function is used when the system has been paused and the SystemUI.onReboot() function is used when the system boots up.
Read More: How to test .aab file on Android device
Customize System UI
System UI customization in Android refers to altering user interface elements such as the home screen, status bar, and navigation buttons to meet personal preferences or testing requirements. This customization allows users to personalize their experience by changing themes, icon packs, and widgets, improving usability and aesthetics.
However, extensive customization can result in compatibility issues or poor performance, particularly on lower-end devices. Examples include utilizing custom launchers such as Nova Launcher, installing icon packs, and changing the layout of quick settings and navigation bars.
Why Customize the System UI in a Software Testing Scenario
Customizing the system UI during testing is frequently done to achieve specific testing aims that can improve the quality, relevance, or dependability of the testing process. Here are some reasons why testers may desire to customize the system UI when testing.
- Simulating Real World User Environments: Customizing the System UI allows testers to imitate real-world contexts and user setups, such as different themes, icon packs, and configurations, to ensure that the app operates properly across a wide range of user-customized settings.
Also, by customizing the system UI language, font size, and other parameters, testers may ensure that the program works properly with multiple languages and regions thereby performing localization testing.
BrowserStack App Live allows you to test your app in various languages on real devices. This enables you to verify localized resources such as app strings, visuals, data formats, and text inputs, ensuring your app functions correctly across different language settings. - Performance Testing by Simulating Resource Constraints: Modifying the user interface, such as enabling animations or utilizing heavy themes, allows testers to generate scenarios where the system’s resources are under strain. This aids in discovering performance bottlenecks in low-end devices or in resource-constrained environments.
- Accessibility Testing by Customizing the system UI with accessibility options (e.g., larger fonts, high contrast, screen readers) ensures the application is usable and meets accessibility standards.
App Accessibility Testing allows you to get complete accessibility coverage for your iOS and Android apps with no setup required. Simply submit your application and begin testing on actual devices. - Checking UI Consistency across Themes: It is critical that the app’s user interface remains consistent and visually appealing across multiple system themes or custom launchers. Customizing the UI enables testers to ensure that the app’s interface elements, such as buttons and text, are properly shown regardless of the user’s theme.
- Testing Device Fragmentation: Android’s fragmentation between OEM skins (e.g., Samsung, Xiaomi) might result in unique UI customizations. Customizing the system UI allows testers to confirm compatibility and functionality across many manufacturer UIs.
Real device cloud like BrowserStack is very helpful in testing the Device Fragmentation on real devices to ensure consistency across different Android devices. - Security and Privacy Testing Custom Lock Screens and Security Settings: Testing an app’s behavior with various security configurations (e.g., fingerprint, PIN, or pattern unlock) is crucial for apps handling sensitive data. Customizing the system UI enables testers to ensure that the app handles certain circumstances securely.
However, app developers must verify that System UI integrations are completed appropriately in order to identify and eliminate errors before releasing an app to users.
Customizing the Android System UI traditionally required altering the source code, which could complicate future Android updates. To mitigate this, Android introduced an overlay directory, allowing developers or advanced users to modify resource files by overriding them, without directly changing the source code.
This approach simplifies customization while maintaining compatibility with system updates.
The Overlay Directory in Android
Android’s overlay directory allows developers and advanced users to customize the system UI by changing resource files without modifying the core source code. This makes it easier to modify themes, layouts, and other UI elements while keeping them intact throughout system updates. Using overlays reduces the chance of conflicts and problems caused by direct code changes, allowing for more flexible and maintainable UI customizations.
In the Android build system, the overlay mechanism allows files to be overridden in a controlled way, making it easy to identify all modified files without needing to navigate the entire AOSP source code tree.
Overlay files should be placed in the `PRODUCT_PACKAGE_OVERLAYS` directory and must replicate the exact sub-folder structure of the original AOSP root. For Android 10 and higher, `PRODUCT_PACKAGE_OVERLAYS` is configured as follows:
PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
How is the Overlay Directory useful for Software Testers?
The overlay directory is very useful in software testing because it allows testers to easily apply and undo custom UI changes without affecting the underlying code. This allows for controlled testing of alternative themes, layouts, and configurations, guaranteeing that the app performs consistently across several UI customizations.
Additionally, by employing overlays, testers can replicate alternative user settings and system configurations, assisting in the identification of potential issues that may develop in a variety of real-world scenarios, all while remaining compatible with system updates.
Another approach to customize the Android System UI is to modify the user switcher, lock screen, and first-time user setup. For example, the OEM can customize the user switcher through Quick settings, the lock screen, and the first-time user setup via API.
Customize user Switching and Unlocking
Customize user switching – Keyguard and bouncer
In Android Automotive OS, the Keyguard panel with a user picker appears only when the user selects the Cancel button on the lockscreen. The Keyguard screen is displayed below.
When the user selects a privacy type to unlock the device, it displays a lock screen with a bouncer, as shown below.
When the lock is set to manually turn the power on or off, use the following instructions:
adb shell input keyevent 26
User picker
When a device in the car’s System UI status bar and Maps reboots, the user picker screen appears.
The layout of this screen can be modified in car_fullscreen_user_switcher.xml.
Loading screen
The loading screen appears whenever a user switches, regardless of the entrance point. For example, via the user picker or the Settings screen. The loading screen is part of the framework System UI and corresponds to the public class CarUserSwitchingDialog. See Figure 3 for an example.
The theme can be modified using the command
Theme_DeviceDefault_Light_Dialog_Alert_UserSwitchingDialog
The initial Setup Wizard sequence allows the driver to create their own user name while setting up the Android user. If the driver later associates the Android user with a Google account, the username is taken from that account. However, if the driver selects a name, such as DriverB, and then later associates that user name with their Google Account under the name Henry, the originally allocated name (DriverB) is not modified because it was deliberately set. The driver can only modify the name in the Settings menu.
The layout can be customized in car_user_switching_dialog.xml.
How to use System UI?
Initially, Android came up with something called the System UI Tuner. This system UI tuner is a customization menu located within the Android device settings.
This tuner enables a user to adjust the navigation and status bars on the device interface or make an app viewable when in fullscreen mode.
What is System UI Tuner?
In order to improve overall user experience, Android came up with System UI Tuner which allows users to customize their phone’s display.
Some of the functions of the System UI Tuner are listed below.
Functions of the System UI Tuner
- Enable dark theme or night mode
- Customize calls, alerts, or notifications that you want to receive or block while your phone is in Do Not Disturb mode.
- Turn on or off icons in the status bar.
- Customize the Quick Settings panel.
- Adjust the status and navigation bars.
The System UI tuner enables the user to tweak the device UI in different ways. Google permits the developers to control the System UI visibility based on their requirements.
For example, If you are building a video player and need the navigation bars to hide automatically when turning on full-screen mode. You can achieve this through the System UI framework and make it work for the application.
What are the advantages of implementing the system UI tuner?
System UI Tuner can prove to be a boon when it comes to improving and customizing applications.
When a user downloads an app, uses it, and doesn’t like the interface or the overall experience, the user won’t take more than a few minutes to uninstall it. Hence, developers rely on the System UI tuner quite a lot to achieve easy, efficient, and flexible interfaces.
How To Enable the System UI Tuner
In Android 6 Marshmallow, Android came up with a hidden System UI Tuner and later allowed this feature in Android 7 Nougat. However, it was not that easy to access the tuner in the previous versions. One would need to use ADB commands or an app to access the hidden System UI Tuner.
For enabling System UI Tuner on Android 6 and 7, one can follow the below steps.
- The first step is to slide down the notification tray on your Android device to open the Quick Settings mode.
- Next, you need to press and hold the gear icon that appears at the top right corner for a few seconds.
- Then you will see a notification message informing you that System UI has been added to Settings. In case you don’t see the message, your device might not be having the System UI Tuner.
- In order to confirm that it has been enabled, you can open the Settings menu and scroll to the bottom of the screen. You should see the System UI Tuner.
How To Disable The System UI Tuner
In case you are done using the System UI tuner and you need to go back to your default settings, you can disable the System UI tuner. Follow the below steps to do the same.
- Click the Settings menu
- Scroll to the bottom of the screen until you find the System UI tuner.
- Click on the same
- Click on the three-dot menu that appears at the top right corner of your screen.
- Click on Remove from Settings.
- A pop-up will appear in order to confirm if you really want to remove the System UI Tuner
- Click on Remove and the System UI Tuner will be removed from your device.
Also Read: What are different Android UI Layouts?
Troubleshooting issues with System UI Tuner
In case you are seeing a message on your phone saying “System UI Has Stopped Working” or something similar to it, and you are wondering how to fix it.
You can probably try one of the below steps to fix it.
- Try Restarting your phone – This is probably the most easiest and effective solution, restarting mostly solves the System UI tuner.
- Update System OS – There might be an underlying bug in your phone’s OS causing the issue, so you can check for any system updates, download and install the same. Being on the latest system OS version might solve all the issues.
- Update or Uninstall third-party apps – In case you have some third-party apps having any bugs, you can probably locate and update them. If that also doesn’t work, you can probably uninstall the apps.
- Factory Data Reset – The last option is to try Factory Data Reset but before doing this ensure you have all your data backed up on Cloud Storage.
Test on Real Android Devices
To ensure more accurate test results, and understand the look and feel of the application under real user conditions, it is recommended to test applications on real devices. However, Device Fragmentation pose a major concern, with new Android devices releasing in the market. It becomes necessary to ensure a better device coverage for delivering a seamless experience to the end users irrespective of the device they use.
To do so, you would need to test the application on different devices available in the market – both latest and the legacy devices. This would require setting up a digital lab where you can test the application on real devices. However, building digital lab is very costly and require regular maintenance. Which is why Build vs Buy is a common question to decide whether to build an in-house lab or subscribe a cloud-based platform like BrowserStack.
Taking subscription of a real device cloud like BrowserStack is cost-effective and it allows you to test on a large number of devices both latest and legacy. BrowserStack App Live enables you to test you Mobile Application on Samsung Galaxy (S4 -S22), Google Pixel, and Xiaomi devices to ensure a comprehensive testing experience.