Can you believe just a decade ago most mobile phones struggled to load a simple web page? Today we are using mobile devices more powerful than many PCs back then. But technology can only bring you so far. We’ve all been there, when your phone just reboots for no reason. It has happened to all of us and its not a big deal, unless your phone was encrypted. Because then the phone sits, not taking calls, not pulling down email, and wasting battery life as it waits to decrypt.
A reboot on an encrypted device means we aren’t logged in, preventing many background tasks from working. It’s even worse if you use your phone as an alarm clock or reminder.
In Android 7.0 Nougat, Google is tackling this problem with a new feature called Direct Boot. Direct Boot mode allows apps to communicate and interact with us before we have unlocked our phone after a reboot. It will let an app (or part of an app) run as soon as your phone is finished booting and before you sign in. In other words, it provides apps with the ability to perform limited tasks in a restricted mode. Although, not every app needs to use direct boot and the developers should keep that in mind before enabling it.
Here’s how things worked until Android Marshmallow. When your phone gets turned on or recovers from a reboot, the operating system loads and then everything halts while it waits for user input. That means you need to enter your password or PIN or you need to swipe your pattern. Even if you don’t lock your phone you need to swipe the lock screen away. If you have an encrypted phone, the data you have stored stays encrypted and unavailable by any means until you get logged in. That’s a good way to help you keep unwanted eyes off of your stuff.
With Android N Google introduced a new step in this boot process wherein once the OS is loaded, it lets certain apps run with limited functionality. Everything else stays locked and the apps can not interact with your device data. For such apps there is a new storage area on the memory named Device Storage.
Let’s understand this better with an example of how this would work with, say, a messenger client like Whatsapp. The developers of the messenger can allow the app to collect messages and fire off a notification before you unlock your phone for the first time, but you wouldn’t be able to access your photos to send a reply because they are protected by your login password. To get to them you would need to log on. For encrypted devices, Direct Boot mode allows for data in the new Device Storage area to run while the rest of the data on the phone stays encrypted. It’s well balanced compromise between security and convenience.
However, as mentioned earlier, the Direct Boot feature is not meant for every app. The new mode is reserved for things that you need right away and you don’t want to miss after a reboot. Examples are your alarm clock, your texting app, or an app that helps in the accessibility department — these are the types that need to run right away. Nobody wants ads and useless notifications from games every time the phone restarts. However, Google is aware of the potential abuse of the feature and if an app is on the Google Playstore you can report about it, and Google says these claims will be taken seriously and apps will be removed from the store without hesitation.
Much often we wish to see UI improvements or a visual change in the software, but Direct Boot is one of those features that are not visible but improve the user experience notably and require a lot of creative thinking and engineering on the developer’s part.
You can learn more about Direct boot from a developer’s perspective on the Android Developer website here.